@contractspec/example.crm-pipeline 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 (105) hide show
  1. package/.turbo/turbo-build.log +8 -8
  2. package/AGENTS.md +51 -33
  3. package/README.md +66 -148
  4. package/dist/browser/events/contact.event.js +1 -1
  5. package/dist/browser/events/deal.event.js +1 -1
  6. package/dist/browser/events/index.js +3 -3
  7. package/dist/browser/events/task.event.js +1 -1
  8. package/dist/browser/index.js +293 -293
  9. package/dist/browser/ui/CrmDashboard.js +221 -221
  10. package/dist/browser/ui/CrmDealCard.js +5 -5
  11. package/dist/browser/ui/CrmPipelineBoard.js +13 -13
  12. package/dist/browser/ui/hooks/index.js +2 -2
  13. package/dist/browser/ui/hooks/useDealList.js +1 -1
  14. package/dist/browser/ui/hooks/useDealMutations.js +1 -1
  15. package/dist/browser/ui/index.js +290 -290
  16. package/dist/browser/ui/modals/CreateDealModal.js +12 -12
  17. package/dist/browser/ui/modals/DealActionsModal.js +21 -21
  18. package/dist/browser/ui/modals/index.js +33 -33
  19. package/dist/browser/ui/renderers/index.js +116 -116
  20. package/dist/browser/ui/renderers/pipeline.renderer.js +97 -97
  21. package/dist/deal/index.d.ts +2 -2
  22. package/dist/events/contact.event.js +1 -1
  23. package/dist/events/deal.event.js +1 -1
  24. package/dist/events/index.js +3 -3
  25. package/dist/events/task.event.js +1 -1
  26. package/dist/handlers/index.d.ts +2 -2
  27. package/dist/index.d.ts +3 -3
  28. package/dist/index.js +293 -293
  29. package/dist/node/events/contact.event.js +1 -1
  30. package/dist/node/events/deal.event.js +1 -1
  31. package/dist/node/events/index.js +3 -3
  32. package/dist/node/events/task.event.js +1 -1
  33. package/dist/node/index.js +293 -293
  34. package/dist/node/ui/CrmDashboard.js +221 -221
  35. package/dist/node/ui/CrmDealCard.js +5 -5
  36. package/dist/node/ui/CrmPipelineBoard.js +13 -13
  37. package/dist/node/ui/hooks/index.js +2 -2
  38. package/dist/node/ui/hooks/useDealList.js +1 -1
  39. package/dist/node/ui/hooks/useDealMutations.js +1 -1
  40. package/dist/node/ui/index.js +290 -290
  41. package/dist/node/ui/modals/CreateDealModal.js +12 -12
  42. package/dist/node/ui/modals/DealActionsModal.js +21 -21
  43. package/dist/node/ui/modals/index.js +33 -33
  44. package/dist/node/ui/renderers/index.js +116 -116
  45. package/dist/node/ui/renderers/pipeline.renderer.js +97 -97
  46. package/dist/operations/index.d.ts +1 -1
  47. package/dist/ui/CrmDashboard.js +221 -221
  48. package/dist/ui/CrmDealCard.js +5 -5
  49. package/dist/ui/CrmPipelineBoard.js +13 -13
  50. package/dist/ui/hooks/index.d.ts +2 -2
  51. package/dist/ui/hooks/index.js +2 -2
  52. package/dist/ui/hooks/useDealList.js +1 -1
  53. package/dist/ui/hooks/useDealMutations.d.ts +9 -0
  54. package/dist/ui/hooks/useDealMutations.js +1 -1
  55. package/dist/ui/index.d.ts +3 -3
  56. package/dist/ui/index.js +290 -290
  57. package/dist/ui/modals/CreateDealModal.js +12 -12
  58. package/dist/ui/modals/DealActionsModal.js +21 -21
  59. package/dist/ui/modals/index.js +33 -33
  60. package/dist/ui/renderers/index.d.ts +1 -1
  61. package/dist/ui/renderers/index.js +116 -116
  62. package/dist/ui/renderers/pipeline.renderer.d.ts +1 -1
  63. package/dist/ui/renderers/pipeline.renderer.js +97 -97
  64. package/package.json +10 -10
  65. package/src/crm-pipeline.feature.ts +86 -86
  66. package/src/deal/deal.enum.ts +8 -8
  67. package/src/deal/deal.operation.ts +255 -255
  68. package/src/deal/deal.schema.ts +92 -92
  69. package/src/deal/deal.test-spec.ts +48 -48
  70. package/src/deal/index.ts +17 -19
  71. package/src/docs/crm-pipeline.docblock.ts +43 -43
  72. package/src/entities/company.entity.ts +52 -52
  73. package/src/entities/contact.entity.ts +67 -67
  74. package/src/entities/deal.entity.ts +134 -134
  75. package/src/entities/index.ts +27 -27
  76. package/src/entities/task.entity.ts +105 -105
  77. package/src/events/contact.event.ts +22 -22
  78. package/src/events/deal.event.ts +77 -77
  79. package/src/events/task.event.ts +19 -19
  80. package/src/example.ts +32 -32
  81. package/src/handlers/crm.handlers.ts +358 -357
  82. package/src/handlers/deal.handlers.ts +179 -179
  83. package/src/handlers/index.ts +18 -19
  84. package/src/handlers/mock-data.ts +167 -167
  85. package/src/index.ts +11 -11
  86. package/src/operations/index.ts +16 -16
  87. package/src/presentations/dashboard.presentation.ts +45 -45
  88. package/src/presentations/pipeline.presentation.ts +90 -90
  89. package/src/seeders/index.ts +26 -26
  90. package/src/shared/overlay-types.ts +23 -23
  91. package/src/ui/CrmDashboard.tsx +256 -256
  92. package/src/ui/CrmDealCard.tsx +64 -64
  93. package/src/ui/CrmPipelineBoard.tsx +105 -105
  94. package/src/ui/hooks/index.ts +3 -3
  95. package/src/ui/hooks/useDealList.ts +85 -85
  96. package/src/ui/hooks/useDealMutations.ts +151 -150
  97. package/src/ui/index.ts +5 -10
  98. package/src/ui/modals/CreateDealModal.tsx +217 -217
  99. package/src/ui/modals/DealActionsModal.tsx +390 -390
  100. package/src/ui/overlays/demo-overlays.ts +43 -43
  101. package/src/ui/renderers/index.ts +4 -3
  102. package/src/ui/renderers/pipeline.markdown.ts +165 -165
  103. package/src/ui/renderers/pipeline.renderer.tsx +17 -16
  104. package/tsconfig.json +7 -8
  105. 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
  }));