@contractspec/example.crm-pipeline 1.56.0 → 1.57.0

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 (65) hide show
  1. package/.turbo/turbo-build$colon$bundle.log +51 -59
  2. package/.turbo/turbo-build.log +165 -175
  3. package/CHANGELOG.md +41 -0
  4. package/dist/crm-pipeline.feature.d.ts +0 -1
  5. package/dist/crm-pipeline.feature.d.ts.map +1 -1
  6. package/dist/deal/deal.enum.d.ts +3 -3
  7. package/dist/deal/deal.enum.d.ts.map +1 -1
  8. package/dist/deal/deal.operation.d.ts +128 -128
  9. package/dist/deal/deal.operation.d.ts.map +1 -1
  10. package/dist/deal/deal.schema.d.ts +71 -71
  11. package/dist/deal/deal.schema.d.ts.map +1 -1
  12. package/dist/deal/deal.test-spec.d.ts +3 -3
  13. package/dist/deal/deal.test-spec.d.ts.map +1 -1
  14. package/dist/entities/company.entity.d.ts +28 -28
  15. package/dist/entities/company.entity.d.ts.map +1 -1
  16. package/dist/entities/contact.entity.d.ts.map +1 -1
  17. package/dist/entities/deal.entity.d.ts +53 -53
  18. package/dist/entities/deal.entity.d.ts.map +1 -1
  19. package/dist/entities/index.d.ts +0 -1
  20. package/dist/entities/index.d.ts.map +1 -1
  21. package/dist/entities/task.entity.d.ts +43 -43
  22. package/dist/entities/task.entity.d.ts.map +1 -1
  23. package/dist/events/contact.event.d.ts +8 -8
  24. package/dist/events/contact.event.d.ts.map +1 -1
  25. package/dist/events/deal.event.d.ts +30 -30
  26. package/dist/events/deal.event.d.ts.map +1 -1
  27. package/dist/events/task.event.d.ts +8 -8
  28. package/dist/events/task.event.d.ts.map +1 -1
  29. package/dist/example.d.ts.map +1 -1
  30. package/dist/example.js +1 -2
  31. package/dist/example.js.map +1 -1
  32. package/dist/handlers/crm.handlers.d.ts +0 -1
  33. package/dist/handlers/crm.handlers.d.ts.map +1 -1
  34. package/dist/handlers/deal.handlers.d.ts.map +1 -1
  35. package/dist/handlers/mock-data.d.ts.map +1 -1
  36. package/dist/index.d.ts +2 -2
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +2 -2
  39. package/dist/presentations/dashboard.presentation.d.ts +3 -3
  40. package/dist/presentations/dashboard.presentation.d.ts.map +1 -1
  41. package/dist/presentations/pipeline.presentation.d.ts +5 -5
  42. package/dist/presentations/pipeline.presentation.d.ts.map +1 -1
  43. package/dist/seeders/index.d.ts.map +1 -1
  44. package/dist/shared/overlay-types.d.ts.map +1 -1
  45. package/dist/ui/CrmDashboard.d.ts.map +1 -1
  46. package/dist/ui/CrmDealCard.d.ts +2 -2
  47. package/dist/ui/CrmDealCard.d.ts.map +1 -1
  48. package/dist/ui/CrmPipelineBoard.d.ts.map +1 -1
  49. package/dist/ui/hooks/useDealList.d.ts.map +1 -1
  50. package/dist/ui/hooks/useDealMutations.d.ts.map +1 -1
  51. package/dist/ui/modals/CreateDealModal.d.ts +2 -2
  52. package/dist/ui/modals/CreateDealModal.d.ts.map +1 -1
  53. package/dist/ui/modals/DealActionsModal.d.ts +2 -2
  54. package/dist/ui/modals/DealActionsModal.d.ts.map +1 -1
  55. package/dist/ui/overlays/demo-overlays.d.ts +0 -1
  56. package/dist/ui/overlays/demo-overlays.d.ts.map +1 -1
  57. package/dist/ui/renderers/pipeline.markdown.d.ts +0 -1
  58. package/dist/ui/renderers/pipeline.markdown.d.ts.map +1 -1
  59. package/dist/ui/renderers/pipeline.markdown.js +2 -1
  60. package/dist/ui/renderers/pipeline.markdown.js.map +1 -1
  61. package/dist/ui/renderers/pipeline.renderer.d.ts +0 -1
  62. package/dist/ui/renderers/pipeline.renderer.d.ts.map +1 -1
  63. package/package.json +14 -14
  64. package/src/ui/renderers/pipeline.markdown.ts +1 -1
  65. package/tsconfig.tsbuildinfo +1 -0
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime3 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/ui/modals/DealActionsModal.d.ts
4
4
  interface Deal {
@@ -45,7 +45,7 @@ declare function DealActionsModal({
45
45
  onLose,
46
46
  onMove,
47
47
  isLoading
48
- }: DealActionsModalProps): react_jsx_runtime3.JSX.Element | null;
48
+ }: DealActionsModalProps): react_jsx_runtime0.JSX.Element | null;
49
49
  //#endregion
50
50
  export { Deal, DealActionsModal, LoseDealInput, MoveDealInput, WinDealInput };
51
51
  //# sourceMappingURL=DealActionsModal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DealActionsModal.d.ts","names":[],"sources":["../../../src/ui/modals/DealActionsModal.tsx"],"sourcesContent":[],"mappings":";;;UAYiB,IAAA;;;EAAA,KAAA,EAAI,MAAA;EASJ,QAAA,EAAA,MAAY;EAMZ,OAAA,EAAA,MAAA;EAMA,MAAA,EAAA,MAAA,GAAa,KAAA,GAAA,MAAA,GAAA,OAAA;AAG7B;AAMO,UArBS,YAAA,CAqBT;EAGS,MAAA,EAAA,MAAA;EAAiB,SAAA,CAAA,EAAA,MAAA;EAChB,KAAA,CAAA,EAAA,MAAA;;AACA,UApBD,aAAA,CAoBC;EAAkB,MAAA,EAAA,MAAA;EAAO,UAAA,EAAA,MAAA;EAa3B,KAAA,CAAA,EAAA,MAAA;;AAEd,UA7Be,aAAA,CA6Bf;EACA,MAAA,EAAA,MAAA;EACA,OAAA,EAAA,MAAA;;UAxBQ,qBAAA,CA0BR;EACA,MAAA,EAAA,OAAA;EACA,IAAA,EA1BM,IA0BN,GAAA,IAAA;EACC,MAAA,EAAA;IAAqB,EAAA,EAAA,MAAA;IAAA,IAAA,EAAA,MAAA;;;iBAxBP,iBAAiB;kBAChB,kBAAkB;kBAClB,kBAAkB;;;iBAapB,gBAAA;;;;;;;;;GASb,wBAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"DealActionsModal.d.ts","names":[],"sources":["../../../src/ui/modals/DealActionsModal.tsx"],"mappings":";;;UAYiB,IAAA;EACf,EAAA;EACA,IAAA;EACA,KAAA;EACA,QAAA;EACA,OAAA;EACA,MAAA;AAAA;AAAA,UAGe,YAAA;EACf,MAAA;EACA,SAAA;EACA,KAAA;AAAA;AAAA,UAGe,aAAA;EACf,MAAA;EACA,UAAA;EACA,KAAA;AAAA;AAAA,UAGe,aAAA;EACf,MAAA;EACA,OAAA;AAAA;AAAA,UAKQ,qBAAA;EACR,MAAA;EACA,IAAA,EAAM,IAAA;EACN,MAAA;IAAU,EAAA;IAAY,IAAA;EAAA;EACtB,OAAA;EACA,KAAA,GAAQ,KAAA,EAAO,YAAA,KAAiB,OAAA;EAChC,MAAA,GAAS,KAAA,EAAO,aAAA,KAAkB,OAAA;EAClC,MAAA,GAAS,KAAA,EAAO,aAAA,KAAkB,OAAA;EAClC,SAAA;AAAA;AAAA,iBAYc,gBAAA,CAAA;EACd,MAAA;EACA,IAAA;EACA,MAAA;EACA,OAAA;EACA,KAAA;EACA,MAAA;EACA,MAAA;EACA;AAAA,GACC,qBAAA,GAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -1,7 +1,6 @@
1
1
  import { OverlayDefinition } from "../../shared/overlay-types.js";
2
2
 
3
3
  //#region src/ui/overlays/demo-overlays.d.ts
4
-
5
4
  /**
6
5
  * Demo user overlay - sample data mode
7
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"demo-overlays.d.ts","names":[],"sources":["../../../src/ui/overlays/demo-overlays.ts"],"sourcesContent":[],"mappings":";;;;;;;cAWa,gBAAgB;;;;cA+BhB,oBAAoB;;;;cAsBpB,aAAa"}
1
+ {"version":3,"file":"demo-overlays.d.ts","names":[],"sources":["../../../src/ui/overlays/demo-overlays.ts"],"mappings":";;;;AA0CA;;cA/Ba,cAAA,EAAgB,iBAAA;;;AAqD7B;cAtBa,kBAAA,EAAoB,iBAAA;;;;cAsBpB,WAAA,EAAa,iBAAA"}
@@ -1,7 +1,6 @@
1
1
  import { PresentationRenderer } from "@contractspec/lib.contracts";
2
2
 
3
3
  //#region src/ui/renderers/pipeline.markdown.d.ts
4
-
5
4
  /**
6
5
  * Markdown renderer for CRM Pipeline Kanban view (crm-pipeline.deal.pipeline)
7
6
  * Only handles PipelineKanbanView component
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline.markdown.d.ts","names":[],"sources":["../../../src/ui/renderers/pipeline.markdown.ts"],"sourcesContent":[],"mappings":";;;;;;;;cAsCa,6BAA6B;;;;;;;;cA0E7B,8BAA8B"}
1
+ {"version":3,"file":"pipeline.markdown.d.ts","names":[],"sources":["../../../src/ui/renderers/pipeline.markdown.ts"],"mappings":";;;;;;;cAsCa,2BAAA,EAA6B,oBAAA;EACxC,QAAA;EACA,IAAA;AAAA;;;;;cAwEW,4BAAA,EAA8B,oBAAA;EACzC,QAAA;EACA,IAAA;AAAA"}
@@ -1,4 +1,5 @@
1
- import { mockGetPipelineStagesHandler, mockListDealsHandler } from "@contractspec/example.crm-pipeline/handlers";
1
+ import { mockGetPipelineStagesHandler, mockListDealsHandler } from "../../handlers/deal.handlers.js";
2
+ import "../../handlers/index.js";
2
3
 
3
4
  //#region src/ui/renderers/pipeline.markdown.ts
4
5
  function formatCurrency(value, currency = "USD") {
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline.markdown.js","names":[],"sources":["../../../src/ui/renderers/pipeline.markdown.ts"],"sourcesContent":["/**\n * Markdown renderer for CRM Pipeline presentation\n *\n * Imports handlers from the hooks module to ensure correct build order.\n */\nimport type { PresentationRenderer } from '@contractspec/lib.contracts';\nimport {\n mockListDealsHandler,\n mockGetPipelineStagesHandler,\n} from '@contractspec/example.crm-pipeline/handlers';\n\ninterface DealItem {\n id: string;\n name: string;\n value: number;\n currency: string;\n stageId: string;\n status: string;\n}\n\ninterface StageItem {\n id: string;\n name: string;\n position: number;\n}\n\nfunction formatCurrency(value: number, currency = 'USD'): string {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n minimumFractionDigits: 0,\n }).format(value);\n}\n\n/**\n * Markdown renderer for CRM Pipeline Kanban view (crm-pipeline.deal.pipeline)\n * Only handles PipelineKanbanView component\n */\nexport const crmPipelineMarkdownRenderer: PresentationRenderer<{\n mimeType: string;\n body: string;\n}> = {\n target: 'markdown',\n render: async (desc, _ctx) => {\n // Only handle PipelineKanbanView\n if (\n desc.source.type !== 'component' ||\n desc.source.componentKey !== 'PipelineKanbanView'\n ) {\n throw new Error('crmPipelineMarkdownRenderer: not PipelineKanbanView');\n }\n\n const pipelineId = 'pipeline-1';\n const [dealsResult, stages] = await Promise.all([\n mockListDealsHandler({ pipelineId, limit: 50 }),\n mockGetPipelineStagesHandler({ pipelineId }),\n ]);\n\n const deals = dealsResult.deals as DealItem[];\n const stageList = stages as StageItem[];\n\n // Group deals by stage\n const dealsByStage: Record<string, DealItem[]> = {};\n for (const stage of stageList) {\n dealsByStage[stage.id] = deals.filter(\n (d) => d.stageId === stage.id && d.status === 'OPEN'\n );\n }\n\n // Build Markdown\n const lines: string[] = [\n '# CRM Pipeline',\n '',\n `**Total Value**: ${formatCurrency(dealsResult.totalValue)}`,\n `**Total Deals**: ${dealsResult.total}`,\n '',\n ];\n\n for (const stage of stageList.sort((a, b) => a.position - b.position)) {\n const stageDeals = dealsByStage[stage.id] ?? [];\n const stageValue = stageDeals.reduce((sum, d) => sum + d.value, 0);\n\n lines.push(`## ${stage.name}`);\n lines.push(\n `_${stageDeals.length} deals · ${formatCurrency(stageValue)}_`\n );\n lines.push('');\n\n if (stageDeals.length === 0) {\n lines.push('_No deals_');\n } else {\n for (const deal of stageDeals) {\n lines.push(\n `- **${deal.name}** - ${formatCurrency(deal.value, deal.currency)}`\n );\n }\n }\n\n lines.push('');\n }\n\n return {\n mimeType: 'text/markdown',\n body: lines.join('\\n'),\n };\n },\n};\n\n/**\n * Markdown renderer for CRM Dashboard (crm-pipeline.dashboard)\n * Only handles CrmDashboard component\n */\nexport const crmDashboardMarkdownRenderer: PresentationRenderer<{\n mimeType: string;\n body: string;\n}> = {\n target: 'markdown',\n render: async (desc, _ctx) => {\n // Only handle CrmDashboard\n if (\n desc.source.type !== 'component' ||\n desc.source.componentKey !== 'CrmDashboard'\n ) {\n throw new Error('crmDashboardMarkdownRenderer: not CrmDashboard');\n }\n\n const pipelineId = 'pipeline-1';\n const [dealsResult, stages] = await Promise.all([\n mockListDealsHandler({ pipelineId, limit: 100 }),\n mockGetPipelineStagesHandler({ pipelineId }),\n ]);\n\n const deals = dealsResult.deals as DealItem[];\n const stageList = stages as StageItem[];\n\n // Calculate stats\n const openDeals = deals.filter((d) => d.status === 'OPEN');\n const wonDeals = deals.filter((d) => d.status === 'WON');\n const lostDeals = deals.filter((d) => d.status === 'LOST');\n const openValue = openDeals.reduce((sum, d) => sum + d.value, 0);\n const wonValue = wonDeals.reduce((sum, d) => sum + d.value, 0);\n\n // Build dashboard markdown\n const lines: string[] = [\n '# CRM Dashboard',\n '',\n '> Sales pipeline overview and key metrics',\n '',\n '## Summary',\n '',\n '| Metric | Value |',\n '|--------|-------|',\n `| Total Deals | ${dealsResult.total} |`,\n `| Pipeline Value | ${formatCurrency(dealsResult.totalValue)} |`,\n `| Open Deals | ${openDeals.length} (${formatCurrency(openValue)}) |`,\n `| Won Deals | ${wonDeals.length} (${formatCurrency(wonValue)}) |`,\n `| Lost Deals | ${lostDeals.length} |`,\n '',\n '## Pipeline Stages',\n '',\n ];\n\n // Stage summary table\n lines.push('| Stage | Deals | Value |');\n lines.push('|-------|-------|-------|');\n for (const stage of stageList.sort((a, b) => a.position - b.position)) {\n const stageDeals = openDeals.filter((d) => d.stageId === stage.id);\n const stageValue = stageDeals.reduce((sum, d) => sum + d.value, 0);\n lines.push(\n `| ${stage.name} | ${stageDeals.length} | ${formatCurrency(stageValue)} |`\n );\n }\n\n lines.push('');\n lines.push('## Recent Deals');\n lines.push('');\n\n // Top 10 recent deals\n const recentDeals = deals.slice(0, 10);\n if (recentDeals.length === 0) {\n lines.push('_No deals yet._');\n } else {\n lines.push('| Deal | Value | Stage | Status |');\n lines.push('|------|-------|-------|--------|');\n for (const deal of recentDeals) {\n const stage = stageList.find((s) => s.id === deal.stageId);\n lines.push(\n `| ${deal.name} | ${formatCurrency(deal.value, deal.currency)} | ${stage?.name ?? '-'} | ${deal.status} |`\n );\n }\n }\n\n return {\n mimeType: 'text/markdown',\n body: lines.join('\\n'),\n };\n },\n};\n"],"mappings":";;;AA0BA,SAAS,eAAe,OAAe,WAAW,OAAe;AAC/D,QAAO,IAAI,KAAK,aAAa,SAAS;EACpC,OAAO;EACP;EACA,uBAAuB;EACxB,CAAC,CAAC,OAAO,MAAM;;;;;;AAOlB,MAAa,8BAGR;CACH,QAAQ;CACR,QAAQ,OAAO,MAAM,SAAS;AAE5B,MACE,KAAK,OAAO,SAAS,eACrB,KAAK,OAAO,iBAAiB,qBAE7B,OAAM,IAAI,MAAM,sDAAsD;EAGxE,MAAM,aAAa;EACnB,MAAM,CAAC,aAAa,UAAU,MAAM,QAAQ,IAAI,CAC9C,qBAAqB;GAAE;GAAY,OAAO;GAAI,CAAC,EAC/C,6BAA6B,EAAE,YAAY,CAAC,CAC7C,CAAC;EAEF,MAAM,QAAQ,YAAY;EAC1B,MAAM,YAAY;EAGlB,MAAM,eAA2C,EAAE;AACnD,OAAK,MAAM,SAAS,UAClB,cAAa,MAAM,MAAM,MAAM,QAC5B,MAAM,EAAE,YAAY,MAAM,MAAM,EAAE,WAAW,OAC/C;EAIH,MAAM,QAAkB;GACtB;GACA;GACA,oBAAoB,eAAe,YAAY,WAAW;GAC1D,oBAAoB,YAAY;GAChC;GACD;AAED,OAAK,MAAM,SAAS,UAAU,MAAM,GAAG,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE;GACrE,MAAM,aAAa,aAAa,MAAM,OAAO,EAAE;GAC/C,MAAM,aAAa,WAAW,QAAQ,KAAK,MAAM,MAAM,EAAE,OAAO,EAAE;AAElE,SAAM,KAAK,MAAM,MAAM,OAAO;AAC9B,SAAM,KACJ,IAAI,WAAW,OAAO,WAAW,eAAe,WAAW,CAAC,GAC7D;AACD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vC,QAAM,KAAK,4BAA4B;AACvC,OAAK,MAAM,SAAS,UAAU,MAAM,GAAG,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE;GACrE,MAAM,aAAa,UAAU,QAAQ,MAAM,EAAE,YAAY,MAAM,GAAG;GAClE,MAAM,aAAa,WAAW,QAAQ,KAAK,MAAM,MAAM,EAAE,OAAO,EAAE;AAClE,SAAM,KACJ,KAAK,MAAM,KAAK,KAAK,WAAW,OAAO,KAAK,eAAe,WAAW,CAAC,IACxE;;AAGH,QAAM,KAAK,GAAG;AACd,QAAM,KAAK,kBAAkB;AAC7B,QAAM,KAAK,GAAG;EAGd,MAAM,cAAc,MAAM,MAAM,GAAG,GAAG;AACtC,MAAI,YAAY,WAAW,EACzB,OAAM,KAAK,kBAAkB;OACxB;AACL,SAAM,KAAK,oCAAoC;AAC/C,SAAM,KAAK,oCAAoC;AAC/C,QAAK,MAAM,QAAQ,aAAa;IAC9B,MAAM,QAAQ,UAAU,MAAM,MAAM,EAAE,OAAO,KAAK,QAAQ;AAC1D,UAAM,KACJ,KAAK,KAAK,KAAK,KAAK,eAAe,KAAK,OAAO,KAAK,SAAS,CAAC,KAAK,OAAO,QAAQ,IAAI,KAAK,KAAK,OAAO,IACxG;;;AAIL,SAAO;GACL,UAAU;GACV,MAAM,MAAM,KAAK,KAAK;GACvB;;CAEJ"}
1
+ {"version":3,"file":"pipeline.markdown.js","names":[],"sources":["../../../src/ui/renderers/pipeline.markdown.ts"],"sourcesContent":["/**\n * Markdown renderer for CRM Pipeline presentation\n *\n * Imports handlers from the hooks module to ensure correct build order.\n */\nimport type { PresentationRenderer } from '@contractspec/lib.contracts';\nimport {\n mockListDealsHandler,\n mockGetPipelineStagesHandler,\n} from '../../handlers';\n\ninterface DealItem {\n id: string;\n name: string;\n value: number;\n currency: string;\n stageId: string;\n status: string;\n}\n\ninterface StageItem {\n id: string;\n name: string;\n position: number;\n}\n\nfunction formatCurrency(value: number, currency = 'USD'): string {\n return new Intl.NumberFormat('en-US', {\n style: 'currency',\n currency,\n minimumFractionDigits: 0,\n }).format(value);\n}\n\n/**\n * Markdown renderer for CRM Pipeline Kanban view (crm-pipeline.deal.pipeline)\n * Only handles PipelineKanbanView component\n */\nexport const crmPipelineMarkdownRenderer: PresentationRenderer<{\n mimeType: string;\n body: string;\n}> = {\n target: 'markdown',\n render: async (desc, _ctx) => {\n // Only handle PipelineKanbanView\n if (\n desc.source.type !== 'component' ||\n desc.source.componentKey !== 'PipelineKanbanView'\n ) {\n throw new Error('crmPipelineMarkdownRenderer: not PipelineKanbanView');\n }\n\n const pipelineId = 'pipeline-1';\n const [dealsResult, stages] = await Promise.all([\n mockListDealsHandler({ pipelineId, limit: 50 }),\n mockGetPipelineStagesHandler({ pipelineId }),\n ]);\n\n const deals = dealsResult.deals as DealItem[];\n const stageList = stages as StageItem[];\n\n // Group deals by stage\n const dealsByStage: Record<string, DealItem[]> = {};\n for (const stage of stageList) {\n dealsByStage[stage.id] = deals.filter(\n (d) => d.stageId === stage.id && d.status === 'OPEN'\n );\n }\n\n // Build Markdown\n const lines: string[] = [\n '# CRM Pipeline',\n '',\n `**Total Value**: ${formatCurrency(dealsResult.totalValue)}`,\n `**Total Deals**: ${dealsResult.total}`,\n '',\n ];\n\n for (const stage of stageList.sort((a, b) => a.position - b.position)) {\n const stageDeals = dealsByStage[stage.id] ?? [];\n const stageValue = stageDeals.reduce((sum, d) => sum + d.value, 0);\n\n lines.push(`## ${stage.name}`);\n lines.push(\n `_${stageDeals.length} deals · ${formatCurrency(stageValue)}_`\n );\n lines.push('');\n\n if (stageDeals.length === 0) {\n lines.push('_No deals_');\n } else {\n for (const deal of stageDeals) {\n lines.push(\n `- **${deal.name}** - ${formatCurrency(deal.value, deal.currency)}`\n );\n }\n }\n\n lines.push('');\n }\n\n return {\n mimeType: 'text/markdown',\n body: lines.join('\\n'),\n };\n },\n};\n\n/**\n * Markdown renderer for CRM Dashboard (crm-pipeline.dashboard)\n * Only handles CrmDashboard component\n */\nexport const crmDashboardMarkdownRenderer: PresentationRenderer<{\n mimeType: string;\n body: string;\n}> = {\n target: 'markdown',\n render: async (desc, _ctx) => {\n // Only handle CrmDashboard\n if (\n desc.source.type !== 'component' ||\n desc.source.componentKey !== 'CrmDashboard'\n ) {\n throw new Error('crmDashboardMarkdownRenderer: not CrmDashboard');\n }\n\n const pipelineId = 'pipeline-1';\n const [dealsResult, stages] = await Promise.all([\n mockListDealsHandler({ pipelineId, limit: 100 }),\n mockGetPipelineStagesHandler({ pipelineId }),\n ]);\n\n const deals = dealsResult.deals as DealItem[];\n const stageList = stages as StageItem[];\n\n // Calculate stats\n const openDeals = deals.filter((d) => d.status === 'OPEN');\n const wonDeals = deals.filter((d) => d.status === 'WON');\n const lostDeals = deals.filter((d) => d.status === 'LOST');\n const openValue = openDeals.reduce((sum, d) => sum + d.value, 0);\n const wonValue = wonDeals.reduce((sum, d) => sum + d.value, 0);\n\n // Build dashboard markdown\n const lines: string[] = [\n '# CRM Dashboard',\n '',\n '> Sales pipeline overview and key metrics',\n '',\n '## Summary',\n '',\n '| Metric | Value |',\n '|--------|-------|',\n `| Total Deals | ${dealsResult.total} |`,\n `| Pipeline Value | ${formatCurrency(dealsResult.totalValue)} |`,\n `| Open Deals | ${openDeals.length} (${formatCurrency(openValue)}) |`,\n `| Won Deals | ${wonDeals.length} (${formatCurrency(wonValue)}) |`,\n `| Lost Deals | ${lostDeals.length} |`,\n '',\n '## Pipeline Stages',\n '',\n ];\n\n // Stage summary table\n lines.push('| Stage | Deals | Value |');\n lines.push('|-------|-------|-------|');\n for (const stage of stageList.sort((a, b) => a.position - b.position)) {\n const stageDeals = openDeals.filter((d) => d.stageId === stage.id);\n const stageValue = stageDeals.reduce((sum, d) => sum + d.value, 0);\n lines.push(\n `| ${stage.name} | ${stageDeals.length} | ${formatCurrency(stageValue)} |`\n );\n }\n\n lines.push('');\n lines.push('## Recent Deals');\n lines.push('');\n\n // Top 10 recent deals\n const recentDeals = deals.slice(0, 10);\n if (recentDeals.length === 0) {\n lines.push('_No deals yet._');\n } else {\n lines.push('| Deal | Value | Stage | Status |');\n lines.push('|------|-------|-------|--------|');\n for (const deal of recentDeals) {\n const stage = stageList.find((s) => s.id === deal.stageId);\n lines.push(\n `| ${deal.name} | ${formatCurrency(deal.value, deal.currency)} | ${stage?.name ?? '-'} | ${deal.status} |`\n );\n }\n }\n\n return {\n mimeType: 'text/markdown',\n body: lines.join('\\n'),\n };\n },\n};\n"],"mappings":";;;;AA0BA,SAAS,eAAe,OAAe,WAAW,OAAe;AAC/D,QAAO,IAAI,KAAK,aAAa,SAAS;EACpC,OAAO;EACP;EACA,uBAAuB;EACxB,CAAC,CAAC,OAAO,MAAM;;;;;;AAOlB,MAAa,8BAGR;CACH,QAAQ;CACR,QAAQ,OAAO,MAAM,SAAS;AAE5B,MACE,KAAK,OAAO,SAAS,eACrB,KAAK,OAAO,iBAAiB,qBAE7B,OAAM,IAAI,MAAM,sDAAsD;EAGxE,MAAM,aAAa;EACnB,MAAM,CAAC,aAAa,UAAU,MAAM,QAAQ,IAAI,CAC9C,qBAAqB;GAAE;GAAY,OAAO;GAAI,CAAC,EAC/C,6BAA6B,EAAE,YAAY,CAAC,CAC7C,CAAC;EAEF,MAAM,QAAQ,YAAY;EAC1B,MAAM,YAAY;EAGlB,MAAM,eAA2C,EAAE;AACnD,OAAK,MAAM,SAAS,UAClB,cAAa,MAAM,MAAM,MAAM,QAC5B,MAAM,EAAE,YAAY,MAAM,MAAM,EAAE,WAAW,OAC/C;EAIH,MAAM,QAAkB;GACtB;GACA;GACA,oBAAoB,eAAe,YAAY,WAAW;GAC1D,oBAAoB,YAAY;GAChC;GACD;AAED,OAAK,MAAM,SAAS,UAAU,MAAM,GAAG,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE;GACrE,MAAM,aAAa,aAAa,MAAM,OAAO,EAAE;GAC/C,MAAM,aAAa,WAAW,QAAQ,KAAK,MAAM,MAAM,EAAE,OAAO,EAAE;AAElE,SAAM,KAAK,MA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AAS,CAAC;GAC9D,kBAAkB,UAAU,OAAO;GACnC;GACA;GACA;GACD;AAGD,QAAM,KAAK,4BAA4B;AACvC,QAAM,KAAK,4BAA4B;AACvC,OAAK,MAAM,SAAS,UAAU,MAAM,GAAG,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE;GACrE,MAAM,aAAa,UAAU,QAAQ,MAAM,EAAE,YAAY,MAAM,GAAG;GAClE,MAAM,aAAa,WAAW,QAAQ,KAAK,MAAM,MAAM,EAAE,OAAO,EAAE;AAClE,SAAM,KACJ,KAAK,MAAM,KAAK,KAAK,WAAW,OAAO,KAAK,eAAe,WAAW,CAAC,IACxE;;AAGH,QAAM,KAAK,GAAG;AACd,QAAM,KAAK,kBAAkB;AAC7B,QAAM,KAAK,GAAG;EAGd,MAAM,cAAc,MAAM,MAAM,GAAG,GAAG;AACtC,MAAI,YAAY,WAAW,EACzB,OAAM,KAAK,kBAAkB;OACxB;AACL,SAAM,KAAK,oCAAoC;AAC/C,SAAM,KAAK,oCAAoC;AAC/C,QAAK,MAAM,QAAQ,aAAa;IAC9B,MAAM,QAAQ,UAAU,MAAM,MAAM,EAAE,OAAO,KAAK,QAAQ;AAC1D,UAAM,KACJ,KAAK,KAAK,KAAK,KAAK,eAAe,KAAK,OAAO,KAAK,SAAS,CAAC,KAAK,OAAO,QAAQ,IAAI,KAAK,KAAK,OAAO,IACxG;;;AAIL,SAAO;GACL,UAAU;GACV,MAAM,MAAM,KAAK,KAAK;GACvB;;CAEJ"}
@@ -2,7 +2,6 @@ import { PresentationRenderer } from "@contractspec/lib.contracts";
2
2
  import * as React from "react";
3
3
 
4
4
  //#region src/ui/renderers/pipeline.renderer.d.ts
5
-
6
5
  declare const crmPipelineReactRenderer: PresentationRenderer<React.ReactElement>;
7
6
  //#endregion
8
7
  export { crmPipelineReactRenderer };
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline.renderer.d.ts","names":[],"sources":["../../../src/ui/renderers/pipeline.renderer.tsx"],"sourcesContent":[],"mappings":";;;;;cAmBa,0BAA0B,qBAAqB,KAAA,CAAM"}
1
+ {"version":3,"file":"pipeline.renderer.d.ts","names":[],"sources":["../../../src/ui/renderers/pipeline.renderer.tsx"],"mappings":";;;;cAmBa,wBAAA,EAA0B,oBAAA,CAAqB,KAAA,CAAM,YAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/example.crm-pipeline",
3
- "version": "1.56.0",
3
+ "version": "1.57.0",
4
4
  "description": "CRM Pipeline - Contacts, Companies, Deals, Tasks",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -66,24 +66,24 @@
66
66
  "validate": "contractspec validate \"src/**/*\""
67
67
  },
68
68
  "dependencies": {
69
- "@contractspec/lib.contracts": "1.56.0",
70
- "@contractspec/lib.design-system": "1.56.0",
71
- "@contractspec/lib.example-shared-ui": "1.10.0",
72
- "@contractspec/lib.identity-rbac": "1.56.0",
73
- "@contractspec/lib.runtime-sandbox": "0.11.0",
74
- "@contractspec/lib.schema": "1.56.0",
75
- "@contractspec/lib.ui-kit-web": "1.56.0",
76
- "@contractspec/module.audit-trail": "1.56.0",
77
- "@contractspec/module.notifications": "1.56.0",
69
+ "@contractspec/lib.contracts": "1.57.0",
70
+ "@contractspec/lib.design-system": "1.57.0",
71
+ "@contractspec/lib.example-shared-ui": "1.11.0",
72
+ "@contractspec/lib.identity-rbac": "1.57.0",
73
+ "@contractspec/lib.runtime-sandbox": "0.12.0",
74
+ "@contractspec/lib.schema": "1.57.0",
75
+ "@contractspec/lib.ui-kit-web": "1.57.0",
76
+ "@contractspec/module.audit-trail": "1.57.0",
77
+ "@contractspec/module.notifications": "1.57.0",
78
78
  "react": "19.2.4",
79
79
  "react-dom": "19.2.4"
80
80
  },
81
81
  "devDependencies": {
82
- "@contractspec/tool.tsdown": "1.56.0",
83
- "@contractspec/tool.typescript": "1.56.0",
84
- "tsdown": "^0.19.0",
82
+ "@contractspec/tool.tsdown": "1.57.0",
83
+ "@contractspec/tool.typescript": "1.57.0",
84
+ "tsdown": "^0.20.3",
85
85
  "typescript": "^5.9.3",
86
- "@types/react": "^19.2.8",
86
+ "@types/react": "^19.2.13",
87
87
  "@types/react-dom": "^19.2.2"
88
88
  },
89
89
  "publishConfig": {
@@ -7,7 +7,7 @@ import type { PresentationRenderer } from '@contractspec/lib.contracts';
7
7
  import {
8
8
  mockListDealsHandler,
9
9
  mockGetPipelineStagesHandler,
10
- } from '@contractspec/example.crm-pipeline/handlers';
10
+ } from '../../handlers';
11
11
 
12
12
  interface DealItem {
13
13
  id: string;