Closes https://github.com/elastic/kibana/issues/159353
Closes https://github.com/elastic/kibana/issues/159756
## Summary
This PR adds styling so that, when the dashboard's chrome is hidden or
when there is a header banner present, the dashboard's top navigation
bar's `top` position is adjusted as necessary - this prevents it from
either (a) getting hidden behind the Kibana chrome or (b) floating in
the wrong position and overlapping the dashboard content, regardless of
if the dashboard is in embed mode (i.e. `embed=true` is present in the
URL) or not (i.e. `embed=false` is present in the URL **or**, more
commonly, there is no `embed` parameter in the URL).
### Embed Mode
- #### Before:
76d3c70c-936c-4bcc-985c-4fb433f0cff3
- #### After:
137bc103-666b-4fdd-ab4e-8994345e21b4
It also resolves a bug where the `isEmbeddedExternally` component state
was never actually being set, which meant that the
`ExitFullScreenButton` was always receiving `toggleChrome=true`. This
made it so that entering and exiting fullscreen mode in an embedded
dashboard would force the chrome to be visible (which should never
happen in embed mode).
#### How to Test
The easiest way to test this PR is to simply add `embed=true` to your
dashboard URL - because this PR also fixes
https://github.com/elastic/kibana/issues/159756, this will essentially
mimic the embedded experience.
Alternatively, if you want to test this in an actual iframe...
1. Start and login to Kibana with the default `kibana.yml` settings
2. Create and embed a dashboard using an iframe in an HTML file and open
that file in your browser - the iframe will show a prompt to login, but
you won't be able to. Instead...
3. Add the following settings to your `kibana.yml` file:<br><Br>
```
xpack.security.secureCookies: true
xpack.security.sameSiteCookies: 'None'
```
4. Wait for Kibana to re-load
5. Refresh the HTML page from step 2
6. The embedded dashboard should now be available for you to test 👍
#### Scenarios Tested
- **Non-fullscreen mode**
<details>
<summary>✅ Without filter pill, without header banner <i>(click to see
screenshot)</i></summary>
<img
src="f68bbcfb-74d8-497c-a2ae-33e8e0c02660"/>
</details>
<details>
<summary>✅ Without filter pill, with header banner <i>(click to see
screenshot)</i></summary>
<img
src="7c19711c-61dc-499a-b1d0-01fab639a27e"/>
</details>
<details>
<summary>✅ With filter pill, without header banner <i>(click to see
screenshot)</i></summary>
<img
src="36e848bd-f0d9-41e3-8a8a-a48571ad5cd2"/>
</details>
<details>
<summary>✅ With filter pill, with header banner <i>(click to see
screenshot)</i></summary>
<img
src="cd7489f6-3f34-439a-a30e-3ef39f3970b5"/>
</details>
<details>
<summary>✅ With filter pill, with header banner <b>and</b> notification
banner <i>(click to see GIF)</i></summary>
<img
src="bd67b4eb-4f68-4d9b-9e22-4d1b2d2e4d90"/>
</details>
- **Fullscreen mode**
<details>
<summary>✅ Without filter pill, without banner <i>(click to see
screenshot)</i></summary>
<img
src="d7d15560-7698-424f-b761-59b5557abe37"/>
</details>
<details>
<summary>✅ Without filter pill, with header banner <i>(click to see
screenshot)</i></summary>
<img
src="311b6f3d-5152-4d16-ba39-160978c60c96"/>
</details>
<details>
<summary>✅ With filter pill, without header banner <i>(click to see
screenshot)</i></summary>
<img
src="bff9e040-8169-40c7-a086-13a19e870383"/>
</details>
<details>
<summary>✅ With filter pill, with header banner <i>(click to see
screenshot)</i></summary>
<img
src="3f453811-e65d-4ac4-9524-c396f9efdbdd"/>
</details>
<details>
<summary>✅ With filter pill, with header banner <b>and</b> notification
banner <i>(click to see GIF)</i></summary>
<img
src="f79673e7-03f2-49fa-be56-b67bf7a12976"/>
</details>
### Non-Embed Mode
- #### Before:
71ffc964-2844-41a6-98d6-353e84d674be
- #### After:
894aa292-b611-4e5e-a0d7-fe3d256fc3ba
### Checklist
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
### For maintainers
- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)