# Spin the Wheel 1.1.0

Changes from 1.0.2.

## 🚀 Key Features & Updates

- Configure the floating launcher from campaign settings: choose a screen corner, set its size from 32px to 240px, and adjust its horizontal and vertical offsets.
- Configure campaign popup colors with `config.theme` and launcher placement with `config.launcher`. Both settings are optional and use documented defaults.
- Example campaign overrides in the campaign entry's `config` JSON Object (these are custom values, not defaults):

  ```json
  {
    "config": {
      "theme": {
        "primary": "#3643BA",
        "accent": "#7AFFA6",
        "text": "#FFFFFF",
        "surfaceStart": "#6175E0",
        "surfaceEnd": "#1A2180"
      },
      "launcher": {
        "position": "bottom-right",
        "size": 100,
        "offsetX": 24,
        "offsetY": 32
      }
    }
  }
  ```

- Configure each promo slice independently in the promo entry's optional `config.theme` object. This example also overrides the defaults:

  ```json
  {
    "config": {
      "theme": {
        "color": "#3643BA",
        "bgColor": "#E3E6FC"
      }
    }
  }
  ```

  `color` sets the slice text color; `bgColor` sets its background. Backgrounds accept six-digit hex or eight-digit `#RRGGBBAA` hex for transparency. Omitted promo colors inherit the campaign theme.
- Render localized `couponNote` and `couponCondition` as Rich Text with multiple paragraphs and bold/italic formatting. Other campaign and promo copy remains plain text and is never interpreted as HTML.
- Use shared `--dkt-gtm-*` design tokens for common visual defaults while keeping module styling local.
- Scope language-switcher styling to the wheel popup and use the shared radius token, preventing styles from affecting the surrounding storefront.

## ⚠️ Important Behavioral Changes | Breaking Changes

- Contentful settings have moved into the optional `config` JSON Object: campaign `theme` settings are now under `config.theme`, campaign launcher settings under `config.launcher`, and promo `custom` theme settings under `config.theme`. Existing values are preserved by migration `002-migrate-theme-to-config.cjs`; the legacy fields are removed.
- After migration `004-rich-text-copy.cjs`, `couponNote` and `couponCondition` are Rich Text fields and the Delivery API returns Rich Text documents instead of strings. The module accepts both document and legacy string values during rollout. In environments where `couponCondition` is still a `Symbol`, run migration `003-multiline-coupon-condition.cjs` before migration 004.
- Invalid launcher settings now fail configuration validation instead of being silently applied.

## ℹ️ Other Notes | Information

Promo and campaign `config` fields and their individual settings are optional. The defaults preserve the existing appearance:

| Setting | Default |
|---|---|
| Campaign theme `primary` | `#3643BA` |
| Campaign theme `accent` | `#7AFFA6` |
| Campaign theme `text` | `#FFFFFF` |
| Campaign theme `surfaceStart` | `#6175E0` |
| Campaign theme `surfaceEnd` | `#1A2180` |
| Launcher `position` | `bottom-left` |
| Launcher `size` | `90px` |
| Launcher `offsetX` | `11px` |
| Launcher `offsetY` | `125px` desktop; `75px` mobile |
| Promo `config.theme.bgColor` | Campaign `primary` (`#3643BA` when unset) |
| Promo `config.theme.color` | Campaign `text` (`#FFFFFF` when unset) |

- Rich Text support is limited to paragraph blocks with bold and italic marks; other copy fields remain plain text.
- Promo slice backgrounds accept transparent eight-digit hex colors; promo text and campaign theme colors use six-digit hex. Promo `bgColor` and `color` default to the campaign's effective `primary` and `text` colors.
- The popup layout, minimum promo count, weighted prize selection, and campaign rules are unchanged.
