{
    "tailapp": 2,
    "manifest": {
        "format": 2,
        "app_id": "photo-drop",
        "name": "Photo Drop",
        "version": 1,
        "schema": "tailapps/v0",
        "exported_at": 1795564607,
        "from": "gallery",
        "connections": [],
        "files": {
            "app.json": "a70f301c688390de928614bda696f01b04b41beacc8c1c1d8bb2782fdaedd9a6"
        },
        "signature": "jf/wv+E6Mof0AEsaH6SkE76P/qTHdmHp9XMl4SNGK5zwHYmQ6UyzolLy+Jwd1dCbTH2Qck4RwNj41zcK9f7RBw==",
        "key_id": "gallery-1"
    },
    "app": {
        "schema": "tailapps/v0",
        "app": "photo-drop",
        "name": "Photo Drop",
        "description": "Take a photo on your iPhone and upload it straight to your own bucket (Cloudflare R2, S3 and others), then copy its link.",
        "icon": "camera",
        "permissions": [
            "camera",
            "files.write:dest",
            "clipboard.write"
        ],
        "settings": {
            "dest": {
                "type": "storage",
                "label": "Upload photos to",
                "allow": [
                    "s3"
                ],
                "required": true,
                "platforms": [
                    "ios"
                ]
            }
        },
        "state": {
            "photos": {
                "type": "list",
                "default": []
            },
            "lastLink": {
                "type": "text",
                "default": ""
            }
        },
        "cards": [
            {
                "id": "main",
                "layout": {
                    "column": [
                        {
                            "button": "Take Photo",
                            "on": "snap",
                            "style": "primary",
                            "size": "l",
                            "grow": true,
                            "icon": "camera",
                            "disabled": "$running.snap",
                            "platforms": [
                                "ios"
                            ]
                        },
                        {
                            "text": "Photo Drop takes photos on your iPhone: add it there from TailApps on your iPhone (Devices tab).",
                            "size": "s",
                            "emphasis": "subtle",
                            "platforms": [
                                "macos"
                            ],
                            "when": "$photos | count | map:{0:true, else:false}"
                        },
                        {
                            "gallery": "$photos",
                            "limit": 12,
                            "height": "m",
                            "thumb": "$item.thumb",
                            "on_select": "copy_photo",
                            "when": "$photos"
                        },
                        {
                            "text": "Tap a photo to copy its link.",
                            "size": "s",
                            "emphasis": "subtle",
                            "when": "$photos"
                        },
                        {
                            "text": "Photos you take here upload to your bucket. Nothing goes through TailApps.",
                            "size": "s",
                            "emphasis": "subtle",
                            "when": "$photos | count | map:{0:true, else:false}",
                            "platforms": [
                                "ios"
                            ]
                        },
                        {
                            "row": [
                                {
                                    "button": "Copy link",
                                    "on": "copy_link",
                                    "style": "secondary",
                                    "disabled": "$lastLink | count | map:{0:true, else:false}"
                                }
                            ],
                            "justify": "end"
                        }
                    ],
                    "gap": "m"
                }
            }
        ],
        "actions": {
            "snap": {
                "steps": [
                    {
                        "camera.take": [],
                        "as": "photo"
                    },
                    {
                        "files.save": {
                            "data": "$photo.path",
                            "to": "$settings.dest",
                            "name": "photo-{$now}.jpg"
                        },
                        "as": "saved"
                    },
                    {
                        "set": {
                            "lastLink": "$saved.url"
                        }
                    },
                    {
                        "push": {
                            "photos": {
                                "thumb": "$photo.path",
                                "url": "$saved.url",
                                "key": "$saved.key",
                                "at": "$now"
                            }
                        },
                        "max": 30
                    }
                ]
            },
            "copy_link": {
                "steps": [
                    {
                        "clipboard.write": {
                            "text": "$lastLink"
                        }
                    }
                ]
            },
            "copy_photo": {
                "steps": [
                    {
                        "clipboard.write": {
                            "text": "$args.item.url"
                        }
                    }
                ]
            }
        },
        "views": {
            "menubar": {
                "icon": "camera",
                "label": "{$photos | count} photos",
                "card": "main"
            }
        }
    },
    "app_json": "{\n  \"schema\": \"tailapps/v0\",\n  \"app\": \"photo-drop\",\n  \"name\": \"Photo Drop\",\n  \"description\": \"Take a photo on your iPhone and upload it straight to your own bucket (Cloudflare R2, S3 and others), then copy its link.\",\n  \"icon\": \"camera\",\n  \"permissions\": [\n    \"camera\",\n    \"files.write:dest\",\n    \"clipboard.write\"\n  ],\n  \"settings\": {\n    \"dest\": {\n      \"type\": \"storage\",\n      \"label\": \"Upload photos to\",\n      \"allow\": [\n        \"s3\"\n      ],\n      \"required\": true,\n      \"platforms\": [\n        \"ios\"\n      ]\n    }\n  },\n  \"state\": {\n    \"photos\": {\n      \"type\": \"list\",\n      \"default\": []\n    },\n    \"lastLink\": {\n      \"type\": \"text\",\n      \"default\": \"\"\n    }\n  },\n  \"cards\": [\n    {\n      \"id\": \"main\",\n      \"layout\": {\n        \"column\": [\n          {\n            \"button\": \"Take Photo\",\n            \"on\": \"snap\",\n            \"style\": \"primary\",\n            \"size\": \"l\",\n            \"grow\": true,\n            \"icon\": \"camera\",\n            \"disabled\": \"$running.snap\",\n            \"platforms\": [\n              \"ios\"\n            ]\n          },\n          {\n            \"text\": \"Photo Drop takes photos on your iPhone: add it there from TailApps on your iPhone (Devices tab).\",\n            \"size\": \"s\",\n            \"emphasis\": \"subtle\",\n            \"platforms\": [\n              \"macos\"\n            ],\n            \"when\": \"$photos | count | map:{0:true, else:false}\"\n          },\n          {\n            \"gallery\": \"$photos\",\n            \"limit\": 12,\n            \"height\": \"m\",\n            \"thumb\": \"$item.thumb\",\n            \"on_select\": \"copy_photo\",\n            \"when\": \"$photos\"\n          },\n          {\n            \"text\": \"Tap a photo to copy its link.\",\n            \"size\": \"s\",\n            \"emphasis\": \"subtle\",\n            \"when\": \"$photos\"\n          },\n          {\n            \"text\": \"Photos you take here upload to your bucket. Nothing goes through TailApps.\",\n            \"size\": \"s\",\n            \"emphasis\": \"subtle\",\n            \"when\": \"$photos | count | map:{0:true, else:false}\",\n            \"platforms\": [\n              \"ios\"\n            ]\n          },\n          {\n            \"row\": [\n              {\n                \"button\": \"Copy link\",\n                \"on\": \"copy_link\",\n                \"style\": \"secondary\",\n                \"disabled\": \"$lastLink | count | map:{0:true, else:false}\"\n              }\n            ],\n            \"justify\": \"end\"\n          }\n        ],\n        \"gap\": \"m\"\n      }\n    }\n  ],\n  \"actions\": {\n    \"snap\": {\n      \"steps\": [\n        {\n          \"camera.take\": {},\n          \"as\": \"photo\"\n        },\n        {\n          \"files.save\": {\n            \"data\": \"$photo.path\",\n            \"to\": \"$settings.dest\",\n            \"name\": \"photo-{$now}.jpg\"\n          },\n          \"as\": \"saved\"\n        },\n        {\n          \"set\": {\n            \"lastLink\": \"$saved.url\"\n          }\n        },\n        {\n          \"push\": {\n            \"photos\": {\n              \"thumb\": \"$photo.path\",\n              \"url\": \"$saved.url\",\n              \"key\": \"$saved.key\",\n              \"at\": \"$now\"\n            }\n          },\n          \"max\": 30\n        }\n      ]\n    },\n    \"copy_link\": {\n      \"steps\": [\n        {\n          \"clipboard.write\": {\n            \"text\": \"$lastLink\"\n          }\n        }\n      ]\n    },\n    \"copy_photo\": {\n      \"steps\": [\n        {\n          \"clipboard.write\": {\n            \"text\": \"$args.item.url\"\n          }\n        }\n      ]\n    }\n  },\n  \"views\": {\n    \"menubar\": {\n      \"icon\": \"camera\",\n      \"label\": \"{$photos | count} photos\",\n      \"card\": \"main\"\n    }\n  }\n}\n",
    "files": []
}