diff --git a/.changeset/calm-browsers-test.md b/.changeset/calm-browsers-test.md new file mode 100644 index 00000000..c4bef8ff --- /dev/null +++ b/.changeset/calm-browsers-test.md @@ -0,0 +1,5 @@ +--- +'@youversion/platform-react-ui': patch +--- + +Preserve SDK spacing in Safari inside Shadow DOM and document roots by scoping the host CSS reset and inlining the fixed Tailwind spacing scale. diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index 56e947c3..3f1b5a71 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -39,3 +39,37 @@ jobs: YVP_APP_KEY: ${{ secrets.YVP_APP_KEY }} STORYBOOK_YOUVERSION_API_HOST: ${{ secrets.YVP_API_HOST }} STORYBOOK_YOUVERSION_APP_KEY: ${{ secrets.STORYBOOK_YOUVERSION_APP_KEY }} + + shadow-browser-tests: + name: Shadow DOM (${{ matrix.browser }}) + runs-on: ubuntu-latest + container: + image: mcr.microsoft.com/playwright:v1.56.1-noble + strategy: + fail-fast: false + matrix: + browser: [firefox, webkit] + env: + VITEST_BROWSER: ${{ matrix.browser }} + STORYBOOK_YOUVERSION_APP_KEY: ${{ secrets.STORYBOOK_YOUVERSION_APP_KEY }} + STORYBOOK_AUTH_REDIRECT_URL: ${{ secrets.STORYBOOK_AUTH_REDIRECT_URL }} + steps: + - uses: actions/checkout@v5 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - uses: actions/setup-node@v6 + with: + node-version: 24 + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build packages + run: pnpm build + + - name: Run Shadow DOM browser tests + run: cd packages/ui && pnpm run test:shadow-browser + env: + HOME: /root diff --git a/docs/shadow-dom-consumer-compatibility.md b/docs/shadow-dom-consumer-compatibility.md index 7f356783..b5f9d3fc 100644 --- a/docs/shadow-dom-consumer-compatibility.md +++ b/docs/shadow-dom-consumer-compatibility.md @@ -2,9 +2,9 @@ ## Purpose -This contract records the Chromium evidence for consumer-facing behavior at the -SDK's Shadow DOM boundary. It is input to YPE-5356's production rollout policy, -not approval for automatic isolation beyond `YouVersionAuthButton`. +This contract records cross-browser evidence for consumer-facing behavior at +the SDK's Shadow DOM boundary. It is input to YPE-5356's production rollout +policy, not approval for automatic isolation beyond `YouVersionAuthButton`. The executable evidence lives in `consumer-compatibility.shadow-isolation.stories.tsx`. The existing @@ -30,7 +30,7 @@ exercise. They do not establish compatibility for every SDK component. | --- | --- | --- | | A light-DOM form natively owns or serializes a control inside an SDK shadow root | Unsupported | `FormsAndExternalRelationshipsStopAtTheTreeScope` verifies that the isolated textarea has no owner form, is absent from `form.elements`, and is absent from `FormData`. A rollout target that needs form participation requires an explicit component API or separately designed form-associated host contract. | | A light-DOM `