@contractspec/bundle.marketing 3.8.8 → 3.8.9

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 (76) hide show
  1. package/.turbo/turbo-build.log +64 -32
  2. package/CHANGELOG.md +30 -0
  3. package/dist/browser/components/templates/TemplateCard.js +83 -0
  4. package/dist/browser/components/templates/TemplateCommandDialog.js +110 -0
  5. package/dist/browser/components/templates/TemplatePreviewContent.js +96 -0
  6. package/dist/browser/components/templates/TemplatesBrowseControls.js +115 -0
  7. package/dist/browser/components/templates/TemplatesCatalogSection.js +284 -0
  8. package/dist/browser/components/templates/TemplatesClientPage.js +840 -917
  9. package/dist/browser/components/templates/TemplatesHeroSection.js +87 -0
  10. package/dist/browser/components/templates/TemplatesNextStepsSection.js +126 -0
  11. package/dist/browser/components/templates/TemplatesPreviewModal.js +136 -126
  12. package/dist/browser/components/templates/index.js +873 -950
  13. package/dist/browser/components/templates/template-catalog.js +81 -0
  14. package/dist/browser/components/templates/template-new.js +23 -0
  15. package/dist/browser/components/templates/template-preview.js +43 -0
  16. package/dist/browser/components/templates/template-source.js +19 -0
  17. package/dist/browser/index.js +873 -950
  18. package/dist/components/templates/TemplateCard.d.ts +12 -0
  19. package/dist/components/templates/TemplateCard.js +78 -0
  20. package/dist/components/templates/TemplateCommandDialog.d.ts +6 -0
  21. package/dist/components/templates/TemplateCommandDialog.js +105 -0
  22. package/dist/components/templates/TemplatePreviewContent.d.ts +5 -0
  23. package/dist/components/templates/TemplatePreviewContent.js +91 -0
  24. package/dist/components/templates/TemplatesBrowseControls.d.ts +13 -0
  25. package/dist/components/templates/TemplatesBrowseControls.js +110 -0
  26. package/dist/components/templates/TemplatesCatalogSection.d.ts +14 -0
  27. package/dist/components/templates/TemplatesCatalogSection.js +279 -0
  28. package/dist/components/templates/TemplatesClientPage.js +840 -917
  29. package/dist/components/templates/TemplatesHeroSection.d.ts +5 -0
  30. package/dist/components/templates/TemplatesHeroSection.js +82 -0
  31. package/dist/components/templates/TemplatesNextStepsSection.d.ts +1 -0
  32. package/dist/components/templates/TemplatesNextStepsSection.js +121 -0
  33. package/dist/components/templates/TemplatesPreviewModal.d.ts +3 -4
  34. package/dist/components/templates/TemplatesPreviewModal.js +136 -126
  35. package/dist/components/templates/index.js +873 -950
  36. package/dist/components/templates/template-catalog.d.ts +27 -0
  37. package/dist/components/templates/template-catalog.js +76 -0
  38. package/dist/components/templates/template-catalog.test.d.ts +1 -0
  39. package/dist/components/templates/template-new.d.ts +2 -0
  40. package/dist/components/templates/template-new.js +18 -0
  41. package/dist/components/templates/template-preview.d.ts +18 -0
  42. package/dist/components/templates/template-preview.js +38 -0
  43. package/dist/components/templates/template-source.d.ts +3 -0
  44. package/dist/components/templates/template-source.js +14 -0
  45. package/dist/index.js +873 -950
  46. package/dist/node/components/templates/TemplateCard.js +78 -0
  47. package/dist/node/components/templates/TemplateCommandDialog.js +105 -0
  48. package/dist/node/components/templates/TemplatePreviewContent.js +91 -0
  49. package/dist/node/components/templates/TemplatesBrowseControls.js +110 -0
  50. package/dist/node/components/templates/TemplatesCatalogSection.js +279 -0
  51. package/dist/node/components/templates/TemplatesClientPage.js +840 -917
  52. package/dist/node/components/templates/TemplatesHeroSection.js +82 -0
  53. package/dist/node/components/templates/TemplatesNextStepsSection.js +121 -0
  54. package/dist/node/components/templates/TemplatesPreviewModal.js +136 -126
  55. package/dist/node/components/templates/index.js +873 -950
  56. package/dist/node/components/templates/template-catalog.js +76 -0
  57. package/dist/node/components/templates/template-new.js +18 -0
  58. package/dist/node/components/templates/template-preview.js +38 -0
  59. package/dist/node/components/templates/template-source.js +14 -0
  60. package/dist/node/index.js +873 -950
  61. package/package.json +181 -26
  62. package/src/components/templates/TemplateCard.tsx +74 -0
  63. package/src/components/templates/TemplateCommandDialog.tsx +92 -0
  64. package/src/components/templates/TemplatePreviewContent.tsx +182 -0
  65. package/src/components/templates/TemplatesBrowseControls.tsx +120 -0
  66. package/src/components/templates/TemplatesCatalogSection.tsx +166 -0
  67. package/src/components/templates/TemplatesClientPage.tsx +109 -741
  68. package/src/components/templates/TemplatesHeroSection.tsx +41 -0
  69. package/src/components/templates/TemplatesNextStepsSection.tsx +80 -0
  70. package/src/components/templates/TemplatesPreviewModal.tsx +19 -294
  71. package/src/components/templates/template-catalog.test.ts +66 -0
  72. package/src/components/templates/template-catalog.ts +132 -0
  73. package/src/components/templates/template-new.ts +12 -0
  74. package/src/components/templates/template-preview.ts +57 -0
  75. package/src/components/templates/template-source.ts +13 -0
  76. package/.turbo/turbo-prebuild.log +0 -1
@@ -0,0 +1,87 @@
1
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined")
5
+ return require.apply(this, arguments);
6
+ throw Error('Dynamic require of "' + x + '" is not supported');
7
+ });
8
+
9
+ // src/components/templates/TemplatesHeroSection.tsx
10
+ import { jsxDEV } from "react/jsx-dev-runtime";
11
+ function TemplatesHeroSection({
12
+ localTemplateCount,
13
+ sourceCount
14
+ }) {
15
+ return /* @__PURE__ */ jsxDEV("section", {
16
+ className: "section-padding hero-gradient border-border/70 border-b",
17
+ children: /* @__PURE__ */ jsxDEV("div", {
18
+ className: "editorial-shell space-y-8",
19
+ children: [
20
+ /* @__PURE__ */ jsxDEV("div", {
21
+ className: "max-w-4xl space-y-5",
22
+ children: [
23
+ /* @__PURE__ */ jsxDEV("p", {
24
+ className: "editorial-kicker",
25
+ children: "Proof through real scenarios"
26
+ }, undefined, false, undefined, this),
27
+ /* @__PURE__ */ jsxDEV("h1", {
28
+ className: "editorial-title",
29
+ children: "Templates that show the open system in practice."
30
+ }, undefined, false, undefined, this),
31
+ /* @__PURE__ */ jsxDEV("p", {
32
+ className: "editorial-subtitle",
33
+ children: "These scenarios are the fastest way to understand ContractSpec: explicit contracts, aligned surfaces, and an adoption path from OSS exploration into Studio deployment."
34
+ }, undefined, false, undefined, this)
35
+ ]
36
+ }, undefined, true, undefined, this),
37
+ /* @__PURE__ */ jsxDEV("div", {
38
+ className: "editorial-proof-strip",
39
+ children: [
40
+ /* @__PURE__ */ jsxDEV("div", {
41
+ className: "editorial-stat",
42
+ children: [
43
+ /* @__PURE__ */ jsxDEV("span", {
44
+ className: "editorial-stat-value",
45
+ children: localTemplateCount
46
+ }, undefined, false, undefined, this),
47
+ /* @__PURE__ */ jsxDEV("span", {
48
+ className: "editorial-label",
49
+ children: "curated scenarios"
50
+ }, undefined, false, undefined, this)
51
+ ]
52
+ }, undefined, true, undefined, this),
53
+ /* @__PURE__ */ jsxDEV("div", {
54
+ className: "editorial-stat",
55
+ children: [
56
+ /* @__PURE__ */ jsxDEV("span", {
57
+ className: "editorial-stat-value",
58
+ children: sourceCount
59
+ }, undefined, false, undefined, this),
60
+ /* @__PURE__ */ jsxDEV("span", {
61
+ className: "editorial-label",
62
+ children: "entry paths"
63
+ }, undefined, false, undefined, this)
64
+ ]
65
+ }, undefined, true, undefined, this),
66
+ /* @__PURE__ */ jsxDEV("div", {
67
+ className: "editorial-stat",
68
+ children: [
69
+ /* @__PURE__ */ jsxDEV("span", {
70
+ className: "editorial-stat-value",
71
+ children: "OSS"
72
+ }, undefined, false, undefined, this),
73
+ /* @__PURE__ */ jsxDEV("span", {
74
+ className: "editorial-label",
75
+ children: "first, Studio second"
76
+ }, undefined, false, undefined, this)
77
+ ]
78
+ }, undefined, true, undefined, this)
79
+ ]
80
+ }, undefined, true, undefined, this)
81
+ ]
82
+ }, undefined, true, undefined, this)
83
+ }, undefined, false, undefined, this);
84
+ }
85
+ export {
86
+ TemplatesHeroSection
87
+ };
@@ -0,0 +1,126 @@
1
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined")
5
+ return require.apply(this, arguments);
6
+ throw Error('Dynamic require of "' + x + '" is not supported');
7
+ });
8
+
9
+ // src/components/templates/TemplatesNextStepsSection.tsx
10
+ import Link from "next/link";
11
+ import { jsxDEV } from "react/jsx-dev-runtime";
12
+ function TemplatesNextStepsSection() {
13
+ return /* @__PURE__ */ jsxDEV("section", {
14
+ className: "editorial-section bg-striped",
15
+ children: /* @__PURE__ */ jsxDEV("div", {
16
+ className: "editorial-shell space-y-8",
17
+ children: [
18
+ /* @__PURE__ */ jsxDEV("div", {
19
+ className: "max-w-3xl space-y-4",
20
+ children: [
21
+ /* @__PURE__ */ jsxDEV("p", {
22
+ className: "editorial-kicker",
23
+ children: "From template to real system"
24
+ }, undefined, false, undefined, this),
25
+ /* @__PURE__ */ jsxDEV("h2", {
26
+ className: "font-serif text-4xl tracking-[-0.04em] md:text-5xl",
27
+ children: "Templates become useful when the system can absorb more context."
28
+ }, undefined, false, undefined, this),
29
+ /* @__PURE__ */ jsxDEV("p", {
30
+ className: "editorial-copy",
31
+ children: "Use templates to prove the base flow, then layer integrations, knowledge, and runtime behavior on top without losing the same contract source."
32
+ }, undefined, false, undefined, this)
33
+ ]
34
+ }, undefined, true, undefined, this),
35
+ /* @__PURE__ */ jsxDEV("div", {
36
+ className: "grid gap-6 md:grid-cols-3",
37
+ children: [
38
+ /* @__PURE__ */ jsxDEV("div", {
39
+ className: "editorial-panel space-y-4",
40
+ children: [
41
+ /* @__PURE__ */ jsxDEV("div", {
42
+ className: "text-3xl",
43
+ children: "\uD83D\uDCB3"
44
+ }, undefined, false, undefined, this),
45
+ /* @__PURE__ */ jsxDEV("h3", {
46
+ className: "font-serif text-2xl tracking-[-0.03em]",
47
+ children: "Add payments"
48
+ }, undefined, false, undefined, this),
49
+ /* @__PURE__ */ jsxDEV("p", {
50
+ className: "text-muted-foreground text-sm",
51
+ children: "Connect Stripe to any template for payment processing, subscriptions, and invoicing. Type-safe and policy-enforced."
52
+ }, undefined, false, undefined, this),
53
+ /* @__PURE__ */ jsxDEV(Link, {
54
+ href: "/docs/integrations/stripe",
55
+ className: "font-medium text-[color:var(--blue)] text-sm hover:opacity-80",
56
+ children: "Learn more →"
57
+ }, undefined, false, undefined, this)
58
+ ]
59
+ }, undefined, true, undefined, this),
60
+ /* @__PURE__ */ jsxDEV("div", {
61
+ className: "editorial-panel space-y-4",
62
+ children: [
63
+ /* @__PURE__ */ jsxDEV("div", {
64
+ className: "text-3xl",
65
+ children: "\uD83D\uDCE7"
66
+ }, undefined, false, undefined, this),
67
+ /* @__PURE__ */ jsxDEV("h3", {
68
+ className: "font-serif text-2xl tracking-[-0.03em]",
69
+ children: "Add notifications"
70
+ }, undefined, false, undefined, this),
71
+ /* @__PURE__ */ jsxDEV("p", {
72
+ className: "text-muted-foreground text-sm",
73
+ children: "Send transactional emails via Postmark or Resend. Process inbound emails with Gmail API. SMS via Twilio."
74
+ }, undefined, false, undefined, this),
75
+ /* @__PURE__ */ jsxDEV(Link, {
76
+ href: "/docs/integrations",
77
+ className: "font-medium text-[color:var(--blue)] text-sm hover:opacity-80",
78
+ children: "View integrations →"
79
+ }, undefined, false, undefined, this)
80
+ ]
81
+ }, undefined, true, undefined, this),
82
+ /* @__PURE__ */ jsxDEV("div", {
83
+ className: "editorial-panel space-y-4",
84
+ children: [
85
+ /* @__PURE__ */ jsxDEV("div", {
86
+ className: "text-3xl",
87
+ children: "\uD83E\uDDE0"
88
+ }, undefined, false, undefined, this),
89
+ /* @__PURE__ */ jsxDEV("h3", {
90
+ className: "font-serif text-2xl tracking-[-0.03em]",
91
+ children: "Add AI and knowledge"
92
+ }, undefined, false, undefined, this),
93
+ /* @__PURE__ */ jsxDEV("p", {
94
+ className: "text-muted-foreground text-sm",
95
+ children: "Power templates with OpenAI, vector search via Qdrant, and structured knowledge spaces for context-aware workflows."
96
+ }, undefined, false, undefined, this),
97
+ /* @__PURE__ */ jsxDEV(Link, {
98
+ href: "/docs/knowledge",
99
+ className: "font-medium text-[color:var(--blue)] text-sm hover:opacity-80",
100
+ children: "Learn about knowledge →"
101
+ }, undefined, false, undefined, this)
102
+ ]
103
+ }, undefined, true, undefined, this)
104
+ ]
105
+ }, undefined, true, undefined, this),
106
+ /* @__PURE__ */ jsxDEV("div", {
107
+ className: "pt-4 text-center",
108
+ children: [
109
+ /* @__PURE__ */ jsxDEV("p", {
110
+ className: "mb-4 text-muted-foreground text-sm",
111
+ children: "All integrations are configured per-tenant with automatic health checks and credential rotation."
112
+ }, undefined, false, undefined, this),
113
+ /* @__PURE__ */ jsxDEV(Link, {
114
+ href: "/docs/architecture",
115
+ className: "btn-primary",
116
+ children: "View Architecture"
117
+ }, undefined, false, undefined, this)
118
+ ]
119
+ }, undefined, true, undefined, this)
120
+ ]
121
+ }, undefined, true, undefined, this)
122
+ }, undefined, false, undefined, this);
123
+ }
124
+ export {
125
+ TemplatesNextStepsSection
126
+ };
@@ -6,143 +6,153 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
6
6
  throw Error('Dynamic require of "' + x + '" is not supported');
7
7
  });
8
8
 
9
- // src/components/templates/TemplatesPreviewModal.tsx
9
+ // src/components/templates/TemplatePreviewContent.tsx
10
+ import {
11
+ TemplateShell
12
+ } from "@contractspec/lib.example-shared-ui";
10
13
  import { LoadingSpinner } from "@contractspec/lib.ui-kit-web/ui/atoms/LoadingSpinner";
11
- import { Dialog, DialogContent } from "@contractspec/lib.ui-kit-web/ui/dialog";
12
- import { ScrollArea } from "@contractspec/lib.ui-kit-web/ui/scroll-area";
13
14
  import dynamic from "next/dynamic";
14
- import { useMemo } from "react";
15
15
  import { jsxDEV } from "react/jsx-dev-runtime";
16
16
  "use client";
17
- var TemplateShell = dynamic(() => import("@contractspec/lib.example-shared-ui").then((mod) => mod.TemplateShell), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
18
- var TodosTaskList = dynamic(() => import("@contractspec/bundle.library/components/templates/todos/TaskList").then((mod) => mod.TaskList), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
19
- var MessagingWorkspace = dynamic(() => import("@contractspec/bundle.library/components/templates/messaging/MessagingWorkspace").then((mod) => mod.MessagingWorkspace), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
20
- var RecipesExperience = dynamic(() => import("@contractspec/bundle.library/components/templates/recipes/RecipeList").then((mod) => mod.RecipeList), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
21
- var SaasDashboard = dynamic(() => import("@contractspec/example.saas-boilerplate").then((mod) => mod.SaasDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
22
- var CrmDashboard = dynamic(() => import("@contractspec/example.crm-pipeline").then((mod) => mod.CrmDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
23
- var DataGridShowcase = dynamic(() => import("@contractspec/example.data-grid-showcase/ui").then((mod) => mod.DataGridShowcase), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
24
- var VisualizationShowcase = dynamic(() => import("@contractspec/example.visualization-showcase/ui").then((mod) => mod.VisualizationShowcase), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
25
- var AgentDashboard = dynamic(() => import("@contractspec/example.agent-console/ui").then((mod) => mod.AgentDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
26
- var WorkflowDashboard = dynamic(() => import("@contractspec/example.workflow-system/ui").then((mod) => mod.WorkflowDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
27
- var MarketplaceDashboard = dynamic(() => import("@contractspec/example.marketplace/ui").then((mod) => mod.MarketplaceDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
28
- var IntegrationDashboard = dynamic(() => import("@contractspec/example.integration-hub/ui").then((mod) => mod.IntegrationDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
29
- var AnalyticsDashboard = dynamic(() => import("@contractspec/example.analytics-dashboard").then((mod) => mod.AnalyticsDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
30
- var AiChatAssistantDashboard = dynamic(() => import("@contractspec/example.ai-chat-assistant").then((mod) => mod.AiChatAssistantDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
31
- var TemplatePreviewModal = ({
17
+ var SaasDashboard = dynamic(() => import("@contractspec/example.saas-boilerplate").then((module) => module.SaasDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
18
+ var CrmDashboard = dynamic(() => import("@contractspec/example.crm-pipeline").then((module) => module.CrmDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
19
+ var DataGridShowcase = dynamic(() => import("@contractspec/example.data-grid-showcase/ui").then((module) => module.DataGridShowcase), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
20
+ var VisualizationShowcase = dynamic(() => import("@contractspec/example.visualization-showcase/ui").then((module) => module.VisualizationShowcase), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
21
+ var AgentDashboard = dynamic(() => import("@contractspec/example.agent-console/ui").then((module) => module.AgentDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
22
+ var AiChatAssistantDashboard = dynamic(() => import("@contractspec/example.ai-chat-assistant").then((module) => module.AiChatAssistantDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
23
+ var WorkflowDashboard = dynamic(() => import("@contractspec/example.workflow-system/ui").then((module) => module.WorkflowDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
24
+ var MarketplaceDashboard = dynamic(() => import("@contractspec/example.marketplace/ui").then((module) => module.MarketplaceDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
25
+ var IntegrationDashboard = dynamic(() => import("@contractspec/example.integration-hub/ui").then((module) => module.IntegrationDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
26
+ var AnalyticsDashboard = dynamic(() => import("@contractspec/example.analytics-dashboard").then((module) => module.AnalyticsDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
27
+ var PREVIEW_DEFINITIONS = {
28
+ "saas-boilerplate": {
29
+ title: "SaaS Boilerplate",
30
+ description: "Multi-tenant organizations, projects, settings, and billing usage tracking.",
31
+ component: SaasDashboard
32
+ },
33
+ "crm-pipeline": {
34
+ title: "CRM Pipeline",
35
+ description: "Sales CRM with contacts, companies, deals, and pipeline stages.",
36
+ component: CrmDashboard
37
+ },
38
+ "data-grid-showcase": {
39
+ title: "Data Grid Showcase",
40
+ description: "Shared ContractSpec table primitives with client, server, and DataView-driven lanes.",
41
+ component: DataGridShowcase
42
+ },
43
+ "visualization-showcase": {
44
+ title: "Visualization Showcase",
45
+ description: "ContractSpec-owned chart primitives rendered through shared visualization contracts and design-system wrappers.",
46
+ component: VisualizationShowcase
47
+ },
48
+ "agent-console": {
49
+ title: "AI Agent Console",
50
+ description: "AI agent orchestration with tools, agents, runs, and execution logs.",
51
+ component: AgentDashboard
52
+ },
53
+ "ai-chat-assistant": {
54
+ title: "AI Chat Assistant",
55
+ description: "Focused assistant surface with reasoning, sources, suggestions, and MCP-aware tools.",
56
+ component: AiChatAssistantDashboard
57
+ },
58
+ "workflow-system": {
59
+ title: "Workflow System",
60
+ description: "Multi-step workflows with role-based approvals.",
61
+ component: WorkflowDashboard
62
+ },
63
+ marketplace: {
64
+ title: "Marketplace",
65
+ description: "Two-sided marketplace with stores, products, orders, and payouts.",
66
+ component: MarketplaceDashboard
67
+ },
68
+ "integration-hub": {
69
+ title: "Integration Hub",
70
+ description: "Third-party integrations with connections, sync configs, and field mapping.",
71
+ component: IntegrationDashboard
72
+ },
73
+ "analytics-dashboard": {
74
+ title: "Analytics Dashboard",
75
+ description: "Custom dashboards with widgets and queries.",
76
+ component: AnalyticsDashboard
77
+ }
78
+ };
79
+ function TemplatePreviewContent({
80
+ templateId
81
+ }) {
82
+ const preview = PREVIEW_DEFINITIONS[templateId];
83
+ if (!preview) {
84
+ return null;
85
+ }
86
+ const PreviewComponent = preview.component;
87
+ return /* @__PURE__ */ jsxDEV(TemplateShell, {
88
+ title: preview.title,
89
+ description: preview.description,
90
+ showSaveAction: false,
91
+ children: /* @__PURE__ */ jsxDEV(PreviewComponent, {}, undefined, false, undefined, this)
92
+ }, undefined, false, undefined, this);
93
+ }
94
+
95
+ // src/components/templates/template-preview.ts
96
+ var INLINE_TEMPLATE_PREVIEW_IDS = [
97
+ "agent-console",
98
+ "ai-chat-assistant",
99
+ "analytics-dashboard",
100
+ "crm-pipeline",
101
+ "data-grid-showcase",
102
+ "integration-hub",
103
+ "marketplace",
104
+ "saas-boilerplate",
105
+ "visualization-showcase",
106
+ "workflow-system"
107
+ ];
108
+ var INLINE_TEMPLATE_PREVIEW_SET = new Set(INLINE_TEMPLATE_PREVIEW_IDS);
109
+ function supportsInlineTemplatePreview(templateId) {
110
+ return INLINE_TEMPLATE_PREVIEW_SET.has(templateId);
111
+ }
112
+ function getLocalTemplatePreviewAction(template) {
113
+ if (supportsInlineTemplatePreview(template.id)) {
114
+ return { kind: "modal", templateId: template.id };
115
+ }
116
+ return { kind: "sandbox", href: template.previewUrl };
117
+ }
118
+ function getRegistryTemplatePreviewAction(template, localTemplate) {
119
+ if (!localTemplate) {
120
+ return { kind: "disabled" };
121
+ }
122
+ return getLocalTemplatePreviewAction(localTemplate);
123
+ }
124
+
125
+ // src/components/templates/TemplatesPreviewModal.tsx
126
+ import { Dialog, DialogContent } from "@contractspec/lib.ui-kit-web/ui/dialog";
127
+ import { ScrollArea } from "@contractspec/lib.ui-kit-web/ui/scroll-area";
128
+ import { TemplateRuntimeProvider } from "@contractspec/module.examples";
129
+ import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
130
+ "use client";
131
+ function TemplatePreviewModal({
32
132
  templateId,
33
133
  onClose
34
- }) => {
35
- const previewComponent = useMemo(() => {
36
- switch (templateId) {
37
- case "todos-app":
38
- return /* @__PURE__ */ jsxDEV(TemplateShell, {
39
- title: "Starter tasks",
40
- description: "Track work items with filters, priorities, and per-tenant data isolation.",
41
- showSaveAction: false,
42
- children: /* @__PURE__ */ jsxDEV(TodosTaskList, {}, undefined, false, undefined, this)
43
- }, undefined, false, undefined, this);
44
- case "messaging-app":
45
- return /* @__PURE__ */ jsxDEV(TemplateShell, {
46
- title: "Messaging workspace",
47
- description: "Realtime-ready messaging surface with optimistic delivery.",
48
- showSaveAction: false,
49
- children: /* @__PURE__ */ jsxDEV(MessagingWorkspace, {}, undefined, false, undefined, this)
50
- }, undefined, false, undefined, this);
51
- case "recipe-app-i18n":
52
- return /* @__PURE__ */ jsxDEV(TemplateShell, {
53
- title: "Ceremony recipes",
54
- description: "Switch locales and preview how rituals translate across teams.",
55
- showSaveAction: false,
56
- children: /* @__PURE__ */ jsxDEV(RecipesExperience, {}, undefined, false, undefined, this)
57
- }, undefined, false, undefined, this);
58
- case "saas-boilerplate":
59
- return /* @__PURE__ */ jsxDEV(TemplateShell, {
60
- title: "SaaS Boilerplate",
61
- description: "Multi-tenant organizations, projects, settings, and billing usage tracking.",
62
- showSaveAction: false,
63
- children: /* @__PURE__ */ jsxDEV(SaasDashboard, {}, undefined, false, undefined, this)
64
- }, undefined, false, undefined, this);
65
- case "crm-pipeline":
66
- return /* @__PURE__ */ jsxDEV(TemplateShell, {
67
- title: "CRM Pipeline",
68
- description: "Sales CRM with contacts, companies, deals, and pipeline stages.",
69
- showSaveAction: false,
70
- children: /* @__PURE__ */ jsxDEV(CrmDashboard, {}, undefined, false, undefined, this)
71
- }, undefined, false, undefined, this);
72
- case "data-grid-showcase":
73
- return /* @__PURE__ */ jsxDEV(TemplateShell, {
74
- title: "Data Grid Showcase",
75
- description: "Shared ContractSpec table primitives with client, server, and DataView-driven lanes.",
76
- showSaveAction: false,
77
- children: /* @__PURE__ */ jsxDEV(DataGridShowcase, {}, undefined, false, undefined, this)
78
- }, undefined, false, undefined, this);
79
- case "visualization-showcase":
80
- return /* @__PURE__ */ jsxDEV(TemplateShell, {
81
- title: "Visualization Showcase",
82
- description: "ContractSpec-owned chart primitives rendered through shared visualization contracts and design-system wrappers.",
83
- showSaveAction: false,
84
- children: /* @__PURE__ */ jsxDEV(VisualizationShowcase, {}, undefined, false, undefined, this)
85
- }, undefined, false, undefined, this);
86
- case "agent-console":
87
- return /* @__PURE__ */ jsxDEV(TemplateShell, {
88
- title: "AI Agent Console",
89
- description: "AI agent orchestration with tools, agents, runs, and execution logs.",
90
- showSaveAction: false,
91
- children: /* @__PURE__ */ jsxDEV(AgentDashboard, {}, undefined, false, undefined, this)
92
- }, undefined, false, undefined, this);
93
- case "ai-chat-assistant":
94
- return /* @__PURE__ */ jsxDEV(TemplateShell, {
95
- title: "AI Chat Assistant",
96
- description: "Focused assistant surface with reasoning, sources, suggestions, and MCP-aware tools.",
97
- showSaveAction: false,
98
- children: /* @__PURE__ */ jsxDEV(AiChatAssistantDashboard, {}, undefined, false, undefined, this)
99
- }, undefined, false, undefined, this);
100
- case "workflow-system":
101
- return /* @__PURE__ */ jsxDEV(TemplateShell, {
102
- title: "Workflow System",
103
- description: "Multi-step workflows with role-based approvals.",
104
- showSaveAction: false,
105
- children: /* @__PURE__ */ jsxDEV(WorkflowDashboard, {}, undefined, false, undefined, this)
106
- }, undefined, false, undefined, this);
107
- case "marketplace":
108
- return /* @__PURE__ */ jsxDEV(TemplateShell, {
109
- title: "Marketplace",
110
- description: "Two-sided marketplace with stores, products, and orders.",
111
- showSaveAction: false,
112
- children: /* @__PURE__ */ jsxDEV(MarketplaceDashboard, {}, undefined, false, undefined, this)
113
- }, undefined, false, undefined, this);
114
- case "integration-hub":
115
- return /* @__PURE__ */ jsxDEV(TemplateShell, {
116
- title: "Integration Hub",
117
- description: "Third-party integrations with sync and field mapping.",
118
- showSaveAction: false,
119
- children: /* @__PURE__ */ jsxDEV(IntegrationDashboard, {}, undefined, false, undefined, this)
120
- }, undefined, false, undefined, this);
121
- case "analytics-dashboard":
122
- return /* @__PURE__ */ jsxDEV(TemplateShell, {
123
- title: "Analytics Dashboard",
124
- description: "Custom dashboards with widgets and queries.",
125
- showSaveAction: false,
126
- children: /* @__PURE__ */ jsxDEV(AnalyticsDashboard, {}, undefined, false, undefined, this)
127
- }, undefined, false, undefined, this);
128
- case null:
129
- return null;
130
- default:
131
- return null;
132
- }
133
- }, [templateId]);
134
- return /* @__PURE__ */ jsxDEV(Dialog, {
135
- open: !!previewComponent,
136
- onOpenChange: onClose,
137
- children: /* @__PURE__ */ jsxDEV(DialogContent, {
134
+ }) {
135
+ if (!supportsInlineTemplatePreview(templateId)) {
136
+ return null;
137
+ }
138
+ return /* @__PURE__ */ jsxDEV2(Dialog, {
139
+ open: true,
140
+ onOpenChange: (open) => !open && onClose(),
141
+ children: /* @__PURE__ */ jsxDEV2(DialogContent, {
138
142
  className: "mb-8 flex h-[calc(100vh-2rem)] min-w-[calc(100vw-2rem)] flex-col justify-between gap-0 p-0",
139
- children: /* @__PURE__ */ jsxDEV(ScrollArea, {
143
+ children: /* @__PURE__ */ jsxDEV2(ScrollArea, {
140
144
  className: "flex flex-col justify-between overflow-hidden",
141
- children: previewComponent
145
+ children: /* @__PURE__ */ jsxDEV2(TemplateRuntimeProvider, {
146
+ templateId,
147
+ projectId: `marketing-preview-${templateId}`,
148
+ children: /* @__PURE__ */ jsxDEV2(TemplatePreviewContent, {
149
+ templateId
150
+ }, undefined, false, undefined, this)
151
+ }, templateId, false, undefined, this)
142
152
  }, undefined, false, undefined, this)
143
153
  }, undefined, false, undefined, this)
144
154
  }, undefined, false, undefined, this);
145
- };
155
+ }
146
156
  export {
147
157
  TemplatePreviewModal
148
158
  };