## class: `WyEmbed`, `wy-embed`

Embed card for displaying external content (photo, video, link, rich).

**Used sub components:**

*   [`<wy-item>`](./ui/wy-item)
*   [`<wy-button>`](./ui/wy-button)
*   [`<wy-icon>`](./ui/wy-icon)
*   [`<wy-dropdown>`](./ui/wy-dropdown)

### Fields

| Name       | Type        | Default | Description                                      | Inherited From |
| ---------- | ----------- | ------- | ------------------------------------------------ | -------------- |
| `embed`    | `EmbedType` |         | Embed data to render inside the card.            |                |
| `disabled` | `boolean`   | `false` | Whether the embed is disabled (non-interactive). |                |

### Methods

| Name             | Description                                          | Parameters                        | Return                       | Inherited From    |
| ---------------- | ---------------------------------------------------- | --------------------------------- | ---------------------------- | ----------------- |
| `whenReady`      | Resolves when the component has rendered first time. |                                   | `Promise<WeavySubComponent>` | WeavySubComponent |
| `dispatchAction` | Dispatch a \`wy-action\` event on the component.     | `detail: WyActionEventDetailType` | `boolean`                    | WeavySubComponent |

### Events

| Name        | Type                | Description                                 | Inherited From    |
| ----------- | ------------------- | ------------------------------------------- | ----------------- |
| `wy-action` | `WyActionEventType` | Emitted when an action button is triggered. |                   |
| `ready`     | `CustomEvent`       | When the component has rendered.            | WeavySubComponent |

### Attributes

| Name       | Field    | Inherited From |
| ---------- | -------- | -------------- |
| `disabled` | disabled |                |

### CSS Parts

| Name                              | Description                           |
| --------------------------------- | ------------------------------------- |
| `wy-embed`                        | Root embed container                  |
| `wy-embed-interactive`            | Modifier when embed is clickable      |
| `wy-disabled`                     | Modifier when embed is disabled       |
| `wy-embed-area`                   | Area containing media (video/photo)   |
| `wy-embed-content`                | Content wrapper for video/rich embeds |
| `wy-embed-video`                  | Modifier for video embeds             |
| `wy-embed-rich`                   | Modifier for rich embeds              |
| `wy-embed-photo`                  | Photo variant container               |
| `wy-embed-photo-with-description` | Photo variant with text description   |
| `wy-embed-image`                  | Image element for photo embeds        |
| `wy-embed-icon`                   | Thumbnail/icon element                |
| `wy-embed-provider`               | Provider meta text                    |

### Slots

| Name     | Description                                                  |
| -------- | ------------------------------------------------------------ |
| `before` | Slot rendered before the embed content (e.g. action buttons) |

<details><summary>Private API</summary>

### Fields

| Name                | Privacy | Type                                                  | Default                                                              | Description | Inherited From    |
| ------------------- | ------- | ----------------------------------------------------- | -------------------------------------------------------------------- | ----------- | ----------------- |
| `#resolveContextId` | private | `(contextId: ContextIdType) => void \| undefined`     |                                                                      |             | WeavySubComponent |
| `#whenContextId`    | private |                                                       | `new Promise<ContextIdType>((r) => { this.#resolveContextId = r; })` |             | WeavySubComponent |
| `#resolveUser`      | private | `(user: UserType) => void \| undefined`               |                                                                      |             | WeavySubComponent |
| `#whenUser`         | private |                                                       | `new Promise<UserType>((r) => { this.#resolveUser = r; })`           |             | WeavySubComponent |
| `#resolveWeavy`     | private | `(weavy: WeavyType) => void \| undefined`             |                                                                      |             | WeavySubComponent |
| `#whenWeavy`        | private |                                                       | `new Promise<WeavyType>((r) => { this.#resolveWeavy = r; })`         |             | WeavySubComponent |
| `#resolveReady`     | private | `(component: WeavySubComponent) => void \| undefined` |                                                                      |             | WeavySubComponent |
| `#whenReady`        | private |                                                       | `new Promise<WeavySubComponent>((r) => { this.#resolveReady = r; })` |             | WeavySubComponent |

</details>

<hr/>

## class: `WyEmbedSelect`, `wy-embed-select`

Embed selector for multiple embeds (renders `<wy-embed>` instances with per-embed actions).

**Used sub components:**

*   [`<wy-embed>`](./wy-embed)
*   [`<wy-button>`](./ui/wy-button)
*   [`<wy-icon>`](./ui/wy-icon)

### Fields

| Name     | Type          | Default | Description                                | Inherited From |
| -------- | ------------- | ------- | ------------------------------------------ | -------------- |
| `embeds` | `EmbedType[]` |         | Array of embeds to render in the selector. |                |

### Events

| Name           | Type                   | Description                                    | Inherited From |
| -------------- | ---------------------- | ---------------------------------------------- | -------------- |
| `embed-remove` | `EmbedRemoveEventType` | Emitted when an embed is removed.              |                |
| `embed-swap`   | `EmbedSwapEventType`   | Emitted when embeds should be swapped/rotated. |                |

### CSS Parts

| Name               | Description                                     |
| ------------------ | ----------------------------------------------- |
| `wy-embed-select`  | Wrapper for embed selections                    |
| `wy-embed-actions` | Slot for action buttons shown before each embed |

<details><summary>Private API</summary>

### Fields

| Name          | Privacy   | Type | Default                           | Description | Inherited From |
| ------------- | --------- | ---- | --------------------------------- | ----------- | -------------- |
| `exportParts` | protected |      | `new ShadowPartsController(this)` |             |                |

</details>

<hr/>

## Exports

| Kind                        | Name              | Declaration   | Module                     | Package |
| --------------------------- | ----------------- | ------------- | -------------------------- | ------- |
| `js`                        | `WyEmbed`         | WyEmbed       | lib/components/wy-embed.ts |         |
| `custom-element-definition` | `wy-embed`        | WyEmbed       | lib/components/wy-embed.ts |         |
| `js`                        | `WyEmbedSelect`   | WyEmbedSelect | lib/components/wy-embed.ts |         |
| `custom-element-definition` | `wy-embed-select` | WyEmbedSelect | lib/components/wy-embed.ts |         |
