{
  "id": "io.pulse-heatmap",
  "name": "Pulse",
  "version": "1.0.11",
  "category": "DISPLAY",
  "icon": "./icon.svg",
  "description": "GitHub-style activity heatmap. Bucket any time-stamped table by day, show streaks and totals, and emit a dayPress event when a cell is tapped.",
  "author": { "name": "Mans Regin", "url": "https://colixsystems.com" },
  "supportedPlatforms": ["web", "native"],
  "minAppStudioVersion": "0.1.0",
  "requestedScopes": ["datastore.read:tableRef(tableId)"],
  "propertySchema": {
    "tableId": {
      "type": "tableRef",
      "label": "Source table",
      "description": "Table whose rows are counted per day.",
      "required": true,
      "ui": { "group": "Data", "order": 10 }
    },
    "dateColumn": {
      "type": "columnRef",
      "label": "Date column",
      "description": "Column holding the timestamp used to bucket each row by day.",
      "required": true,
      "ui": { "group": "Data", "order": 20 }
    },
    "range": {
      "type": "select",
      "label": "Range",
      "enum": [
        { "value": 90,  "label": "Last 90 days" },
        { "value": 180, "label": "Last 6 months" },
        { "value": 365, "label": "Last year" }
      ],
      "default": 365,
      "ui": { "group": "Data", "order": 30 }
    },
    "title": {
      "type": "string",
      "label": "Title",
      "default": "Activity",
      "ui": { "group": "Appearance", "order": 10 }
    },
    "accent": {
      "type": "color",
      "label": "Accent color",
      "description": "High-intensity cell color. Empty cells use the surface tone.",
      "default": "#22c55e",
      "ui": { "group": "Appearance", "order": 20 }
    },
    "showStats": {
      "type": "boolean",
      "label": "Show summary stats",
      "default": true,
      "ui": { "group": "Appearance", "order": 30 }
    },
    "showWeekdayLabels": {
      "type": "boolean",
      "label": "Show weekday labels",
      "default": true,
      "ui": { "group": "Appearance", "order": 40 }
    },
    "onDayPress": {
      "type": "eventBinding",
      "label": "On day press",
      "ui": { "group": "Behavior", "order": 10 }
    }
  },
  "events": [
    {
      "name": "dayPress",
      "description": "Fired when a heatmap cell is tapped or pressed.",
      "payloadSchema": {
        "date":  { "type": "string", "label": "Date",  "description": "ISO date (YYYY-MM-DD) of the pressed cell." },
        "count": { "type": "number", "label": "Count", "description": "Number of records bucketed on that day." }
      }
    }
  ]
}
