@contractspec/example.crm-pipeline 3.7.7 → 3.7.10

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 (53) hide show
  1. package/.turbo/turbo-build.log +45 -42
  2. package/CHANGELOG.md +36 -0
  3. package/README.md +2 -1
  4. package/dist/browser/docs/crm-pipeline.docblock.js +1 -1
  5. package/dist/browser/docs/index.js +1 -1
  6. package/dist/browser/handlers/crm.handlers.js +13 -2
  7. package/dist/browser/handlers/index.js +13 -2
  8. package/dist/browser/index.js +392 -159
  9. package/dist/browser/ui/CrmDashboard.js +366 -144
  10. package/dist/browser/ui/hooks/index.js +19 -8
  11. package/dist/browser/ui/hooks/useDealList.js +19 -8
  12. package/dist/browser/ui/index.js +391 -158
  13. package/dist/browser/ui/renderers/index.js +32 -10
  14. package/dist/browser/ui/renderers/pipeline.markdown.js +13 -2
  15. package/dist/browser/ui/renderers/pipeline.renderer.js +19 -8
  16. package/dist/browser/ui/tables/DealListTab.js +390 -0
  17. package/dist/docs/crm-pipeline.docblock.js +1 -1
  18. package/dist/docs/index.js +1 -1
  19. package/dist/handlers/crm.handlers.d.ts +2 -0
  20. package/dist/handlers/crm.handlers.js +13 -2
  21. package/dist/handlers/index.js +13 -2
  22. package/dist/index.js +392 -159
  23. package/dist/node/docs/crm-pipeline.docblock.js +1 -1
  24. package/dist/node/docs/index.js +1 -1
  25. package/dist/node/handlers/crm.handlers.js +13 -2
  26. package/dist/node/handlers/index.js +13 -2
  27. package/dist/node/index.js +392 -159
  28. package/dist/node/ui/CrmDashboard.js +366 -144
  29. package/dist/node/ui/hooks/index.js +19 -8
  30. package/dist/node/ui/hooks/useDealList.js +19 -8
  31. package/dist/node/ui/index.js +391 -158
  32. package/dist/node/ui/renderers/index.js +32 -10
  33. package/dist/node/ui/renderers/pipeline.markdown.js +13 -2
  34. package/dist/node/ui/renderers/pipeline.renderer.js +19 -8
  35. package/dist/node/ui/tables/DealListTab.js +390 -0
  36. package/dist/ui/CrmDashboard.js +366 -144
  37. package/dist/ui/hooks/index.js +19 -8
  38. package/dist/ui/hooks/useDealList.d.ts +8 -2
  39. package/dist/ui/hooks/useDealList.js +19 -8
  40. package/dist/ui/index.js +391 -158
  41. package/dist/ui/renderers/index.js +32 -10
  42. package/dist/ui/renderers/pipeline.markdown.js +13 -2
  43. package/dist/ui/renderers/pipeline.renderer.js +19 -8
  44. package/dist/ui/tables/DealListTab.d.ts +20 -0
  45. package/dist/ui/tables/DealListTab.js +391 -0
  46. package/dist/ui/tables/DealListTab.smoke.test.d.ts +1 -0
  47. package/package.json +27 -12
  48. package/src/docs/crm-pipeline.docblock.ts +1 -1
  49. package/src/handlers/crm.handlers.ts +18 -1
  50. package/src/ui/CrmDashboard.tsx +2 -71
  51. package/src/ui/hooks/useDealList.ts +36 -8
  52. package/src/ui/tables/DealListTab.smoke.test.tsx +149 -0
  53. package/src/ui/tables/DealListTab.tsx +276 -0
@@ -2,34 +2,35 @@ $ contractspec-bun-build prebuild
2
2
  $ bun run prebuild && bun run build:bundle && bun run build:types
3
3
  $ contractspec-bun-build prebuild
4
4
  $ contractspec-bun-build transpile
5
- [contractspec-bun-build] transpile target=bun root=src entries=44 noBundle=false
6
- Bundled 44 modules in 82ms
5
+ [contractspec-bun-build] transpile target=bun root=src entries=45 noBundle=false
6
+ Bundled 45 modules in 38ms
7
7
 
8
8
  ./crm-pipeline.feature.js 2.54 KB (entry point)
9
9
  seeders/index.js 1.00 KB (entry point)
10
10
  shared/overlay-types.js 8 bytes (entry point)
11
- ./index.js 116.70 KB (entry point)
12
- ui/index.js 74.42 KB (entry point)
11
+ ./index.js 122.92 KB (entry point)
12
+ ui/index.js 80.58 KB (entry point)
13
13
  ui/overlays/index.js 1.19 KB (entry point)
14
- ui/renderers/index.js 28.46 KB (entry point)
15
- ui/renderers/pipeline.markdown.js 17.75 KB (entry point)
16
- ui/renderers/pipeline.renderer.js 10.71 KB (entry point)
17
- ui/hooks/index.js 5.75 KB (entry point)
14
+ ui/renderers/index.js 29.47 KB (entry point)
15
+ ui/renderers/pipeline.markdown.js 18.13 KB (entry point)
16
+ ui/renderers/pipeline.renderer.js 11.35 KB (entry point)
17
+ ui/hooks/index.js 6.38 KB (entry point)
18
18
  ui/modals/index.js 27.54 KB (entry point)
19
19
  ui/overlays/demo-overlays.js 1.19 KB (entry point)
20
20
  presentations/index.js 9.78 KB (entry point)
21
21
  presentations/dashboard.presentation.js 1.55 KB (entry point)
22
22
  presentations/pipeline.presentation.js 8.20 KB (entry point)
23
- ui/CrmDashboard.js 54.57 KB (entry point)
24
- ui/hooks/useDealList.js 2.49 KB (entry point)
23
+ ui/CrmDashboard.js 60.35 KB (entry point)
24
+ ui/tables/DealListTab.js 12.29 KB (entry point)
25
+ ui/hooks/useDealList.js 3.12 KB (entry point)
25
26
  ui/hooks/useDealMutations.js 3.18 KB (entry point)
26
27
  ui/modals/CreateDealModal.js 8.89 KB (entry point)
27
28
  ui/modals/DealActionsModal.js 18.56 KB (entry point)
28
29
  ui/CrmPipelineBoard.js 7.49 KB (entry point)
29
30
  ui/CrmDealCard.js 2.29 KB (entry point)
30
31
  ./example.js 1.0 KB (entry point)
31
- handlers/index.js 13.62 KB (entry point)
32
- handlers/crm.handlers.js 5.81 KB (entry point)
32
+ handlers/index.js 14.00 KB (entry point)
33
+ handlers/crm.handlers.js 6.19 KB (entry point)
33
34
  handlers/deal.handlers.js 7.76 KB (entry point)
34
35
  handlers/mock-data.js 4.33 KB (entry point)
35
36
  operations/index.js 11.35 KB (entry point)
@@ -47,37 +48,38 @@ Bundled 44 modules in 82ms
47
48
  deal/deal.operation.js 11.11 KB (entry point)
48
49
  deal/deal.schema.js 5.41 KB (entry point)
49
50
  deal/deal.enum.js 333 bytes (entry point)
50
- docs/index.js 4.43 KB (entry point)
51
- docs/crm-pipeline.docblock.js 4.43 KB (entry point)
51
+ docs/index.js 4.48 KB (entry point)
52
+ docs/crm-pipeline.docblock.js 4.48 KB (entry point)
52
53
 
53
- [contractspec-bun-build] transpile target=node root=src entries=44 noBundle=false
54
- Bundled 44 modules in 96ms
54
+ [contractspec-bun-build] transpile target=node root=src entries=45 noBundle=false
55
+ Bundled 45 modules in 56ms
55
56
 
56
57
  ./crm-pipeline.feature.js 2.54 KB (entry point)
57
58
  seeders/index.js 0.99 KB (entry point)
58
59
  shared/overlay-types.js 0 KB (entry point)
59
- ./index.js 116.65 KB (entry point)
60
- ui/index.js 74.38 KB (entry point)
60
+ ./index.js 122.87 KB (entry point)
61
+ ui/index.js 80.54 KB (entry point)
61
62
  ui/overlays/index.js 1.19 KB (entry point)
62
- ui/renderers/index.js 28.44 KB (entry point)
63
- ui/renderers/pipeline.markdown.js 17.74 KB (entry point)
64
- ui/renderers/pipeline.renderer.js 10.70 KB (entry point)
65
- ui/hooks/index.js 5.74 KB (entry point)
63
+ ui/renderers/index.js 29.45 KB (entry point)
64
+ ui/renderers/pipeline.markdown.js 18.12 KB (entry point)
65
+ ui/renderers/pipeline.renderer.js 11.33 KB (entry point)
66
+ ui/hooks/index.js 6.38 KB (entry point)
66
67
  ui/modals/index.js 27.52 KB (entry point)
67
68
  ui/overlays/demo-overlays.js 1.19 KB (entry point)
68
69
  presentations/index.js 9.78 KB (entry point)
69
70
  presentations/dashboard.presentation.js 1.55 KB (entry point)
70
71
  presentations/pipeline.presentation.js 8.19 KB (entry point)
71
- ui/CrmDashboard.js 54.53 KB (entry point)
72
- ui/hooks/useDealList.js 2.48 KB (entry point)
72
+ ui/CrmDashboard.js 60.31 KB (entry point)
73
+ ui/tables/DealListTab.js 12.29 KB (entry point)
74
+ ui/hooks/useDealList.js 3.12 KB (entry point)
73
75
  ui/hooks/useDealMutations.js 3.17 KB (entry point)
74
76
  ui/modals/CreateDealModal.js 8.88 KB (entry point)
75
77
  ui/modals/DealActionsModal.js 18.54 KB (entry point)
76
78
  ui/CrmPipelineBoard.js 7.47 KB (entry point)
77
79
  ui/CrmDealCard.js 2.28 KB (entry point)
78
80
  ./example.js 1.0 KB (entry point)
79
- handlers/index.js 13.61 KB (entry point)
80
- handlers/crm.handlers.js 5.80 KB (entry point)
81
+ handlers/index.js 13.99 KB (entry point)
82
+ handlers/crm.handlers.js 6.18 KB (entry point)
81
83
  handlers/deal.handlers.js 7.75 KB (entry point)
82
84
  handlers/mock-data.js 4.32 KB (entry point)
83
85
  operations/index.js 11.34 KB (entry point)
@@ -95,37 +97,38 @@ Bundled 44 modules in 96ms
95
97
  deal/deal.operation.js 11.1 KB (entry point)
96
98
  deal/deal.schema.js 5.40 KB (entry point)
97
99
  deal/deal.enum.js 325 bytes (entry point)
98
- docs/index.js 4.41 KB (entry point)
99
- docs/crm-pipeline.docblock.js 4.41 KB (entry point)
100
+ docs/index.js 4.46 KB (entry point)
101
+ docs/crm-pipeline.docblock.js 4.46 KB (entry point)
100
102
 
101
- [contractspec-bun-build] transpile target=browser root=src entries=44 noBundle=false
102
- Bundled 44 modules in 91ms
103
+ [contractspec-bun-build] transpile target=browser root=src entries=45 noBundle=false
104
+ Bundled 45 modules in 69ms
103
105
 
104
106
  ./crm-pipeline.feature.js 2.54 KB (entry point)
105
107
  seeders/index.js 0.99 KB (entry point)
106
108
  shared/overlay-types.js 0 KB (entry point)
107
- ./index.js 116.65 KB (entry point)
108
- ui/index.js 74.38 KB (entry point)
109
+ ./index.js 122.87 KB (entry point)
110
+ ui/index.js 80.54 KB (entry point)
109
111
  ui/overlays/index.js 1.19 KB (entry point)
110
- ui/renderers/index.js 28.44 KB (entry point)
111
- ui/renderers/pipeline.markdown.js 17.74 KB (entry point)
112
- ui/renderers/pipeline.renderer.js 10.70 KB (entry point)
113
- ui/hooks/index.js 5.74 KB (entry point)
112
+ ui/renderers/index.js 29.45 KB (entry point)
113
+ ui/renderers/pipeline.markdown.js 18.12 KB (entry point)
114
+ ui/renderers/pipeline.renderer.js 11.33 KB (entry point)
115
+ ui/hooks/index.js 6.38 KB (entry point)
114
116
  ui/modals/index.js 27.52 KB (entry point)
115
117
  ui/overlays/demo-overlays.js 1.19 KB (entry point)
116
118
  presentations/index.js 9.78 KB (entry point)
117
119
  presentations/dashboard.presentation.js 1.55 KB (entry point)
118
120
  presentations/pipeline.presentation.js 8.19 KB (entry point)
119
- ui/CrmDashboard.js 54.53 KB (entry point)
120
- ui/hooks/useDealList.js 2.48 KB (entry point)
121
+ ui/CrmDashboard.js 60.31 KB (entry point)
122
+ ui/tables/DealListTab.js 12.29 KB (entry point)
123
+ ui/hooks/useDealList.js 3.12 KB (entry point)
121
124
  ui/hooks/useDealMutations.js 3.17 KB (entry point)
122
125
  ui/modals/CreateDealModal.js 8.88 KB (entry point)
123
126
  ui/modals/DealActionsModal.js 18.54 KB (entry point)
124
127
  ui/CrmPipelineBoard.js 7.47 KB (entry point)
125
128
  ui/CrmDealCard.js 2.28 KB (entry point)
126
129
  ./example.js 1.0 KB (entry point)
127
- handlers/index.js 13.61 KB (entry point)
128
- handlers/crm.handlers.js 5.80 KB (entry point)
130
+ handlers/index.js 13.99 KB (entry point)
131
+ handlers/crm.handlers.js 6.18 KB (entry point)
129
132
  handlers/deal.handlers.js 7.75 KB (entry point)
130
133
  handlers/mock-data.js 4.32 KB (entry point)
131
134
  operations/index.js 11.34 KB (entry point)
@@ -143,7 +146,7 @@ Bundled 44 modules in 91ms
143
146
  deal/deal.operation.js 11.1 KB (entry point)
144
147
  deal/deal.schema.js 5.40 KB (entry point)
145
148
  deal/deal.enum.js 325 bytes (entry point)
146
- docs/index.js 4.41 KB (entry point)
147
- docs/crm-pipeline.docblock.js 4.41 KB (entry point)
149
+ docs/index.js 4.46 KB (entry point)
150
+ docs/crm-pipeline.docblock.js 4.46 KB (entry point)
148
151
 
149
152
  $ contractspec-bun-build types
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @contractspec/example.crm-pipeline
2
2
 
3
+ ## 3.7.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 1a44cb6: feat: improve examples to increase coverage of Contracts type
8
+ - Updated dependencies [1a44cb6]
9
+ - @contractspec/lib.example-shared-ui@6.0.10
10
+ - @contractspec/module.notifications@3.7.10
11
+ - @contractspec/lib.runtime-sandbox@2.7.9
12
+ - @contractspec/lib.contracts-spec@4.1.2
13
+ - @contractspec/module.audit-trail@3.7.10
14
+ - @contractspec/lib.design-system@3.8.3
15
+ - @contractspec/lib.identity-rbac@3.7.10
16
+ - @contractspec/lib.ui-kit-web@3.9.2
17
+ - @contractspec/lib.schema@3.7.8
18
+
19
+ ## 3.7.9
20
+
21
+ ### Patch Changes
22
+
23
+ - fix: release
24
+ - Updated dependencies
25
+ - @contractspec/lib.example-shared-ui@6.0.9
26
+ - @contractspec/module.notifications@3.7.9
27
+ - @contractspec/lib.runtime-sandbox@2.7.8
28
+ - @contractspec/lib.contracts-spec@4.1.1
29
+ - @contractspec/module.audit-trail@3.7.9
30
+ - @contractspec/lib.design-system@3.8.2
31
+ - @contractspec/lib.identity-rbac@3.7.9
32
+ - @contractspec/lib.ui-kit-web@3.9.1
33
+ - @contractspec/lib.schema@3.7.7
34
+
3
35
  ## 3.7.6
4
36
 
5
37
  ### Patch Changes
@@ -622,6 +654,7 @@
622
654
  - 7f3203a: fix: make workspace test runs resilient when packages have no tests
623
655
 
624
656
  Updates package test scripts to pass cleanly when no matching test files exist:
657
+
625
658
  - Uses `bun test --pass-with-no-tests` in Bun-based packages that currently ship without test files.
626
659
  - Uses `jest --passWithNoTests` for the UI kit web package.
627
660
  - Adds `.vscode-test.mjs` for `vscode-contractspec` so VS Code extension test runs have an explicit config and stop failing on missing default configuration.
@@ -1122,14 +1155,17 @@
1122
1155
  feat: Contract layers support (features, examples, app-configs)
1123
1156
 
1124
1157
  ### New CLI Commands
1158
+
1125
1159
  - `contractspec list layers` - List all contract layers with filtering
1126
1160
 
1127
1161
  ### Enhanced Commands
1162
+
1128
1163
  - `contractspec ci` - New `layers` check category validates features/examples/config
1129
1164
  - `contractspec doctor` - New `layers` health checks
1130
1165
  - `contractspec integrity` - Now shows layer statistics
1131
1166
 
1132
1167
  ### New APIs
1168
+
1133
1169
  - `discoverLayers()` - Scan workspace for all layer files
1134
1170
  - `scanExampleSource()` - Parse ExampleSpec from source code
1135
1171
  - `isExampleFile()` - Check if file is an example spec
package/README.md CHANGED
@@ -10,7 +10,8 @@ Website: https://contractspec.io
10
10
  - Deal pipeline with stage enums, operations, and test-specs.
11
11
  - Event-driven architecture (contact, deal, task events).
12
12
  - Presentation layer with dashboard and pipeline views.
13
- - React UI with pipeline board, deal cards, hooks, modals, overlays, and renderers.
13
+ - React UI with pipeline board, hooks, modals, overlays, renderers, and a server-mode shared `DataTable` for deals.
14
+ - Shared table capabilities including sorting, pagination, multi-row selection, column visibility, pinning, resizing, and expandable deal details.
14
15
  - Feature definition and capability pattern.
15
16
  - Seeders and mock data.
16
17
 
@@ -81,7 +81,7 @@ var crmPipelineDocBlocks = [
81
81
  - deal.created, stage.moved, task.completed, contact.updated.
82
82
 
83
83
  ## Presentations
84
- - Pipelines/kanban, deal detail, contact/company profiles, task lists.
84
+ - Pipelines/kanban, deal detail, contact/company profiles, task lists, and a server-mode shared table for the deal list.
85
85
 
86
86
  ## Notes
87
87
  - Stage definitions should be declarative; enforce via spec and regeneration.
@@ -81,7 +81,7 @@ var crmPipelineDocBlocks = [
81
81
  - deal.created, stage.moved, task.completed, contact.updated.
82
82
 
83
83
  ## Presentations
84
- - Pipelines/kanban, deal detail, contact/company profiles, task lists.
84
+ - Pipelines/kanban, deal detail, contact/company profiles, task lists, and a server-mode shared table for the deal list.
85
85
 
86
86
  ## Notes
87
87
  - Stage definitions should be declarative; enforce via spec and regeneration.
@@ -22,6 +22,13 @@ function rowToDeal(row) {
22
22
  updatedAt: new Date(row.updatedAt)
23
23
  };
24
24
  }
25
+ var DEAL_SORT_COLUMNS = {
26
+ name: "name",
27
+ value: "value",
28
+ status: "status",
29
+ expectedCloseDate: "expectedCloseDate",
30
+ updatedAt: "updatedAt"
31
+ };
25
32
  function createCrmHandlers(db) {
26
33
  async function listDeals(input) {
27
34
  const {
@@ -32,7 +39,9 @@ function createCrmHandlers(db) {
32
39
  ownerId,
33
40
  search,
34
41
  limit = 20,
35
- offset = 0
42
+ offset = 0,
43
+ sortBy = "value",
44
+ sortDirection = "desc"
36
45
  } = input;
37
46
  let whereClause = "WHERE projectId = ?";
38
47
  const params = [projectId];
@@ -60,7 +69,9 @@ function createCrmHandlers(db) {
60
69
  const total = countResult[0]?.count ?? 0;
61
70
  const valueResult = (await db.query(`SELECT COALESCE(SUM(value), 0) as total FROM crm_deal ${whereClause}`, params)).rows;
62
71
  const totalValue = valueResult[0]?.total ?? 0;
63
- const dealRows = (await db.query(`SELECT * FROM crm_deal ${whereClause} ORDER BY value DESC LIMIT ? OFFSET ?`, [...params, limit, offset])).rows;
72
+ const orderByColumn = DEAL_SORT_COLUMNS[sortBy] ?? DEAL_SORT_COLUMNS.value;
73
+ const orderByDirection = sortDirection === "asc" ? "ASC" : "DESC";
74
+ const dealRows = (await db.query(`SELECT * FROM crm_deal ${whereClause} ORDER BY ${orderByColumn} ${orderByDirection} LIMIT ? OFFSET ?`, [...params, limit, offset])).rows;
64
75
  return {
65
76
  deals: dealRows.map(rowToDeal),
66
77
  total,
@@ -22,6 +22,13 @@ function rowToDeal(row) {
22
22
  updatedAt: new Date(row.updatedAt)
23
23
  };
24
24
  }
25
+ var DEAL_SORT_COLUMNS = {
26
+ name: "name",
27
+ value: "value",
28
+ status: "status",
29
+ expectedCloseDate: "expectedCloseDate",
30
+ updatedAt: "updatedAt"
31
+ };
25
32
  function createCrmHandlers(db) {
26
33
  async function listDeals(input) {
27
34
  const {
@@ -32,7 +39,9 @@ function createCrmHandlers(db) {
32
39
  ownerId,
33
40
  search,
34
41
  limit = 20,
35
- offset = 0
42
+ offset = 0,
43
+ sortBy = "value",
44
+ sortDirection = "desc"
36
45
  } = input;
37
46
  let whereClause = "WHERE projectId = ?";
38
47
  const params = [projectId];
@@ -60,7 +69,9 @@ function createCrmHandlers(db) {
60
69
  const total = countResult[0]?.count ?? 0;
61
70
  const valueResult = (await db.query(`SELECT COALESCE(SUM(value), 0) as total FROM crm_deal ${whereClause}`, params)).rows;
62
71
  const totalValue = valueResult[0]?.total ?? 0;
63
- const dealRows = (await db.query(`SELECT * FROM crm_deal ${whereClause} ORDER BY value DESC LIMIT ? OFFSET ?`, [...params, limit, offset])).rows;
72
+ const orderByColumn = DEAL_SORT_COLUMNS[sortBy] ?? DEAL_SORT_COLUMNS.value;
73
+ const orderByDirection = sortDirection === "asc" ? "ASC" : "DESC";
74
+ const dealRows = (await db.query(`SELECT * FROM crm_deal ${whereClause} ORDER BY ${orderByColumn} ${orderByDirection} LIMIT ? OFFSET ?`, [...params, limit, offset])).rows;
64
75
  return {
65
76
  deals: dealRows.map(rowToDeal),
66
77
  total,