@js-gamifications/word-search-react 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/dist/index.d.mts +35 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +699 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +672 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +36 -0
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# @js-gamifications/word-search-react
|
|
2
|
+
|
|
3
|
+
React adapter for the word search core package.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i @js-gamifications/word-search-react
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
`@js-gamifications/word-search-core` is installed automatically as a dependency.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { WordSearchBoard } from "@js-gamifications/word-search-react";
|
|
17
|
+
|
|
18
|
+
export function App() {
|
|
19
|
+
return (
|
|
20
|
+
<WordSearchBoard
|
|
21
|
+
rows={10}
|
|
22
|
+
cols={10}
|
|
23
|
+
words={["react", "hooks", "state"]}
|
|
24
|
+
allowDiagonal
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
```
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { WordSearchPuzzle } from '@js-gamifications/word-search-core';
|
|
3
|
+
|
|
4
|
+
interface WordSearchCompletionReport {
|
|
5
|
+
elapsedSeconds: number;
|
|
6
|
+
foundWords: number;
|
|
7
|
+
totalWords: number;
|
|
8
|
+
rows: number;
|
|
9
|
+
cols: number;
|
|
10
|
+
allowDiagonal: boolean;
|
|
11
|
+
completedAt: string;
|
|
12
|
+
}
|
|
13
|
+
interface WordSearchBoardProps {
|
|
14
|
+
/** Number of rows in the generated puzzle grid. */
|
|
15
|
+
rows: number;
|
|
16
|
+
/** Number of columns in the generated puzzle grid. */
|
|
17
|
+
cols: number;
|
|
18
|
+
/** Input words to place in the puzzle. */
|
|
19
|
+
words: string[];
|
|
20
|
+
/** Enables diagonal word placement in the generator. */
|
|
21
|
+
allowDiagonal?: boolean;
|
|
22
|
+
/** Optional className applied to the root container. */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** Callback fired whenever a new puzzle is generated. */
|
|
25
|
+
onGenerated?: (puzzle: WordSearchPuzzle) => void;
|
|
26
|
+
/** Callback fired when the player completes the puzzle. */
|
|
27
|
+
onCompleted?: (report: WordSearchCompletionReport) => void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Interactive word-search board component with drag selection,
|
|
31
|
+
* progress tracking, timer, sounds, and localized labels.
|
|
32
|
+
*/
|
|
33
|
+
declare function WordSearchBoard(props: WordSearchBoardProps): react_jsx_runtime.JSX.Element;
|
|
34
|
+
|
|
35
|
+
export { WordSearchBoard, type WordSearchBoardProps };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { WordSearchPuzzle } from '@js-gamifications/word-search-core';
|
|
3
|
+
|
|
4
|
+
interface WordSearchCompletionReport {
|
|
5
|
+
elapsedSeconds: number;
|
|
6
|
+
foundWords: number;
|
|
7
|
+
totalWords: number;
|
|
8
|
+
rows: number;
|
|
9
|
+
cols: number;
|
|
10
|
+
allowDiagonal: boolean;
|
|
11
|
+
completedAt: string;
|
|
12
|
+
}
|
|
13
|
+
interface WordSearchBoardProps {
|
|
14
|
+
/** Number of rows in the generated puzzle grid. */
|
|
15
|
+
rows: number;
|
|
16
|
+
/** Number of columns in the generated puzzle grid. */
|
|
17
|
+
cols: number;
|
|
18
|
+
/** Input words to place in the puzzle. */
|
|
19
|
+
words: string[];
|
|
20
|
+
/** Enables diagonal word placement in the generator. */
|
|
21
|
+
allowDiagonal?: boolean;
|
|
22
|
+
/** Optional className applied to the root container. */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** Callback fired whenever a new puzzle is generated. */
|
|
25
|
+
onGenerated?: (puzzle: WordSearchPuzzle) => void;
|
|
26
|
+
/** Callback fired when the player completes the puzzle. */
|
|
27
|
+
onCompleted?: (report: WordSearchCompletionReport) => void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Interactive word-search board component with drag selection,
|
|
31
|
+
* progress tracking, timer, sounds, and localized labels.
|
|
32
|
+
*/
|
|
33
|
+
declare function WordSearchBoard(props: WordSearchBoardProps): react_jsx_runtime.JSX.Element;
|
|
34
|
+
|
|
35
|
+
export { WordSearchBoard, type WordSearchBoardProps };
|