-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into cc/one-click-embed
- Loading branch information
Showing
121 changed files
with
11,118 additions
and
9,622 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import type { FEEditionsCrossword } from '../../src/types/editionsCrossword'; | ||
|
||
export const quickCrossword: FEEditionsCrossword = { | ||
date: '2024-11-01T23:00:00Z', | ||
dateSolutionAvailable: '2024-11-01T23:00:00Z', | ||
dimensions: { | ||
cols: 13, | ||
rows: 13, | ||
}, | ||
entries: [ | ||
{ | ||
clue: 'A quick crossword clue', | ||
direction: 'across', | ||
group: ['1-across'], | ||
humanNumber: '1', | ||
id: '1-across', | ||
length: 6, | ||
number: 1, | ||
position: { | ||
x: 0, | ||
y: 0, | ||
}, | ||
separatorLocations: {}, | ||
solution: 'AAAAAA', | ||
format: '6', | ||
}, | ||
], | ||
hasNumbers: true, | ||
name: 'Quick crossword No 1', | ||
number: 1, | ||
randomCluesOrdering: false, | ||
solutionAvailable: true, | ||
type: 'quick', | ||
}; | ||
|
||
export const crypticCrossword: FEEditionsCrossword = { | ||
date: '2024-11-01T23:00:00Z', | ||
dateSolutionAvailable: '2024-11-01T23:00:00Z', | ||
dimensions: { | ||
cols: 15, | ||
rows: 15, | ||
}, | ||
entries: [ | ||
{ | ||
clue: 'A cryptic crossword clue', | ||
direction: 'down', | ||
group: ['7-down'], | ||
humanNumber: '7', | ||
id: '7-down', | ||
length: 8, | ||
number: 7, | ||
position: { | ||
x: 12, | ||
y: 0, | ||
}, | ||
separatorLocations: {}, | ||
solution: 'BBBBBBBB', | ||
format: '8', | ||
}, | ||
], | ||
hasNumbers: true, | ||
name: 'Cryptic crossword No 2', | ||
number: 2, | ||
randomCluesOrdering: false, | ||
solutionAvailable: true, | ||
type: 'cryptic', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* eslint-disable ssr-friendly/no-dom-globals-in-module-scope */ | ||
// @ts-expect-error: Cannot find module | ||
import css from '@guardian/react-crossword/lib/index.css'; | ||
import { createRoot } from 'react-dom/client'; | ||
import { Crosswords } from '../components/Crosswords.editions'; | ||
import type { FEEditionsCrossword } from '../types/editionsCrossword'; | ||
|
||
const style = document.createElement('style'); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- We know this will be a string | ||
style.innerHTML = css; | ||
document.body.appendChild(style); | ||
|
||
const element = document.getElementById('editions-crossword-player'); | ||
if (!element) { | ||
throw new Error('No element found with id "editions-crossword-player"'); | ||
} | ||
const crosswordsData = element.dataset.crosswords; | ||
if (!crosswordsData) { | ||
throw new Error('No data found for "editions-crossword-player"'); | ||
} | ||
|
||
const crosswords = JSON.parse(crosswordsData) as FEEditionsCrossword[]; | ||
const root = createRoot(element); | ||
root.render(<Crosswords crosswords={crosswords} timeZone={undefined} />); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.