@contractspec/bundle.marketing 3.7.5 → 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.
- package/.turbo/turbo-build.log +84 -84
- package/AGENTS.md +29 -21
- package/CHANGELOG.md +27 -0
- package/README.md +36 -49
- package/dist/browser/components/marketing/ChangelogPage.js +8 -8
- package/dist/browser/components/marketing/CofounderPage.js +167 -523
- package/dist/browser/components/marketing/ContactClient.js +200 -207
- package/dist/browser/components/marketing/ContributePage.js +211 -463
- package/dist/browser/components/marketing/DesignPartnerPage.js +165 -218
- package/dist/browser/components/marketing/LandingPage.js +464 -568
- package/dist/browser/components/marketing/PricingClient.js +213 -839
- package/dist/browser/components/marketing/ProductClientPage.js +265 -463
- package/dist/browser/components/marketing/index.js +2007 -3338
- package/dist/browser/components/marketing/pricing-thinking-modal.js +12 -12
- package/dist/browser/components/marketing/sections/AudienceSection.js +2 -2
- package/dist/browser/components/marketing/sections/CorePositioningSection.js +2 -2
- package/dist/browser/components/marketing/sections/CtaSection.js +3 -3
- package/dist/browser/components/marketing/sections/FearsSection.js +3 -3
- package/dist/browser/components/marketing/sections/HeroMarketingSection.js +6 -6
- package/dist/browser/components/marketing/sections/IconGridSection.js +2 -2
- package/dist/browser/components/marketing/sections/OutputsSection.js +2 -2
- package/dist/browser/components/marketing/sections/ProblemSection.js +2 -2
- package/dist/browser/components/marketing/sections/SolutionSection.js +2 -2
- package/dist/browser/components/marketing/sections/StepsSection.js +4 -4
- package/dist/browser/components/marketing/studio-signup-section.js +25 -41
- package/dist/browser/components/templates/TemplatesClientPage.js +2324 -3578
- package/dist/browser/components/templates/TemplatesPage.js +1 -1
- package/dist/browser/components/templates/TemplatesPreviewModal.js +3 -3
- package/dist/browser/components/templates/index.js +2361 -3615
- package/dist/browser/index.js +2363 -3617
- package/dist/browser/libs/email/client.js +1 -1
- package/dist/browser/libs/email/contact.js +1 -1
- package/dist/browser/libs/email/newsletter.js +1 -1
- package/dist/browser/libs/email/waitlist-application.js +1 -1
- package/dist/browser/libs/email/waitlist.js +1 -1
- package/dist/browser/registry/engine.js +2003 -3334
- package/dist/browser/registry/index.js +2003 -3334
- package/dist/browser/registry/registry-docs.js +2 -2
- package/dist/browser/registry/registry-landing.js +2007 -3338
- package/dist/browser/registry/registry.js +2003 -3334
- package/dist/browser/registry/utils.js +2003 -3334
- package/dist/components/marketing/ChangelogPage.js +8 -8
- package/dist/components/marketing/CofounderPage.js +167 -523
- package/dist/components/marketing/ContactClient.js +200 -207
- package/dist/components/marketing/ContributePage.d.ts +0 -2
- package/dist/components/marketing/ContributePage.js +211 -463
- package/dist/components/marketing/DesignPartnerPage.js +165 -218
- package/dist/components/marketing/LandingPage.js +464 -568
- package/dist/components/marketing/PricingClient.js +213 -839
- package/dist/components/marketing/ProductClientPage.js +265 -463
- package/dist/components/marketing/index.d.ts +5 -5
- package/dist/components/marketing/index.js +2007 -3338
- package/dist/components/marketing/pricing-thinking-modal.js +12 -12
- package/dist/components/marketing/sections/AudienceSection.js +2 -2
- package/dist/components/marketing/sections/CorePositioningSection.js +2 -2
- package/dist/components/marketing/sections/CtaSection.js +3 -3
- package/dist/components/marketing/sections/FearsSection.js +3 -3
- package/dist/components/marketing/sections/HeroMarketingSection.js +6 -6
- package/dist/components/marketing/sections/IconGridSection.d.ts +3 -3
- package/dist/components/marketing/sections/IconGridSection.js +2 -2
- package/dist/components/marketing/sections/OutputsSection.js +2 -2
- package/dist/components/marketing/sections/ProblemSection.js +2 -2
- package/dist/components/marketing/sections/SolutionSection.js +2 -2
- package/dist/components/marketing/sections/StepsSection.js +4 -4
- package/dist/components/marketing/studio-signup-section.js +25 -41
- package/dist/components/templates/TemplatesClientPage.js +2324 -3578
- package/dist/components/templates/TemplatesPage.js +1 -1
- package/dist/components/templates/TemplatesPreviewModal.js +3 -3
- package/dist/components/templates/index.js +2361 -3615
- package/dist/index.js +2363 -3617
- package/dist/libs/email/client.js +1 -1
- package/dist/libs/email/contact.js +1 -1
- package/dist/libs/email/newsletter.js +1 -1
- package/dist/libs/email/waitlist-application.js +1 -1
- package/dist/libs/email/waitlist.js +1 -1
- package/dist/node/components/marketing/ChangelogPage.js +8 -8
- package/dist/node/components/marketing/CofounderPage.js +167 -523
- package/dist/node/components/marketing/ContactClient.js +200 -207
- package/dist/node/components/marketing/ContributePage.js +211 -463
- package/dist/node/components/marketing/DesignPartnerPage.js +165 -218
- package/dist/node/components/marketing/LandingPage.js +464 -568
- package/dist/node/components/marketing/PricingClient.js +213 -839
- package/dist/node/components/marketing/ProductClientPage.js +265 -463
- package/dist/node/components/marketing/index.js +2007 -3338
- package/dist/node/components/marketing/pricing-thinking-modal.js +12 -12
- package/dist/node/components/marketing/sections/AudienceSection.js +2 -2
- package/dist/node/components/marketing/sections/CorePositioningSection.js +2 -2
- package/dist/node/components/marketing/sections/CtaSection.js +3 -3
- package/dist/node/components/marketing/sections/FearsSection.js +3 -3
- package/dist/node/components/marketing/sections/HeroMarketingSection.js +6 -6
- package/dist/node/components/marketing/sections/IconGridSection.js +2 -2
- package/dist/node/components/marketing/sections/OutputsSection.js +2 -2
- package/dist/node/components/marketing/sections/ProblemSection.js +2 -2
- package/dist/node/components/marketing/sections/SolutionSection.js +2 -2
- package/dist/node/components/marketing/sections/StepsSection.js +4 -4
- package/dist/node/components/marketing/studio-signup-section.js +25 -41
- package/dist/node/components/templates/TemplatesClientPage.js +2324 -3578
- package/dist/node/components/templates/TemplatesPage.js +1 -1
- package/dist/node/components/templates/TemplatesPreviewModal.js +3 -3
- package/dist/node/components/templates/index.js +2361 -3615
- package/dist/node/index.js +2363 -3617
- package/dist/node/libs/email/client.js +1 -1
- package/dist/node/libs/email/contact.js +1 -1
- package/dist/node/libs/email/newsletter.js +1 -1
- package/dist/node/libs/email/waitlist-application.js +1 -1
- package/dist/node/libs/email/waitlist.js +1 -1
- package/dist/node/registry/engine.js +2003 -3334
- package/dist/node/registry/index.js +2003 -3334
- package/dist/node/registry/registry-docs.js +2 -2
- package/dist/node/registry/registry-landing.js +2007 -3338
- package/dist/node/registry/registry.js +2003 -3334
- package/dist/node/registry/utils.js +2003 -3334
- package/dist/registry/engine.js +2003 -3334
- package/dist/registry/index.js +2003 -3334
- package/dist/registry/registry-docs.js +2 -2
- package/dist/registry/registry-landing.js +2007 -3338
- package/dist/registry/registry.js +2003 -3334
- package/dist/registry/utils.js +2003 -3334
- package/package.json +29 -29
- package/src/bundles/MarketingBundle.ts +273 -273
- package/src/components/marketing/ChangelogPage.tsx +72 -100
- package/src/components/marketing/CofounderPage.tsx +120 -384
- package/src/components/marketing/ContactClient.tsx +164 -154
- package/src/components/marketing/ContributePage.tsx +139 -313
- package/src/components/marketing/DesignPartnerPage.tsx +133 -171
- package/src/components/marketing/LandingPage.tsx +353 -25
- package/src/components/marketing/PricingClient.tsx +192 -437
- package/src/components/marketing/ProductClientPage.tsx +255 -377
- package/src/components/marketing/index.ts +5 -5
- package/src/components/marketing/pricing-thinking-modal.tsx +197 -197
- package/src/components/marketing/sections/AudienceSection.tsx +55 -56
- package/src/components/marketing/sections/CorePositioningSection.tsx +37 -37
- package/src/components/marketing/sections/CtaSection.tsx +49 -50
- package/src/components/marketing/sections/DevelopersSection.tsx +26 -27
- package/src/components/marketing/sections/FearsSection.tsx +36 -37
- package/src/components/marketing/sections/HeroMarketingSection.tsx +59 -59
- package/src/components/marketing/sections/IconGridSection.tsx +71 -71
- package/src/components/marketing/sections/OutputsSection.tsx +51 -52
- package/src/components/marketing/sections/ProblemSection.tsx +39 -40
- package/src/components/marketing/sections/SolutionSection.tsx +39 -40
- package/src/components/marketing/sections/StepsSection.tsx +47 -48
- package/src/components/marketing/studio-signup-section.tsx +39 -41
- package/src/components/templates/TemplatesClientPage.tsx +727 -685
- package/src/components/templates/TemplatesPage.tsx +110 -110
- package/src/components/templates/TemplatesPreviewModal.tsx +197 -198
- package/src/index.ts +4 -4
- package/src/libs/email/client.test.ts +81 -81
- package/src/libs/email/client.ts +111 -111
- package/src/libs/email/contact.ts +35 -35
- package/src/libs/email/newsletter.ts +46 -46
- package/src/libs/email/types.ts +29 -29
- package/src/libs/email/utils.ts +5 -5
- package/src/libs/email/waitlist-application.ts +72 -72
- package/src/libs/email/waitlist.ts +46 -46
- package/src/libs/pricing-examples.ts +12 -12
- package/src/registry/engine.ts +16 -16
- package/src/registry/factory.ts +57 -57
- package/src/registry/registry-docs.ts +656 -666
- package/src/registry/registry-landing.ts +94 -95
- package/src/registry/registry.ts +36 -37
- package/src/registry/types.ts +2 -2
- package/src/registry/utils.ts +56 -56
- package/tsconfig.json +11 -11
- 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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
];
|
package/src/registry/registry.ts
CHANGED
|
@@ -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
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
28
|
-
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
...landingPresentations,
|
|
36
|
+
...learningPresentations,
|
|
37
|
+
...docsPresentations,
|
|
39
38
|
]);
|
|
40
39
|
|
|
41
40
|
// Add docBlocks-based presentations
|
|
42
41
|
const docRoutes: DocPresentationRoute[] = docBlocksToPresentationRoutes(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
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
|
-
|
|
65
|
+
route: string
|
|
67
66
|
): PresentationSpec | undefined {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
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
|
-
|
|
83
|
+
return Array.from(presentationRegistry.keys());
|
|
85
84
|
}
|
package/src/registry/types.ts
CHANGED
package/src/registry/utils.ts
CHANGED
|
@@ -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
|
-
|
|
13
|
+
descriptor: PresentationSpec
|
|
14
14
|
): Promise<string> {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const result = await presentationEngine.render<{
|
|
16
|
+
mimeType: string;
|
|
17
|
+
body: string;
|
|
18
|
+
}>('markdown', descriptor);
|
|
19
19
|
|
|
20
|
-
|
|
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
|
-
|
|
29
|
-
|
|
28
|
+
descriptor: PresentationSpec,
|
|
29
|
+
customComponentMap?: ComponentMap
|
|
30
30
|
): Promise<React.ReactElement | null> {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
if (element && typeof element === 'object' && 'type' in element) {
|
|
42
|
+
return element as React.ReactElement;
|
|
43
|
+
}
|
|
44
44
|
|
|
45
|
-
|
|
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
|
-
|
|
54
|
-
|
|
53
|
+
const base = baseUrl ?? 'https://contractspec.io/mdx';
|
|
54
|
+
const llmsBase = base.replace('contractspec.io', 'llms.contractspec.io');
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
// Normalize route
|
|
57
|
+
const normalizedRoute = route === '/' ? '/' : route.replace(/\/$/, '');
|
|
58
|
+
return `${llmsBase}${normalizedRoute}`;
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
70
|
-
|
|
69
|
+
name: string;
|
|
70
|
+
getUrl: (url: string) => string;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
export const aiChatProviders: AIChatProvider[] = [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
...moduleLibrary,
|
|
5
|
+
exports: {
|
|
6
|
+
all: true,
|
|
7
|
+
devExports: true,
|
|
8
|
+
},
|
|
9
9
|
}));
|