mirror of
https://github.com/nexu-io/open-design.git
synced 2026-06-01 03:14:35 +07:00
fix(web): hide recent project pagination chrome (#2966)
This commit is contained in:
parent
dbdf3b9637
commit
1770789fa0
2 changed files with 20 additions and 1 deletions
|
|
@ -364,17 +364,33 @@ function deckPreviewSrcDoc(html: string): string {
|
|||
section[data-slide]:not(:first-of-type),
|
||||
section[data-screen-label]:not(:first-of-type),
|
||||
.deck-counter,
|
||||
.deck-controls,
|
||||
.deck-hint,
|
||||
.deck-page-controls,
|
||||
.deck-pager,
|
||||
.deck-progress,
|
||||
.deck-nav,
|
||||
.deck-navigation,
|
||||
.page-controls,
|
||||
.page-flip-controls,
|
||||
.page-nav,
|
||||
.page-navigation,
|
||||
.pagination-control,
|
||||
.pagination-controls,
|
||||
#deck-prev,
|
||||
#deck-next,
|
||||
#deck-cur,
|
||||
#deck-total,
|
||||
[data-deck-controls],
|
||||
[data-page-controls],
|
||||
[data-pagination],
|
||||
[aria-label="Previous slide"],
|
||||
[aria-label="Next slide"],
|
||||
[aria-label="Deck navigation"] {
|
||||
[aria-label="Deck navigation"],
|
||||
[aria-label="Page navigation"],
|
||||
[aria-label="Pagination"],
|
||||
nav[aria-label*="page" i],
|
||||
nav[aria-label*="pagination" i] {
|
||||
display: none !important;
|
||||
visibility: hidden !important;
|
||||
pointer-events: none !important;
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@ describe('RecentProjectsStrip', () => {
|
|||
<section class="slide active">First slide</section>
|
||||
<section class="slide">Second slide</section>
|
||||
<div class="deck-counter"><button id="deck-prev">‹</button><span>1 / 10</span><button id="deck-next">›</button></div>
|
||||
<nav class="page-flip-controls" aria-label="Pagination">01 / 10</nav>
|
||||
</body>
|
||||
</html>
|
||||
`,
|
||||
|
|
@ -124,6 +125,8 @@ describe('RecentProjectsStrip', () => {
|
|||
const deckIframe = deckCard?.querySelector('iframe') as HTMLIFrameElement | null;
|
||||
expect(deckIframe?.getAttribute('srcdoc')).toContain('First slide');
|
||||
expect(deckIframe?.getAttribute('srcdoc')).toContain('od-recent-deck-real-preview');
|
||||
expect(deckIframe?.getAttribute('srcdoc')).toContain('.page-flip-controls');
|
||||
expect(deckIframe?.getAttribute('srcdoc')).toContain('[aria-label="Pagination"]');
|
||||
expect(deckIframe?.getAttribute('srcdoc')).not.toContain('<script');
|
||||
expect(deckIframe?.getAttribute('src')).toBeNull();
|
||||
expect(htmlCard?.querySelector('iframe')?.getAttribute('src')).toBe(
|
||||
|
|
|
|||
Loading…
Reference in a new issue