# Universal DAM

A flexible Digital Asset Manager (DAM) for WordPress that integrates with ACF and YooTheme page builder.

## Features

- Asset management and organization
- REST API for programmatic access
- Advanced Filtering:
  - Text search across asset metadata
  - Tag-based filtering
  - MIME type filtering
  - Responsive asset grid
- ACF field integration
- YooTheme page builder support
- Svelte-based responsive UI

## Installation

### Via Composer

```bash
composer require greenleafadvancement/universal-dam
```

### Manual

1. Upload the `universal-dam` folder to `/wp-content/plugins/`
2. Activate the plugin in WordPress admin

## REST API

### Get Assets

```
GET /wp-json/universal-dam/v1/assets
```

**Parameters:**
- `query` (string) - Text search query
- `tags` (string) - Comma-separated tags
- `mimeType` (string) - Filter by MIME type
- `limit` (integer) - Results per page (default: 20)
- `offset` (integer) - Pagination offset (default: 0)

**Example:**
```
/wp-json/universal-dam/v1/assets?query=botanical&tags=plant&mimeType=image%2Fjpeg&limit=20
```

## ACF Integration

Use the `universal-dam-assets` field type to select assets in ACF forms.

## YooTheme Integration

The plugin provides custom asset selection fields for YooTheme layouts.

## Development

### Setup

```bash
npm install
composer install
```

### Build

```bash
npm run build
```

## License

GPL v2 or later
