=== Air Asset Picker ===
Contributors: airinc
Tags: digital asset management, dam, brand assets, media library, block editor
Requires at least: 6.3
Tested up to: 6.9
Stable tag: 0.3.7
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Embed brand-approved images and videos from your Air workspace directly in the WordPress block editor.
== Description ==
Air Asset Picker is a Gutenberg block that connects your WordPress site to your Air workspace. Content editors can browse, search, and insert brand-approved images and videos from Air without ever leaving the WordPress block editor — no downloading, no re-uploading.
**How it works:**
* Add the **Air** block to any page or post
* Click **Add asset** to open the Air asset picker
* Log in to your Air account
* Browse or search your workspace and select an asset
* The asset is embedded via Air's CDN URL — no files are stored in WordPress
**Why CDN delivery?**
Assets are served directly from Air's CDN. This means no storage overhead in WordPress, and any updates made to an asset in Air are reflected on your site immediately.
**Requirements:**
* An active Air account on an Enterprise plan
* Your Air workspace ID (found in your Air account settings)
== Installation ==
1. Install the plugin from the WordPress.org plugin directory, or upload the `air-asset-picker` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **Settings → Air Media** and enter your Air workspace ID.
4. Edit any page or post, add the **Air** block, and click **Add asset** to start inserting assets.
== Frequently Asked Questions ==
= Where do I find my workspace ID? =
Log in to your Air account, go to your workspace settings, and copy the workspace ID from the URL or settings panel.
= Do I need an Air account? =
Yes. This plugin requires an active Air account on an Enterprise plan. Visit [air.inc](https://air.inc) to learn more.
= Does this upload files to WordPress? =
No. Assets are embedded via Air's CDN URL. No files are stored in your WordPress media library.
= Which editor is supported? =
The Gutenberg block editor (WordPress 6.3+). The classic TinyMCE editor is not supported.
== Screenshots ==
1. Air Asset Picker listed on the WordPress Plugins page
2. Settings → Air Media page for entering your workspace ID
3. Adding the Air block from the Gutenberg block inserter
4. The Air asset picker gallery — browse and search your workspace
5. Log in to your Air account from within the block editor
6. Preview an asset before inserting it
7. An Air asset embedded in a WordPress page via CDN URL
8. Asset details panel with metadata, tags, and insert options
9. Inserted Air asset shown in the post editor with Replace toolbar
== External Services ==
This plugin connects to Air (https://air.inc) to enable asset selection and embedding. Air is a digital asset management service operated by Air Labs, Inc.
**When is data sent?**
* When a user opens the asset picker inside the WordPress block editor, the plugin loads the Air picker UI from `https://wordpress-plugin.air.inc` in an iframe. This is required to authenticate the user and display the asset gallery.
* When an asset is selected, only the asset's CDN URL and metadata (filename, dimensions, alt text, caption) are sent back to WordPress and stored as block attributes. No binary file data is transferred to WordPress.
* When a published page is viewed, the browser loads the embedded image or video directly from Air's CDN.
**What data is sent?**
* Your Air workspace ID (entered in Settings → Air Media)
* Authentication credentials you enter into the Air picker (handled entirely by Air, never seen by the plugin)
* No personal data from WordPress is transmitted to Air
**Terms and privacy:**
* Air Terms of Service: [https://air.inc/terms](https://air.inc/terms)
* Air Privacy Policy: [https://air.inc/privacy](https://air.inc/privacy)
== Source Code ==
The compiled JavaScript shipped in `/build` is generated from human-readable sources in `/src` using `@wordpress/scripts` (webpack). The full source code, build configuration, and development instructions are publicly available at:
[https://github.com/AirLabsTeam/air-wordpress-plugin](https://github.com/AirLabsTeam/air-wordpress-plugin)
**Build prerequisites:**
* Node.js 22 or later
* npm 10 or later (or Yarn 1.x)
**Build steps:**
`git clone https://github.com/AirLabsTeam/air-wordpress-plugin.git`
`cd air-wordpress-plugin`
`npm install`
`npm run build:prod`
The build outputs `/build/index.js`, `/build/view.js`, `/build/index.asset.php`, `/build/view.asset.php`, and `/build/block.json` — the exact files shipped in the WordPress.org zip. The only third-party runtime dependency bundled in `/build/view.js` is [hls.js](https://github.com/video-dev/hls.js) (Apache-2.0), used so non-Safari browsers can play Air's HLS preview videos; everything else is sourced from `@wordpress/*` packages provided by WordPress core.
== Changelog ==
= 0.3.7 =
* Sidebar asset thumbnail now caps at 60px wide (was 96px in 0.3.4) so the View in Air button + Synced badge always fit side-by-side on the same row inside the InspectorControls panel. Replaces the container-query layout introduced in 0.3.6.
= 0.3.6 =
* Sidebar asset action row (View in Air + Synced badge) now uses a CSS container query so the badge stays next to the button at normal widths (per Figma spec) and only stacks to a second line when the InspectorControls panel is too narrow to fit both side-by-side. Replaces the always-wrap behavior introduced in 0.3.5.
= 0.3.5 =
* Sidebar asset action row (View in Air + Synced badge) now wraps to a second line when the thumbnail width pushes the row past the panel edge, so the Synced label is never clipped on wider thumbnails.
= 0.3.4 =
* Dynamic-mode CDN placeholder now derives a real low-resolution (150×150 imgix-cropped) thumbnail from `urls.imgixBase` instead of the picker's `urls.thumbnail` field, which is the full-size base URL and loads no faster than the foreground image. The placeholder now paints near-instantly while the dynamic CDN URL resolves.
* Sidebar asset thumbnail no longer crops horizontals and non-portrait verticals. The fixed 47×76 box with `cover` cropping has been replaced with a 76px-tall box whose width flexes up to 96px, falling back to `contain` when the natural width would exceed the cap. Designed with Meghan against the Figma 47:76 portrait spec.
= 0.3.3 =
* Air logo now renders in the block inserter and block header. The logo was previously loaded from `/assets/icon-128x128.png`, a directory used by the WordPress.org plugin listing that is not shipped to installed sites — the image 404'd in the editor. The icon is now embedded inline so it renders without an HTTP request.
= 0.3.2 =
* Dynamic-mode images no longer leave a blank box while the CDN resolves the latest version: the imgix thumbnail is painted as a background placeholder under the `
`, so authors and readers see the image immediately and the dynamic URL covers it once decoded.
* Image blocks now scale responsively when the asset is wider than the theme's content area. The rendered `
` uses `max-width: 100%` and `height: auto`, with the intrinsic `width`/`height` attributes preserved so browsers reserve the correct aspect-ratio box (no cumulative layout shift). Previously, large assets were stretched and side-cropped to fit narrow containers.
= 0.3.1 =
* Embedded videos now play in Chrome, Edge, and Firefox. Air delivers video previews as HLS (`.m3u8`), which only Safari/iOS handle natively; the block view script now attaches [hls.js](https://github.com/video-dev/hls.js) to those `