@contractspec/example.crm-pipeline 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.
Files changed (106) hide show
  1. package/.turbo/turbo-build.log +8 -8
  2. package/AGENTS.md +51 -33
  3. package/CHANGELOG.md +16 -0
  4. package/README.md +66 -148
  5. package/dist/browser/events/contact.event.js +1 -1
  6. package/dist/browser/events/deal.event.js +1 -1
  7. package/dist/browser/events/index.js +3 -3
  8. package/dist/browser/events/task.event.js +1 -1
  9. package/dist/browser/index.js +293 -293
  10. package/dist/browser/ui/CrmDashboard.js +221 -221
  11. package/dist/browser/ui/CrmDealCard.js +5 -5
  12. package/dist/browser/ui/CrmPipelineBoard.js +13 -13
  13. package/dist/browser/ui/hooks/index.js +2 -2
  14. package/dist/browser/ui/hooks/useDealList.js +1 -1
  15. package/dist/browser/ui/hooks/useDealMutations.js +1 -1
  16. package/dist/browser/ui/index.js +290 -290
  17. package/dist/browser/ui/modals/CreateDealModal.js +12 -12
  18. package/dist/browser/ui/modals/DealActionsModal.js +21 -21
  19. package/dist/browser/ui/modals/index.js +33 -33
  20. package/dist/browser/ui/renderers/index.js +116 -116
  21. package/dist/browser/ui/renderers/pipeline.renderer.js +97 -97
  22. package/dist/deal/index.d.ts +2 -2
  23. package/dist/events/contact.event.js +1 -1
  24. package/dist/events/deal.event.js +1 -1
  25. package/dist/events/index.js +3 -3
  26. package/dist/events/task.event.js +1 -1
  27. package/dist/handlers/index.d.ts +2 -2
  28. package/dist/index.d.ts +3 -3
  29. package/dist/index.js +293 -293
  30. package/dist/node/events/contact.event.js +1 -1
  31. package/dist/node/events/deal.event.js +1 -1
  32. package/dist/node/events/index.js +3 -3
  33. package/dist/node/events/task.event.js +1 -1
  34. package/dist/node/index.js +293 -293
  35. package/dist/node/ui/CrmDashboard.js +221 -221
  36. package/dist/node/ui/CrmDealCard.js +5 -5
  37. package/dist/node/ui/CrmPipelineBoard.js +13 -13
  38. package/dist/node/ui/hooks/index.js +2 -2
  39. package/dist/node/ui/hooks/useDealList.js +1 -1
  40. package/dist/node/ui/hooks/useDealMutations.js +1 -1
  41. package/dist/node/ui/index.js +290 -290
  42. package/dist/node/ui/modals/CreateDealModal.js +12 -12
  43. package/dist/node/ui/modals/DealActionsModal.js +21 -21
  44. package/dist/node/ui/modals/index.js +33 -33
  45. package/dist/node/ui/renderers/index.js +116 -116
  46. package/dist/node/ui/renderers/pipeline.renderer.js +97 -97
  47. package/dist/operations/index.d.ts +1 -1
  48. package/dist/ui/CrmDashboard.js +221 -221
  49. package/dist/ui/CrmDealCard.js +5 -5
  50. package/dist/ui/CrmPipelineBoard.js +13 -13
  51. package/dist/ui/hooks/index.d.ts +2 -2
  52. package/dist/ui/hooks/index.js +2 -2
  53. package/dist/ui/hooks/useDealList.js +1 -1
  54. package/dist/ui/hooks/useDealMutations.d.ts +9 -0
  55. package/dist/ui/hooks/useDealMutations.js +1 -1
  56. package/dist/ui/index.d.ts +3 -3
  57. package/dist/ui/index.js +290 -290
  58. package/dist/ui/modals/CreateDealModal.js +12 -12
  59. package/dist/ui/modals/DealActionsModal.js +21 -21
  60. package/dist/ui/modals/index.js +33 -33
  61. package/dist/ui/renderers/index.d.ts +1 -1
  62. package/dist/ui/renderers/index.js +116 -116
  63. package/dist/ui/renderers/pipeline.renderer.d.ts +1 -1
  64. package/dist/ui/renderers/pipeline.renderer.js +97 -97
  65. package/package.json +14 -14
  66. package/src/crm-pipeline.feature.ts +86 -86
  67. package/src/deal/deal.enum.ts +8 -8
  68. package/src/deal/deal.operation.ts +255 -255
  69. package/src/deal/deal.schema.ts +92 -92
  70. package/src/deal/deal.test-spec.ts +48 -48
  71. package/src/deal/index.ts +17 -19
  72. package/src/docs/crm-pipeline.docblock.ts +43 -43
  73. package/src/entities/company.entity.ts +52 -52
  74. package/src/entities/contact.entity.ts +67 -67
  75. package/src/entities/deal.entity.ts +134 -134
  76. package/src/entities/index.ts +27 -27
  77. package/src/entities/task.entity.ts +105 -105
  78. package/src/events/contact.event.ts +22 -22
  79. package/src/events/deal.event.ts +77 -77
  80. package/src/events/task.event.ts +19 -19
  81. package/src/example.ts +32 -32
  82. package/src/handlers/crm.handlers.ts +358 -357
  83. package/src/handlers/deal.handlers.ts +179 -179
  84. package/src/handlers/index.ts +18 -19
  85. package/src/handlers/mock-data.ts +167 -167
  86. package/src/index.ts +11 -11
  87. package/src/operations/index.ts +16 -16
  88. package/src/presentations/dashboard.presentation.ts +45 -45
  89. package/src/presentations/pipeline.presentation.ts +90 -90
  90. package/src/seeders/index.ts +26 -26
  91. package/src/shared/overlay-types.ts +23 -23
  92. package/src/ui/CrmDashboard.tsx +256 -256
  93. package/src/ui/CrmDealCard.tsx +64 -64
  94. package/src/ui/CrmPipelineBoard.tsx +105 -105
  95. package/src/ui/hooks/index.ts +3 -3
  96. package/src/ui/hooks/useDealList.ts +85 -85
  97. package/src/ui/hooks/useDealMutations.ts +151 -150
  98. package/src/ui/index.ts +5 -10
  99. package/src/ui/modals/CreateDealModal.tsx +217 -217
  100. package/src/ui/modals/DealActionsModal.tsx +390 -390
  101. package/src/ui/overlays/demo-overlays.ts +43 -43
  102. package/src/ui/renderers/index.ts +4 -3
  103. package/src/ui/renderers/pipeline.markdown.ts +165 -165
  104. package/src/ui/renderers/pipeline.renderer.tsx +17 -16
  105. package/tsconfig.json +7 -8
  106. package/tsdown.config.js +7 -3
@@ -10,59 +10,59 @@ import type { OverlayDefinition } from '../../shared/overlay-types';
10
10
  * Demo user overlay - sample data mode
11
11
  */
12
12
  export const crmDemoOverlay: OverlayDefinition = {
13
- overlayId: 'crm-pipeline.demo-user',
14
- version: '1.0.0',
15
- description: 'Demo mode with sample data',
16
- appliesTo: {
17
- feature: 'crm-pipeline',
18
- role: 'demo',
19
- },
20
- modifications: [
21
- {
22
- type: 'hideField',
23
- field: 'importButton',
24
- reason: 'Not available in demo',
25
- },
26
- {
27
- type: 'hideField',
28
- field: 'exportButton',
29
- reason: 'Not available in demo',
30
- },
31
- {
32
- type: 'addBadge',
33
- position: 'header',
34
- label: 'Demo Mode',
35
- variant: 'warning',
36
- },
37
- ],
13
+ overlayId: 'crm-pipeline.demo-user',
14
+ version: '1.0.0',
15
+ description: 'Demo mode with sample data',
16
+ appliesTo: {
17
+ feature: 'crm-pipeline',
18
+ role: 'demo',
19
+ },
20
+ modifications: [
21
+ {
22
+ type: 'hideField',
23
+ field: 'importButton',
24
+ reason: 'Not available in demo',
25
+ },
26
+ {
27
+ type: 'hideField',
28
+ field: 'exportButton',
29
+ reason: 'Not available in demo',
30
+ },
31
+ {
32
+ type: 'addBadge',
33
+ position: 'header',
34
+ label: 'Demo Mode',
35
+ variant: 'warning',
36
+ },
37
+ ],
38
38
  };
39
39
 
40
40
  /**
41
41
  * Sales rep overlay - focused view for sales
42
42
  */
43
43
  export const crmSalesRepOverlay: OverlayDefinition = {
44
- overlayId: 'crm-pipeline.sales-rep',
45
- version: '1.0.0',
46
- description: 'Sales rep focused view',
47
- appliesTo: {
48
- feature: 'crm-pipeline',
49
- role: 'sales-rep',
50
- },
51
- modifications: [
52
- {
53
- type: 'hideField',
54
- field: 'teamMetrics',
55
- reason: 'Team metrics for managers only',
56
- },
57
- { type: 'hideField', field: 'pipelineSettings', reason: 'Admin only' },
58
- { type: 'renameLabel', field: 'deals', newLabel: 'My Deals' },
59
- ],
44
+ overlayId: 'crm-pipeline.sales-rep',
45
+ version: '1.0.0',
46
+ description: 'Sales rep focused view',
47
+ appliesTo: {
48
+ feature: 'crm-pipeline',
49
+ role: 'sales-rep',
50
+ },
51
+ modifications: [
52
+ {
53
+ type: 'hideField',
54
+ field: 'teamMetrics',
55
+ reason: 'Team metrics for managers only',
56
+ },
57
+ { type: 'hideField', field: 'pipelineSettings', reason: 'Admin only' },
58
+ { type: 'renameLabel', field: 'deals', newLabel: 'My Deals' },
59
+ ],
60
60
  };
61
61
 
62
62
  /**
63
63
  * All overlays for crm-pipeline
64
64
  */
65
65
  export const crmOverlays: OverlayDefinition[] = [
66
- crmDemoOverlay,
67
- crmSalesRepOverlay,
66
+ crmDemoOverlay,
67
+ crmSalesRepOverlay,
68
68
  ];
@@ -1,6 +1,7 @@
1
1
  // CRM Pipeline renderers
2
- export { crmPipelineReactRenderer } from './pipeline.renderer';
2
+
3
3
  export {
4
- crmPipelineMarkdownRenderer,
5
- crmDashboardMarkdownRenderer,
4
+ crmDashboardMarkdownRenderer,
5
+ crmPipelineMarkdownRenderer,
6
6
  } from './pipeline.markdown';
7
+ export { crmPipelineReactRenderer } from './pipeline.renderer';
@@ -5,31 +5,31 @@
5
5
  */
6
6
  import type { PresentationRenderer } from '@contractspec/lib.contracts-spec/presentations/transform-engine';
7
7
  import {
8
- mockListDealsHandler,
9
- mockGetPipelineStagesHandler,
8
+ mockGetPipelineStagesHandler,
9
+ mockListDealsHandler,
10
10
  } from '../../handlers';
11
11
 
12
12
  interface DealItem {
13
- id: string;
14
- name: string;
15
- value: number;
16
- currency: string;
17
- stageId: string;
18
- status: string;
13
+ id: string;
14
+ name: string;
15
+ value: number;
16
+ currency: string;
17
+ stageId: string;
18
+ status: string;
19
19
  }
20
20
 
21
21
  interface StageItem {
22
- id: string;
23
- name: string;
24
- position: number;
22
+ id: string;
23
+ name: string;
24
+ position: number;
25
25
  }
26
26
 
27
27
  function formatCurrency(value: number, currency = 'USD'): string {
28
- return new Intl.NumberFormat('en-US', {
29
- style: 'currency',
30
- currency,
31
- minimumFractionDigits: 0,
32
- }).format(value);
28
+ return new Intl.NumberFormat('en-US', {
29
+ style: 'currency',
30
+ currency,
31
+ minimumFractionDigits: 0,
32
+ }).format(value);
33
33
  }
34
34
 
35
35
  /**
@@ -37,73 +37,73 @@ function formatCurrency(value: number, currency = 'USD'): string {
37
37
  * Only handles PipelineKanbanView component
38
38
  */
39
39
  export const crmPipelineMarkdownRenderer: PresentationRenderer<{
40
- mimeType: string;
41
- body: string;
40
+ mimeType: string;
41
+ body: string;
42
42
  }> = {
43
- target: 'markdown',
44
- render: async (desc, _ctx) => {
45
- // Only handle PipelineKanbanView
46
- if (
47
- desc.source.type !== 'component' ||
48
- desc.source.componentKey !== 'PipelineKanbanView'
49
- ) {
50
- throw new Error('crmPipelineMarkdownRenderer: not PipelineKanbanView');
51
- }
52
-
53
- const pipelineId = 'pipeline-1';
54
- const [dealsResult, stages] = await Promise.all([
55
- mockListDealsHandler({ pipelineId, limit: 50 }),
56
- mockGetPipelineStagesHandler({ pipelineId }),
57
- ]);
58
-
59
- const deals = dealsResult.deals as DealItem[];
60
- const stageList = stages as StageItem[];
61
-
62
- // Group deals by stage
63
- const dealsByStage: Record<string, DealItem[]> = {};
64
- for (const stage of stageList) {
65
- dealsByStage[stage.id] = deals.filter(
66
- (d) => d.stageId === stage.id && d.status === 'OPEN'
67
- );
68
- }
69
-
70
- // Build Markdown
71
- const lines: string[] = [
72
- '# CRM Pipeline',
73
- '',
74
- `**Total Value**: ${formatCurrency(dealsResult.totalValue)}`,
75
- `**Total Deals**: ${dealsResult.total}`,
76
- '',
77
- ];
78
-
79
- for (const stage of stageList.sort((a, b) => a.position - b.position)) {
80
- const stageDeals = dealsByStage[stage.id] ?? [];
81
- const stageValue = stageDeals.reduce((sum, d) => sum + d.value, 0);
82
-
83
- lines.push(`## ${stage.name}`);
84
- lines.push(
85
- `_${stageDeals.length} deals · ${formatCurrency(stageValue)}_`
86
- );
87
- lines.push('');
88
-
89
- if (stageDeals.length === 0) {
90
- lines.push('_No deals_');
91
- } else {
92
- for (const deal of stageDeals) {
93
- lines.push(
94
- `- **${deal.name}** - ${formatCurrency(deal.value, deal.currency)}`
95
- );
96
- }
97
- }
98
-
99
- lines.push('');
100
- }
101
-
102
- return {
103
- mimeType: 'text/markdown',
104
- body: lines.join('\n'),
105
- };
106
- },
43
+ target: 'markdown',
44
+ render: async (desc, _ctx) => {
45
+ // Only handle PipelineKanbanView
46
+ if (
47
+ desc.source.type !== 'component' ||
48
+ desc.source.componentKey !== 'PipelineKanbanView'
49
+ ) {
50
+ throw new Error('crmPipelineMarkdownRenderer: not PipelineKanbanView');
51
+ }
52
+
53
+ const pipelineId = 'pipeline-1';
54
+ const [dealsResult, stages] = await Promise.all([
55
+ mockListDealsHandler({ pipelineId, limit: 50 }),
56
+ mockGetPipelineStagesHandler({ pipelineId }),
57
+ ]);
58
+
59
+ const deals = dealsResult.deals as DealItem[];
60
+ const stageList = stages as StageItem[];
61
+
62
+ // Group deals by stage
63
+ const dealsByStage: Record<string, DealItem[]> = {};
64
+ for (const stage of stageList) {
65
+ dealsByStage[stage.id] = deals.filter(
66
+ (d) => d.stageId === stage.id && d.status === 'OPEN'
67
+ );
68
+ }
69
+
70
+ // Build Markdown
71
+ const lines: string[] = [
72
+ '# CRM Pipeline',
73
+ '',
74
+ `**Total Value**: ${formatCurrency(dealsResult.totalValue)}`,
75
+ `**Total Deals**: ${dealsResult.total}`,
76
+ '',
77
+ ];
78
+
79
+ for (const stage of stageList.sort((a, b) => a.position - b.position)) {
80
+ const stageDeals = dealsByStage[stage.id] ?? [];
81
+ const stageValue = stageDeals.reduce((sum, d) => sum + d.value, 0);
82
+
83
+ lines.push(`## ${stage.name}`);
84
+ lines.push(
85
+ `_${stageDeals.length} deals · ${formatCurrency(stageValue)}_`
86
+ );
87
+ lines.push('');
88
+
89
+ if (stageDeals.length === 0) {
90
+ lines.push('_No deals_');
91
+ } else {
92
+ for (const deal of stageDeals) {
93
+ lines.push(
94
+ `- **${deal.name}** - ${formatCurrency(deal.value, deal.currency)}`
95
+ );
96
+ }
97
+ }
98
+
99
+ lines.push('');
100
+ }
101
+
102
+ return {
103
+ mimeType: 'text/markdown',
104
+ body: lines.join('\n'),
105
+ };
106
+ },
107
107
  };
108
108
 
109
109
  /**
@@ -111,88 +111,88 @@ export const crmPipelineMarkdownRenderer: PresentationRenderer<{
111
111
  * Only handles CrmDashboard component
112
112
  */
113
113
  export const crmDashboardMarkdownRenderer: PresentationRenderer<{
114
- mimeType: string;
115
- body: string;
114
+ mimeType: string;
115
+ body: string;
116
116
  }> = {
117
- target: 'markdown',
118
- render: async (desc, _ctx) => {
119
- // Only handle CrmDashboard
120
- if (
121
- desc.source.type !== 'component' ||
122
- desc.source.componentKey !== 'CrmDashboard'
123
- ) {
124
- throw new Error('crmDashboardMarkdownRenderer: not CrmDashboard');
125
- }
126
-
127
- const pipelineId = 'pipeline-1';
128
- const [dealsResult, stages] = await Promise.all([
129
- mockListDealsHandler({ pipelineId, limit: 100 }),
130
- mockGetPipelineStagesHandler({ pipelineId }),
131
- ]);
132
-
133
- const deals = dealsResult.deals as DealItem[];
134
- const stageList = stages as StageItem[];
135
-
136
- // Calculate stats
137
- const openDeals = deals.filter((d) => d.status === 'OPEN');
138
- const wonDeals = deals.filter((d) => d.status === 'WON');
139
- const lostDeals = deals.filter((d) => d.status === 'LOST');
140
- const openValue = openDeals.reduce((sum, d) => sum + d.value, 0);
141
- const wonValue = wonDeals.reduce((sum, d) => sum + d.value, 0);
142
-
143
- // Build dashboard markdown
144
- const lines: string[] = [
145
- '# CRM Dashboard',
146
- '',
147
- '> Sales pipeline overview and key metrics',
148
- '',
149
- '## Summary',
150
- '',
151
- '| Metric | Value |',
152
- '|--------|-------|',
153
- `| Total Deals | ${dealsResult.total} |`,
154
- `| Pipeline Value | ${formatCurrency(dealsResult.totalValue)} |`,
155
- `| Open Deals | ${openDeals.length} (${formatCurrency(openValue)}) |`,
156
- `| Won Deals | ${wonDeals.length} (${formatCurrency(wonValue)}) |`,
157
- `| Lost Deals | ${lostDeals.length} |`,
158
- '',
159
- '## Pipeline Stages',
160
- '',
161
- ];
162
-
163
- // Stage summary table
164
- lines.push('| Stage | Deals | Value |');
165
- lines.push('|-------|-------|-------|');
166
- for (const stage of stageList.sort((a, b) => a.position - b.position)) {
167
- const stageDeals = openDeals.filter((d) => d.stageId === stage.id);
168
- const stageValue = stageDeals.reduce((sum, d) => sum + d.value, 0);
169
- lines.push(
170
- `| ${stage.name} | ${stageDeals.length} | ${formatCurrency(stageValue)} |`
171
- );
172
- }
173
-
174
- lines.push('');
175
- lines.push('## Recent Deals');
176
- lines.push('');
177
-
178
- // Top 10 recent deals
179
- const recentDeals = deals.slice(0, 10);
180
- if (recentDeals.length === 0) {
181
- lines.push('_No deals yet._');
182
- } else {
183
- lines.push('| Deal | Value | Stage | Status |');
184
- lines.push('|------|-------|-------|--------|');
185
- for (const deal of recentDeals) {
186
- const stage = stageList.find((s) => s.id === deal.stageId);
187
- lines.push(
188
- `| ${deal.name} | ${formatCurrency(deal.value, deal.currency)} | ${stage?.name ?? '-'} | ${deal.status} |`
189
- );
190
- }
191
- }
192
-
193
- return {
194
- mimeType: 'text/markdown',
195
- body: lines.join('\n'),
196
- };
197
- },
117
+ target: 'markdown',
118
+ render: async (desc, _ctx) => {
119
+ // Only handle CrmDashboard
120
+ if (
121
+ desc.source.type !== 'component' ||
122
+ desc.source.componentKey !== 'CrmDashboard'
123
+ ) {
124
+ throw new Error('crmDashboardMarkdownRenderer: not CrmDashboard');
125
+ }
126
+
127
+ const pipelineId = 'pipeline-1';
128
+ const [dealsResult, stages] = await Promise.all([
129
+ mockListDealsHandler({ pipelineId, limit: 100 }),
130
+ mockGetPipelineStagesHandler({ pipelineId }),
131
+ ]);
132
+
133
+ const deals = dealsResult.deals as DealItem[];
134
+ const stageList = stages as StageItem[];
135
+
136
+ // Calculate stats
137
+ const openDeals = deals.filter((d) => d.status === 'OPEN');
138
+ const wonDeals = deals.filter((d) => d.status === 'WON');
139
+ const lostDeals = deals.filter((d) => d.status === 'LOST');
140
+ const openValue = openDeals.reduce((sum, d) => sum + d.value, 0);
141
+ const wonValue = wonDeals.reduce((sum, d) => sum + d.value, 0);
142
+
143
+ // Build dashboard markdown
144
+ const lines: string[] = [
145
+ '# CRM Dashboard',
146
+ '',
147
+ '> Sales pipeline overview and key metrics',
148
+ '',
149
+ '## Summary',
150
+ '',
151
+ '| Metric | Value |',
152
+ '|--------|-------|',
153
+ `| Total Deals | ${dealsResult.total} |`,
154
+ `| Pipeline Value | ${formatCurrency(dealsResult.totalValue)} |`,
155
+ `| Open Deals | ${openDeals.length} (${formatCurrency(openValue)}) |`,
156
+ `| Won Deals | ${wonDeals.length} (${formatCurrency(wonValue)}) |`,
157
+ `| Lost Deals | ${lostDeals.length} |`,
158
+ '',
159
+ '## Pipeline Stages',
160
+ '',
161
+ ];
162
+
163
+ // Stage summary table
164
+ lines.push('| Stage | Deals | Value |');
165
+ lines.push('|-------|-------|-------|');
166
+ for (const stage of stageList.sort((a, b) => a.position - b.position)) {
167
+ const stageDeals = openDeals.filter((d) => d.stageId === stage.id);
168
+ const stageValue = stageDeals.reduce((sum, d) => sum + d.value, 0);
169
+ lines.push(
170
+ `| ${stage.name} | ${stageDeals.length} | ${formatCurrency(stageValue)} |`
171
+ );
172
+ }
173
+
174
+ lines.push('');
175
+ lines.push('## Recent Deals');
176
+ lines.push('');
177
+
178
+ // Top 10 recent deals
179
+ const recentDeals = deals.slice(0, 10);
180
+ if (recentDeals.length === 0) {
181
+ lines.push('_No deals yet._');
182
+ } else {
183
+ lines.push('| Deal | Value | Stage | Status |');
184
+ lines.push('|------|-------|-------|--------|');
185
+ for (const deal of recentDeals) {
186
+ const stage = stageList.find((s) => s.id === deal.stageId);
187
+ lines.push(
188
+ `| ${deal.name} | ${formatCurrency(deal.value, deal.currency)} | ${stage?.name ?? '-'} | ${deal.status} |`
189
+ );
190
+ }
191
+ }
192
+
193
+ return {
194
+ mimeType: 'text/markdown',
195
+ body: lines.join('\n'),
196
+ };
197
+ },
198
198
  };
@@ -4,8 +4,9 @@
4
4
  * Renders the CRM pipeline board component.
5
5
  * Data is fetched via the CrmPipelineBoard component's internal hooks.
6
6
  */
7
- import * as React from 'react';
7
+
8
8
  import type { PresentationRenderer } from '@contractspec/lib.contracts-spec/presentations/transform-engine';
9
+ import * as React from 'react';
9
10
  import { CrmPipelineBoard } from '../CrmPipelineBoard';
10
11
  import { useDealList } from '../hooks/useDealList';
11
12
 
@@ -13,23 +14,23 @@ import { useDealList } from '../hooks/useDealList';
13
14
  * Wrapper component that provides data to CrmPipelineBoard
14
15
  */
15
16
  function CrmPipelineBoardWrapper() {
16
- const { dealsByStage, stages } = useDealList();
17
- return <CrmPipelineBoard dealsByStage={dealsByStage} stages={stages} />;
17
+ const { dealsByStage, stages } = useDealList();
18
+ return <CrmPipelineBoard dealsByStage={dealsByStage} stages={stages} />;
18
19
  }
19
20
 
20
21
  export const crmPipelineReactRenderer: PresentationRenderer<React.ReactElement> =
21
- {
22
- target: 'react',
23
- render: async (desc, _ctx) => {
24
- if (desc.source.type !== 'component') {
25
- throw new Error('Invalid source type');
26
- }
22
+ {
23
+ target: 'react',
24
+ render: async (desc, _ctx) => {
25
+ if (desc.source.type !== 'component') {
26
+ throw new Error('Invalid source type');
27
+ }
27
28
 
28
- if (desc.source.componentKey !== 'CrmPipelineView') {
29
- throw new Error(`Unknown component: ${desc.source.componentKey}`);
30
- }
29
+ if (desc.source.componentKey !== 'CrmPipelineView') {
30
+ throw new Error(`Unknown component: ${desc.source.componentKey}`);
31
+ }
31
32
 
32
- // Note: The wrapper component will fetch data internally
33
- return <CrmPipelineBoardWrapper />;
34
- },
35
- };
33
+ // Note: The wrapper component will fetch data internally
34
+ return <CrmPipelineBoardWrapper />;
35
+ },
36
+ };
package/tsconfig.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
- "extends": "@contractspec/tool.typescript/react-library.json",
3
- "include": ["src"],
4
- "exclude": ["node_modules", "dist"],
5
- "compilerOptions": {
6
- "rootDir": "src",
7
- "outDir": "dist"
8
- }
2
+ "extends": "@contractspec/tool.typescript/react-library.json",
3
+ "include": ["src"],
4
+ "exclude": ["node_modules", "dist"],
5
+ "compilerOptions": {
6
+ "rootDir": "src",
7
+ "outDir": "dist"
8
+ }
9
9
  }
10
-
package/tsdown.config.js CHANGED
@@ -1,6 +1,10 @@
1
- import { defineConfig, moduleLibrary, withDevExports } from '@contractspec/tool.bun';
1
+ import {
2
+ defineConfig,
3
+ moduleLibrary,
4
+ withDevExports,
5
+ } from '@contractspec/tool.bun';
2
6
 
3
7
  export default defineConfig((options) => ({
4
- ...moduleLibrary,
5
- ...withDevExports,
8
+ ...moduleLibrary,
9
+ ...withDevExports,
6
10
  }));