@contractspec/example.marketplace 3.7.7 → 3.8.4

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 (39) hide show
  1. package/README.md +1 -0
  2. package/dist/browser/index.js +316 -79
  3. package/dist/browser/marketplace.feature.js +175 -0
  4. package/dist/browser/ui/MarketplaceDashboard.js +293 -75
  5. package/dist/browser/ui/MarketplaceDashboard.visualizations.js +216 -0
  6. package/dist/browser/ui/index.js +309 -79
  7. package/dist/browser/ui/renderers/index.js +190 -4
  8. package/dist/browser/ui/renderers/marketplace.markdown.js +190 -4
  9. package/dist/browser/visualizations/catalog.js +126 -0
  10. package/dist/browser/visualizations/index.js +183 -0
  11. package/dist/browser/visualizations/selectors.js +177 -0
  12. package/dist/index.d.ts +1 -0
  13. package/dist/index.js +316 -79
  14. package/dist/marketplace.feature.js +175 -0
  15. package/dist/node/index.js +316 -79
  16. package/dist/node/marketplace.feature.js +175 -0
  17. package/dist/node/ui/MarketplaceDashboard.js +293 -75
  18. package/dist/node/ui/MarketplaceDashboard.visualizations.js +216 -0
  19. package/dist/node/ui/index.js +309 -79
  20. package/dist/node/ui/renderers/index.js +190 -4
  21. package/dist/node/ui/renderers/marketplace.markdown.js +190 -4
  22. package/dist/node/visualizations/catalog.js +126 -0
  23. package/dist/node/visualizations/index.js +183 -0
  24. package/dist/node/visualizations/selectors.js +177 -0
  25. package/dist/ui/MarketplaceDashboard.js +293 -75
  26. package/dist/ui/MarketplaceDashboard.visualizations.d.ts +5 -0
  27. package/dist/ui/MarketplaceDashboard.visualizations.js +217 -0
  28. package/dist/ui/index.js +309 -79
  29. package/dist/ui/renderers/index.js +190 -4
  30. package/dist/ui/renderers/marketplace.markdown.d.ts +1 -1
  31. package/dist/ui/renderers/marketplace.markdown.js +190 -4
  32. package/dist/visualizations/catalog.d.ts +10 -0
  33. package/dist/visualizations/catalog.js +127 -0
  34. package/dist/visualizations/index.d.ts +2 -0
  35. package/dist/visualizations/index.js +184 -0
  36. package/dist/visualizations/selectors.d.ts +11 -0
  37. package/dist/visualizations/selectors.js +178 -0
  38. package/dist/visualizations/selectors.test.d.ts +1 -0
  39. package/package.json +66 -9
package/dist/index.js CHANGED
@@ -1359,6 +1359,220 @@ function useMarketplaceData(projectId = "local-project") {
1359
1359
  // src/ui/hooks/index.ts
1360
1360
  "use client";
1361
1361
 
1362
+ // src/visualizations/catalog.ts
1363
+ import {
1364
+ defineVisualization,
1365
+ VisualizationRegistry
1366
+ } from "@contractspec/lib.contracts-spec/visualizations";
1367
+ var ORDER_LIST_REF = {
1368
+ key: "marketplace.order.list",
1369
+ version: "1.0.0"
1370
+ };
1371
+ var PRODUCT_LIST_REF = {
1372
+ key: "marketplace.product.list",
1373
+ version: "1.0.0"
1374
+ };
1375
+ var META = {
1376
+ version: "1.0.0",
1377
+ domain: "marketplace",
1378
+ stability: "experimental",
1379
+ owners: ["@example.marketplace"],
1380
+ tags: ["marketplace", "visualization", "commerce"]
1381
+ };
1382
+ var MarketplaceOrderStatusVisualization = defineVisualization({
1383
+ meta: {
1384
+ ...META,
1385
+ key: "marketplace.visualization.order-status",
1386
+ title: "Order Status Breakdown",
1387
+ description: "Distribution of current order states.",
1388
+ goal: "Expose delivery and backlog mix at a glance.",
1389
+ context: "Marketplace operations overview."
1390
+ },
1391
+ source: { primary: ORDER_LIST_REF, resultPath: "data" },
1392
+ visualization: {
1393
+ kind: "pie",
1394
+ nameDimension: "status",
1395
+ valueMeasure: "orders",
1396
+ dimensions: [
1397
+ { key: "status", label: "Status", dataPath: "status", type: "category" }
1398
+ ],
1399
+ measures: [
1400
+ { key: "orders", label: "Orders", dataPath: "orders", format: "number" }
1401
+ ],
1402
+ table: { caption: "Order counts by status." }
1403
+ }
1404
+ });
1405
+ var MarketplaceCategoryValueVisualization = defineVisualization({
1406
+ meta: {
1407
+ ...META,
1408
+ key: "marketplace.visualization.category-value",
1409
+ title: "Category Value Comparison",
1410
+ description: "Catalog value by product category derived from current pricing and stock.",
1411
+ goal: "Compare where the marketplace catalog is concentrated.",
1412
+ context: "Merchandising overview."
1413
+ },
1414
+ source: { primary: PRODUCT_LIST_REF, resultPath: "data" },
1415
+ visualization: {
1416
+ kind: "cartesian",
1417
+ variant: "bar",
1418
+ xDimension: "category",
1419
+ yMeasures: ["catalogValue"],
1420
+ dimensions: [
1421
+ {
1422
+ key: "category",
1423
+ label: "Category",
1424
+ dataPath: "category",
1425
+ type: "category"
1426
+ }
1427
+ ],
1428
+ measures: [
1429
+ {
1430
+ key: "catalogValue",
1431
+ label: "Catalog Value",
1432
+ dataPath: "catalogValue",
1433
+ format: "currency",
1434
+ color: "#1d4ed8"
1435
+ }
1436
+ ],
1437
+ table: { caption: "Catalog value by product category." }
1438
+ }
1439
+ });
1440
+ var MarketplaceOrderActivityVisualization = defineVisualization({
1441
+ meta: {
1442
+ ...META,
1443
+ key: "marketplace.visualization.order-activity",
1444
+ title: "Recent Order Activity",
1445
+ description: "Daily order volume from recent order creation timestamps.",
1446
+ goal: "Show recent order activity trends.",
1447
+ context: "Commerce operations trend monitoring."
1448
+ },
1449
+ source: { primary: ORDER_LIST_REF, resultPath: "data" },
1450
+ visualization: {
1451
+ kind: "cartesian",
1452
+ variant: "line",
1453
+ xDimension: "day",
1454
+ yMeasures: ["orders"],
1455
+ dimensions: [{ key: "day", label: "Day", dataPath: "day", type: "time" }],
1456
+ measures: [
1457
+ {
1458
+ key: "orders",
1459
+ label: "Orders",
1460
+ dataPath: "orders",
1461
+ format: "number",
1462
+ color: "#0f766e"
1463
+ }
1464
+ ],
1465
+ table: { caption: "Daily order counts." }
1466
+ }
1467
+ });
1468
+ var MarketplaceVisualizationSpecs = [
1469
+ MarketplaceOrderStatusVisualization,
1470
+ MarketplaceCategoryValueVisualization,
1471
+ MarketplaceOrderActivityVisualization
1472
+ ];
1473
+ var MarketplaceVisualizationRegistry = new VisualizationRegistry([
1474
+ ...MarketplaceVisualizationSpecs
1475
+ ]);
1476
+ var MarketplaceVisualizationRefs = MarketplaceVisualizationSpecs.map((spec) => ({
1477
+ key: spec.meta.key,
1478
+ version: spec.meta.version
1479
+ }));
1480
+
1481
+ // src/visualizations/selectors.ts
1482
+ function toDayKey(value) {
1483
+ const date = value instanceof Date ? value : new Date(value);
1484
+ return date.toISOString().slice(0, 10);
1485
+ }
1486
+ function createMarketplaceVisualizationItems(products, orders) {
1487
+ const orderStatus = new Map;
1488
+ const orderActivity = new Map;
1489
+ const categoryValue = new Map;
1490
+ for (const order of orders) {
1491
+ orderStatus.set(order.status, (orderStatus.get(order.status) ?? 0) + 1);
1492
+ const day = toDayKey(order.createdAt);
1493
+ orderActivity.set(day, (orderActivity.get(day) ?? 0) + 1);
1494
+ }
1495
+ for (const product of products) {
1496
+ const category = product.category ?? "Uncategorized";
1497
+ categoryValue.set(category, (categoryValue.get(category) ?? 0) + product.price * product.stock);
1498
+ }
1499
+ return [
1500
+ {
1501
+ key: "marketplace-order-status",
1502
+ spec: MarketplaceOrderStatusVisualization,
1503
+ data: {
1504
+ data: Array.from(orderStatus.entries()).map(([status, count]) => ({
1505
+ status,
1506
+ orders: count
1507
+ }))
1508
+ },
1509
+ title: "Order Status Breakdown",
1510
+ description: "Status mix across the current order set.",
1511
+ height: 260
1512
+ },
1513
+ {
1514
+ key: "marketplace-category-value",
1515
+ spec: MarketplaceCategoryValueVisualization,
1516
+ data: {
1517
+ data: Array.from(categoryValue.entries()).sort(([, left], [, right]) => right - left).map(([category, value]) => ({
1518
+ category,
1519
+ catalogValue: value
1520
+ }))
1521
+ },
1522
+ title: "Category Value Comparison",
1523
+ description: "Derived from current product pricing and stock."
1524
+ },
1525
+ {
1526
+ key: "marketplace-order-activity",
1527
+ spec: MarketplaceOrderActivityVisualization,
1528
+ data: {
1529
+ data: Array.from(orderActivity.entries()).sort(([left], [right]) => left.localeCompare(right)).map(([day, count]) => ({ day, orders: count }))
1530
+ },
1531
+ title: "Recent Order Activity",
1532
+ description: "Daily order count from current order history."
1533
+ }
1534
+ ];
1535
+ }
1536
+ // src/ui/MarketplaceDashboard.visualizations.tsx
1537
+ import {
1538
+ VisualizationCard,
1539
+ VisualizationGrid
1540
+ } from "@contractspec/lib.design-system";
1541
+ import { jsxDEV } from "react/jsx-dev-runtime";
1542
+ "use client";
1543
+ function MarketplaceVisualizationOverview({
1544
+ products,
1545
+ orders
1546
+ }) {
1547
+ const items = createMarketplaceVisualizationItems(products, orders);
1548
+ return /* @__PURE__ */ jsxDEV("section", {
1549
+ className: "space-y-3",
1550
+ children: [
1551
+ /* @__PURE__ */ jsxDEV("div", {
1552
+ children: [
1553
+ /* @__PURE__ */ jsxDEV("h3", {
1554
+ className: "font-semibold text-lg",
1555
+ children: "Commerce Visualizations"
1556
+ }, undefined, false, undefined, this),
1557
+ /* @__PURE__ */ jsxDEV("p", {
1558
+ className: "text-muted-foreground text-sm",
1559
+ children: "Order and catalog trends exposed through shared visualization contracts."
1560
+ }, undefined, false, undefined, this)
1561
+ ]
1562
+ }, undefined, true, undefined, this),
1563
+ /* @__PURE__ */ jsxDEV(VisualizationGrid, {
1564
+ children: items.map((item) => /* @__PURE__ */ jsxDEV(VisualizationCard, {
1565
+ data: item.data,
1566
+ description: item.description,
1567
+ height: item.height,
1568
+ spec: item.spec,
1569
+ title: item.title
1570
+ }, item.key, false, undefined, this))
1571
+ }, undefined, false, undefined, this)
1572
+ ]
1573
+ }, undefined, true, undefined, this);
1574
+ }
1575
+
1362
1576
  // src/ui/MarketplaceDashboard.tsx
1363
1577
  import {
1364
1578
  Button,
@@ -1368,7 +1582,7 @@ import {
1368
1582
  StatCardGroup
1369
1583
  } from "@contractspec/lib.design-system";
1370
1584
  import { useState as useState2 } from "react";
1371
- import { jsxDEV } from "react/jsx-dev-runtime";
1585
+ import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
1372
1586
  "use client";
1373
1587
  var STATUS_COLORS = {
1374
1588
  ACTIVE: "bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",
@@ -1400,32 +1614,32 @@ function MarketplaceDashboard() {
1400
1614
  { id: "orders", label: "Orders", icon: "\uD83D\uDED2" }
1401
1615
  ];
1402
1616
  if (loading) {
1403
- return /* @__PURE__ */ jsxDEV(LoaderBlock, {
1617
+ return /* @__PURE__ */ jsxDEV2(LoaderBlock, {
1404
1618
  label: "Loading Marketplace..."
1405
1619
  }, undefined, false, undefined, this);
1406
1620
  }
1407
1621
  if (error) {
1408
- return /* @__PURE__ */ jsxDEV(ErrorState, {
1622
+ return /* @__PURE__ */ jsxDEV2(ErrorState, {
1409
1623
  title: "Failed to load Marketplace",
1410
1624
  description: error.message,
1411
1625
  onRetry: refetch,
1412
1626
  retryLabel: "Retry"
1413
1627
  }, undefined, false, undefined, this);
1414
1628
  }
1415
- return /* @__PURE__ */ jsxDEV("div", {
1629
+ return /* @__PURE__ */ jsxDEV2("div", {
1416
1630
  className: "space-y-6",
1417
1631
  children: [
1418
- /* @__PURE__ */ jsxDEV("div", {
1632
+ /* @__PURE__ */ jsxDEV2("div", {
1419
1633
  className: "flex items-center justify-between",
1420
1634
  children: [
1421
- /* @__PURE__ */ jsxDEV("h2", {
1635
+ /* @__PURE__ */ jsxDEV2("h2", {
1422
1636
  className: "font-bold text-2xl",
1423
1637
  children: "Marketplace"
1424
1638
  }, undefined, false, undefined, this),
1425
- /* @__PURE__ */ jsxDEV(Button, {
1639
+ /* @__PURE__ */ jsxDEV2(Button, {
1426
1640
  onClick: () => alert("Create store modal"),
1427
1641
  children: [
1428
- /* @__PURE__ */ jsxDEV("span", {
1642
+ /* @__PURE__ */ jsxDEV2("span", {
1429
1643
  className: "mr-2",
1430
1644
  children: "+"
1431
1645
  }, undefined, false, undefined, this),
@@ -1434,108 +1648,112 @@ function MarketplaceDashboard() {
1434
1648
  }, undefined, true, undefined, this)
1435
1649
  ]
1436
1650
  }, undefined, true, undefined, this),
1437
- /* @__PURE__ */ jsxDEV(StatCardGroup, {
1651
+ /* @__PURE__ */ jsxDEV2(StatCardGroup, {
1438
1652
  children: [
1439
- /* @__PURE__ */ jsxDEV(StatCard, {
1653
+ /* @__PURE__ */ jsxDEV2(StatCard, {
1440
1654
  label: "Stores",
1441
1655
  value: stats.totalStores,
1442
1656
  hint: `${stats.activeStores} active`
1443
1657
  }, undefined, false, undefined, this),
1444
- /* @__PURE__ */ jsxDEV(StatCard, {
1658
+ /* @__PURE__ */ jsxDEV2(StatCard, {
1445
1659
  label: "Products",
1446
1660
  value: stats.totalProducts,
1447
1661
  hint: "listed"
1448
1662
  }, undefined, false, undefined, this),
1449
- /* @__PURE__ */ jsxDEV(StatCard, {
1663
+ /* @__PURE__ */ jsxDEV2(StatCard, {
1450
1664
  label: "Orders",
1451
1665
  value: stats.totalOrders,
1452
1666
  hint: `${stats.pendingOrders} pending`
1453
1667
  }, undefined, false, undefined, this),
1454
- /* @__PURE__ */ jsxDEV(StatCard, {
1668
+ /* @__PURE__ */ jsxDEV2(StatCard, {
1455
1669
  label: "Revenue",
1456
1670
  value: formatCurrency(stats.totalRevenue),
1457
1671
  hint: "total"
1458
1672
  }, undefined, false, undefined, this)
1459
1673
  ]
1460
1674
  }, undefined, true, undefined, this),
1461
- /* @__PURE__ */ jsxDEV("nav", {
1675
+ /* @__PURE__ */ jsxDEV2(MarketplaceVisualizationOverview, {
1676
+ orders,
1677
+ products
1678
+ }, undefined, false, undefined, this),
1679
+ /* @__PURE__ */ jsxDEV2("nav", {
1462
1680
  className: "flex gap-1 rounded-lg bg-muted p-1",
1463
1681
  role: "tablist",
1464
- children: tabs.map((tab) => /* @__PURE__ */ jsxDEV(Button, {
1682
+ children: tabs.map((tab) => /* @__PURE__ */ jsxDEV2(Button, {
1465
1683
  type: "button",
1466
1684
  role: "tab",
1467
1685
  "aria-selected": activeTab === tab.id,
1468
1686
  onClick: () => setActiveTab(tab.id),
1469
1687
  className: `flex flex-1 items-center justify-center gap-2 rounded-md px-4 py-2 font-medium text-sm transition-colors ${activeTab === tab.id ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
1470
1688
  children: [
1471
- /* @__PURE__ */ jsxDEV("span", {
1689
+ /* @__PURE__ */ jsxDEV2("span", {
1472
1690
  children: tab.icon
1473
1691
  }, undefined, false, undefined, this),
1474
1692
  tab.label
1475
1693
  ]
1476
1694
  }, tab.id, true, undefined, this))
1477
1695
  }, undefined, false, undefined, this),
1478
- /* @__PURE__ */ jsxDEV("div", {
1696
+ /* @__PURE__ */ jsxDEV2("div", {
1479
1697
  className: "min-h-[400px]",
1480
1698
  role: "tabpanel",
1481
1699
  children: [
1482
- activeTab === "stores" && /* @__PURE__ */ jsxDEV("div", {
1700
+ activeTab === "stores" && /* @__PURE__ */ jsxDEV2("div", {
1483
1701
  className: "rounded-lg border border-border",
1484
- children: /* @__PURE__ */ jsxDEV("table", {
1702
+ children: /* @__PURE__ */ jsxDEV2("table", {
1485
1703
  className: "w-full",
1486
1704
  children: [
1487
- /* @__PURE__ */ jsxDEV("thead", {
1705
+ /* @__PURE__ */ jsxDEV2("thead", {
1488
1706
  className: "border-border border-b bg-muted/30",
1489
- children: /* @__PURE__ */ jsxDEV("tr", {
1707
+ children: /* @__PURE__ */ jsxDEV2("tr", {
1490
1708
  children: [
1491
- /* @__PURE__ */ jsxDEV("th", {
1709
+ /* @__PURE__ */ jsxDEV2("th", {
1492
1710
  className: "px-4 py-3 text-left font-medium text-sm",
1493
1711
  children: "Store"
1494
1712
  }, undefined, false, undefined, this),
1495
- /* @__PURE__ */ jsxDEV("th", {
1713
+ /* @__PURE__ */ jsxDEV2("th", {
1496
1714
  className: "px-4 py-3 text-left font-medium text-sm",
1497
1715
  children: "Status"
1498
1716
  }, undefined, false, undefined, this),
1499
- /* @__PURE__ */ jsxDEV("th", {
1717
+ /* @__PURE__ */ jsxDEV2("th", {
1500
1718
  className: "px-4 py-3 text-left font-medium text-sm",
1501
1719
  children: "Rating"
1502
1720
  }, undefined, false, undefined, this),
1503
- /* @__PURE__ */ jsxDEV("th", {
1721
+ /* @__PURE__ */ jsxDEV2("th", {
1504
1722
  className: "px-4 py-3 text-left font-medium text-sm",
1505
1723
  children: "Reviews"
1506
1724
  }, undefined, false, undefined, this)
1507
1725
  ]
1508
1726
  }, undefined, true, undefined, this)
1509
1727
  }, undefined, false, undefined, this),
1510
- /* @__PURE__ */ jsxDEV("tbody", {
1728
+ /* @__PURE__ */ jsxDEV2("tbody", {
1511
1729
  className: "divide-y divide-border",
1512
1730
  children: [
1513
- stores.map((store) => /* @__PURE__ */ jsxDEV("tr", {
1731
+ stores.map((store) => /* @__PURE__ */ jsxDEV2("tr", {
1514
1732
  className: "hover:bg-muted/50",
1515
1733
  children: [
1516
- /* @__PURE__ */ jsxDEV("td", {
1734
+ /* @__PURE__ */ jsxDEV2("td", {
1517
1735
  className: "px-4 py-3",
1518
1736
  children: [
1519
- /* @__PURE__ */ jsxDEV("div", {
1737
+ /* @__PURE__ */ jsxDEV2("div", {
1520
1738
  className: "font-medium",
1521
1739
  children: store.name
1522
1740
  }, undefined, false, undefined, this),
1523
- /* @__PURE__ */ jsxDEV("div", {
1741
+ /* @__PURE__ */ jsxDEV2("div", {
1524
1742
  className: "text-muted-foreground text-sm",
1525
1743
  children: store.description
1526
1744
  }, undefined, false, undefined, this)
1527
1745
  ]
1528
1746
  }, undefined, true, undefined, this),
1529
- /* @__PURE__ */ jsxDEV("td", {
1747
+ /* @__PURE__ */ jsxDEV2("td", {
1530
1748
  className: "px-4 py-3",
1531
- children: /* @__PURE__ */ jsxDEV("span", {
1749
+ children: /* @__PURE__ */ jsxDEV2("span", {
1532
1750
  className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[store.status] ?? ""}`,
1533
1751
  children: store.status
1534
1752
  }, undefined, false, undefined, this)
1535
1753
  }, undefined, false, undefined, this),
1536
- /* @__PURE__ */ jsxDEV("td", {
1754
+ /* @__PURE__ */ jsxDEV2("td", {
1537
1755
  className: "px-4 py-3",
1538
- children: /* @__PURE__ */ jsxDEV("span", {
1756
+ children: /* @__PURE__ */ jsxDEV2("span", {
1539
1757
  className: "flex items-center gap-1",
1540
1758
  children: [
1541
1759
  "\u2B50 ",
@@ -1543,7 +1761,7 @@ function MarketplaceDashboard() {
1543
1761
  ]
1544
1762
  }, undefined, true, undefined, this)
1545
1763
  }, undefined, false, undefined, this),
1546
- /* @__PURE__ */ jsxDEV("td", {
1764
+ /* @__PURE__ */ jsxDEV2("td", {
1547
1765
  className: "px-4 py-3 text-muted-foreground text-sm",
1548
1766
  children: [
1549
1767
  store.reviewCount,
@@ -1552,8 +1770,8 @@ function MarketplaceDashboard() {
1552
1770
  }, undefined, true, undefined, this)
1553
1771
  ]
1554
1772
  }, store.id, true, undefined, this)),
1555
- stores.length === 0 && /* @__PURE__ */ jsxDEV("tr", {
1556
- children: /* @__PURE__ */ jsxDEV("td", {
1773
+ stores.length === 0 && /* @__PURE__ */ jsxDEV2("tr", {
1774
+ children: /* @__PURE__ */ jsxDEV2("td", {
1557
1775
  colSpan: 4,
1558
1776
  className: "px-4 py-8 text-center text-muted-foreground",
1559
1777
  children: "No stores found"
@@ -1564,72 +1782,72 @@ function MarketplaceDashboard() {
1564
1782
  ]
1565
1783
  }, undefined, true, undefined, this)
1566
1784
  }, undefined, false, undefined, this),
1567
- activeTab === "products" && /* @__PURE__ */ jsxDEV("div", {
1785
+ activeTab === "products" && /* @__PURE__ */ jsxDEV2("div", {
1568
1786
  className: "rounded-lg border border-border",
1569
- children: /* @__PURE__ */ jsxDEV("table", {
1787
+ children: /* @__PURE__ */ jsxDEV2("table", {
1570
1788
  className: "w-full",
1571
1789
  children: [
1572
- /* @__PURE__ */ jsxDEV("thead", {
1790
+ /* @__PURE__ */ jsxDEV2("thead", {
1573
1791
  className: "border-border border-b bg-muted/30",
1574
- children: /* @__PURE__ */ jsxDEV("tr", {
1792
+ children: /* @__PURE__ */ jsxDEV2("tr", {
1575
1793
  children: [
1576
- /* @__PURE__ */ jsxDEV("th", {
1794
+ /* @__PURE__ */ jsxDEV2("th", {
1577
1795
  className: "px-4 py-3 text-left font-medium text-sm",
1578
1796
  children: "Product"
1579
1797
  }, undefined, false, undefined, this),
1580
- /* @__PURE__ */ jsxDEV("th", {
1798
+ /* @__PURE__ */ jsxDEV2("th", {
1581
1799
  className: "px-4 py-3 text-left font-medium text-sm",
1582
1800
  children: "Price"
1583
1801
  }, undefined, false, undefined, this),
1584
- /* @__PURE__ */ jsxDEV("th", {
1802
+ /* @__PURE__ */ jsxDEV2("th", {
1585
1803
  className: "px-4 py-3 text-left font-medium text-sm",
1586
1804
  children: "Stock"
1587
1805
  }, undefined, false, undefined, this),
1588
- /* @__PURE__ */ jsxDEV("th", {
1806
+ /* @__PURE__ */ jsxDEV2("th", {
1589
1807
  className: "px-4 py-3 text-left font-medium text-sm",
1590
1808
  children: "Status"
1591
1809
  }, undefined, false, undefined, this)
1592
1810
  ]
1593
1811
  }, undefined, true, undefined, this)
1594
1812
  }, undefined, false, undefined, this),
1595
- /* @__PURE__ */ jsxDEV("tbody", {
1813
+ /* @__PURE__ */ jsxDEV2("tbody", {
1596
1814
  className: "divide-y divide-border",
1597
1815
  children: [
1598
- products.map((product) => /* @__PURE__ */ jsxDEV("tr", {
1816
+ products.map((product) => /* @__PURE__ */ jsxDEV2("tr", {
1599
1817
  className: "hover:bg-muted/50",
1600
1818
  children: [
1601
- /* @__PURE__ */ jsxDEV("td", {
1819
+ /* @__PURE__ */ jsxDEV2("td", {
1602
1820
  className: "px-4 py-3",
1603
1821
  children: [
1604
- /* @__PURE__ */ jsxDEV("div", {
1822
+ /* @__PURE__ */ jsxDEV2("div", {
1605
1823
  className: "font-medium",
1606
1824
  children: product.name
1607
1825
  }, undefined, false, undefined, this),
1608
- /* @__PURE__ */ jsxDEV("div", {
1826
+ /* @__PURE__ */ jsxDEV2("div", {
1609
1827
  className: "text-muted-foreground text-sm",
1610
1828
  children: product.category
1611
1829
  }, undefined, false, undefined, this)
1612
1830
  ]
1613
1831
  }, undefined, true, undefined, this),
1614
- /* @__PURE__ */ jsxDEV("td", {
1832
+ /* @__PURE__ */ jsxDEV2("td", {
1615
1833
  className: "px-4 py-3 font-mono",
1616
1834
  children: formatCurrency(product.price, product.currency)
1617
1835
  }, undefined, false, undefined, this),
1618
- /* @__PURE__ */ jsxDEV("td", {
1836
+ /* @__PURE__ */ jsxDEV2("td", {
1619
1837
  className: "px-4 py-3",
1620
1838
  children: product.stock
1621
1839
  }, undefined, false, undefined, this),
1622
- /* @__PURE__ */ jsxDEV("td", {
1840
+ /* @__PURE__ */ jsxDEV2("td", {
1623
1841
  className: "px-4 py-3",
1624
- children: /* @__PURE__ */ jsxDEV("span", {
1842
+ children: /* @__PURE__ */ jsxDEV2("span", {
1625
1843
  className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[product.status] ?? ""}`,
1626
1844
  children: product.status
1627
1845
  }, undefined, false, undefined, this)
1628
1846
  }, undefined, false, undefined, this)
1629
1847
  ]
1630
1848
  }, product.id, true, undefined, this)),
1631
- products.length === 0 && /* @__PURE__ */ jsxDEV("tr", {
1632
- children: /* @__PURE__ */ jsxDEV("td", {
1849
+ products.length === 0 && /* @__PURE__ */ jsxDEV2("tr", {
1850
+ children: /* @__PURE__ */ jsxDEV2("td", {
1633
1851
  colSpan: 4,
1634
1852
  className: "px-4 py-8 text-center text-muted-foreground",
1635
1853
  children: "No products found"
@@ -1640,71 +1858,71 @@ function MarketplaceDashboard() {
1640
1858
  ]
1641
1859
  }, undefined, true, undefined, this)
1642
1860
  }, undefined, false, undefined, this),
1643
- activeTab === "orders" && /* @__PURE__ */ jsxDEV("div", {
1861
+ activeTab === "orders" && /* @__PURE__ */ jsxDEV2("div", {
1644
1862
  className: "rounded-lg border border-border",
1645
- children: /* @__PURE__ */ jsxDEV("table", {
1863
+ children: /* @__PURE__ */ jsxDEV2("table", {
1646
1864
  className: "w-full",
1647
1865
  children: [
1648
- /* @__PURE__ */ jsxDEV("thead", {
1866
+ /* @__PURE__ */ jsxDEV2("thead", {
1649
1867
  className: "border-border border-b bg-muted/30",
1650
- children: /* @__PURE__ */ jsxDEV("tr", {
1868
+ children: /* @__PURE__ */ jsxDEV2("tr", {
1651
1869
  children: [
1652
- /* @__PURE__ */ jsxDEV("th", {
1870
+ /* @__PURE__ */ jsxDEV2("th", {
1653
1871
  className: "px-4 py-3 text-left font-medium text-sm",
1654
1872
  children: "Order ID"
1655
1873
  }, undefined, false, undefined, this),
1656
- /* @__PURE__ */ jsxDEV("th", {
1874
+ /* @__PURE__ */ jsxDEV2("th", {
1657
1875
  className: "px-4 py-3 text-left font-medium text-sm",
1658
1876
  children: "Customer"
1659
1877
  }, undefined, false, undefined, this),
1660
- /* @__PURE__ */ jsxDEV("th", {
1878
+ /* @__PURE__ */ jsxDEV2("th", {
1661
1879
  className: "px-4 py-3 text-left font-medium text-sm",
1662
1880
  children: "Total"
1663
1881
  }, undefined, false, undefined, this),
1664
- /* @__PURE__ */ jsxDEV("th", {
1882
+ /* @__PURE__ */ jsxDEV2("th", {
1665
1883
  className: "px-4 py-3 text-left font-medium text-sm",
1666
1884
  children: "Status"
1667
1885
  }, undefined, false, undefined, this),
1668
- /* @__PURE__ */ jsxDEV("th", {
1886
+ /* @__PURE__ */ jsxDEV2("th", {
1669
1887
  className: "px-4 py-3 text-left font-medium text-sm",
1670
1888
  children: "Date"
1671
1889
  }, undefined, false, undefined, this)
1672
1890
  ]
1673
1891
  }, undefined, true, undefined, this)
1674
1892
  }, undefined, false, undefined, this),
1675
- /* @__PURE__ */ jsxDEV("tbody", {
1893
+ /* @__PURE__ */ jsxDEV2("tbody", {
1676
1894
  className: "divide-y divide-border",
1677
1895
  children: [
1678
- orders.map((order) => /* @__PURE__ */ jsxDEV("tr", {
1896
+ orders.map((order) => /* @__PURE__ */ jsxDEV2("tr", {
1679
1897
  className: "hover:bg-muted/50",
1680
1898
  children: [
1681
- /* @__PURE__ */ jsxDEV("td", {
1899
+ /* @__PURE__ */ jsxDEV2("td", {
1682
1900
  className: "px-4 py-3 font-mono text-sm",
1683
1901
  children: order.id
1684
1902
  }, undefined, false, undefined, this),
1685
- /* @__PURE__ */ jsxDEV("td", {
1903
+ /* @__PURE__ */ jsxDEV2("td", {
1686
1904
  className: "px-4 py-3 text-sm",
1687
1905
  children: order.customerId
1688
1906
  }, undefined, false, undefined, this),
1689
- /* @__PURE__ */ jsxDEV("td", {
1907
+ /* @__PURE__ */ jsxDEV2("td", {
1690
1908
  className: "px-4 py-3 font-mono",
1691
1909
  children: formatCurrency(order.total, order.currency)
1692
1910
  }, undefined, false, undefined, this),
1693
- /* @__PURE__ */ jsxDEV("td", {
1911
+ /* @__PURE__ */ jsxDEV2("td", {
1694
1912
  className: "px-4 py-3",
1695
- children: /* @__PURE__ */ jsxDEV("span", {
1913
+ children: /* @__PURE__ */ jsxDEV2("span", {
1696
1914
  className: `inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${STATUS_COLORS[order.status] ?? ""}`,
1697
1915
  children: order.status
1698
1916
  }, undefined, false, undefined, this)
1699
1917
  }, undefined, false, undefined, this),
1700
- /* @__PURE__ */ jsxDEV("td", {
1918
+ /* @__PURE__ */ jsxDEV2("td", {
1701
1919
  className: "px-4 py-3 text-muted-foreground text-sm",
1702
1920
  children: order.createdAt.toLocaleDateString()
1703
1921
  }, undefined, false, undefined, this)
1704
1922
  ]
1705
1923
  }, order.id, true, undefined, this)),
1706
- orders.length === 0 && /* @__PURE__ */ jsxDEV("tr", {
1707
- children: /* @__PURE__ */ jsxDEV("td", {
1924
+ orders.length === 0 && /* @__PURE__ */ jsxDEV2("tr", {
1925
+ children: /* @__PURE__ */ jsxDEV2("td", {
1708
1926
  colSpan: 5,
1709
1927
  className: "px-4 py-8 text-center text-muted-foreground",
1710
1928
  children: "No orders found"
@@ -1750,6 +1968,7 @@ var mockProducts = [
1750
1968
  id: "prod-1",
1751
1969
  name: "Wireless Earbuds",
1752
1970
  storeId: "store-1",
1971
+ category: "Electronics",
1753
1972
  price: 79.99,
1754
1973
  currency: "USD",
1755
1974
  status: "ACTIVE",
@@ -1759,6 +1978,7 @@ var mockProducts = [
1759
1978
  id: "prod-2",
1760
1979
  name: "Smart Watch",
1761
1980
  storeId: "store-1",
1981
+ category: "Wearables",
1762
1982
  price: 249.99,
1763
1983
  currency: "USD",
1764
1984
  status: "ACTIVE",
@@ -1768,6 +1988,7 @@ var mockProducts = [
1768
1988
  id: "prod-3",
1769
1989
  name: "Garden Tools Set",
1770
1990
  storeId: "store-2",
1991
+ category: "Garden",
1771
1992
  price: 89.99,
1772
1993
  currency: "USD",
1773
1994
  status: "ACTIVE",
@@ -1777,6 +1998,7 @@ var mockProducts = [
1777
1998
  id: "prod-4",
1778
1999
  name: "Indoor Plant Kit",
1779
2000
  storeId: "store-2",
2001
+ category: "Garden",
1780
2002
  price: 45.99,
1781
2003
  currency: "USD",
1782
2004
  status: "ACTIVE",
@@ -1786,6 +2008,7 @@ var mockProducts = [
1786
2008
  id: "prod-5",
1787
2009
  name: "LED Desk Lamp",
1788
2010
  storeId: "store-1",
2011
+ category: "Home Office",
1789
2012
  price: 34.99,
1790
2013
  currency: "USD",
1791
2014
  status: "OUT_OF_STOCK",
@@ -1850,6 +2073,7 @@ var marketplaceDashboardMarkdownRenderer = {
1850
2073
  const stores = mockStores;
1851
2074
  const products = mockProducts;
1852
2075
  const orders = mockOrders;
2076
+ const visualizationItems = createMarketplaceVisualizationItems(products, orders);
1853
2077
  const activeStores = stores.filter((s) => s.status === "ACTIVE");
1854
2078
  const activeProducts = products.filter((p) => p.status === "ACTIVE");
1855
2079
  const totalRevenue = orders.reduce((sum, o) => sum + o.total, 0);
@@ -1869,11 +2093,17 @@ var marketplaceDashboardMarkdownRenderer = {
1869
2093
  `| Total Revenue | ${formatCurrency2(totalRevenue)} |`,
1870
2094
  `| Pending Orders | ${pendingOrders.length} |`,
1871
2095
  "",
1872
- "## Top Stores",
1873
- "",
1874
- "| Store | Products | Rating | Status |",
1875
- "|-------|----------|--------|--------|"
2096
+ "## Visualization Overview",
2097
+ ""
1876
2098
  ];
2099
+ for (const item of visualizationItems) {
2100
+ lines.push(`- **${item.title}** via \`${item.spec.meta.key}\``);
2101
+ }
2102
+ lines.push("");
2103
+ lines.push("## Top Stores");
2104
+ lines.push("");
2105
+ lines.push("| Store | Products | Rating | Status |");
2106
+ lines.push("|-------|----------|--------|--------|");
1877
2107
  for (const store of stores.slice(0, 5)) {
1878
2108
  lines.push(`| ${store.name} | ${store.productCount} | \u2B50 ${store.rating || "N/A"} | ${store.status} |`);
1879
2109
  }
@@ -1969,6 +2199,7 @@ export {
1969
2199
  productCatalogMarkdownRenderer,
1970
2200
  orderListMarkdownRenderer,
1971
2201
  marketplaceDashboardMarkdownRenderer,
2202
+ createMarketplaceVisualizationItems,
1972
2203
  createMarketplaceHandlers,
1973
2204
  UpdateOrderStatusInputModel,
1974
2205
  UpdateOrderStatusContract,
@@ -1996,7 +2227,13 @@ export {
1996
2227
  OrderItemModel,
1997
2228
  OrderCreatedEvent,
1998
2229
  OrderCompletedEvent,
2230
+ MarketplaceVisualizationSpecs,
2231
+ MarketplaceVisualizationRegistry,
2232
+ MarketplaceVisualizationRefs,
2233
+ MarketplaceOrderStatusVisualization,
2234
+ MarketplaceOrderActivityVisualization,
1999
2235
  MarketplaceDashboard,
2236
+ MarketplaceCategoryValueVisualization,
2000
2237
  ListReviewsOutputModel,
2001
2238
  ListReviewsInputModel,
2002
2239
  ListReviewsContract,