misraj-mushaf-renderer 1.0.0
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 +193 -0
- package/dist/App.d.ts +3 -0
- package/dist/classnames.d.ts +19 -0
- package/dist/components/MushafReader/ReadingView/Line.d.ts +12 -0
- package/dist/components/MushafReader/ReadingView/Page.d.ts +12 -0
- package/dist/components/MushafReader/ReadingView/PageNumber.d.ts +5 -0
- package/dist/components/MushafReader/ReadingView/groupLinesByVerses.d.ts +16 -0
- package/dist/components/MushafReader/ReadingView/page-metadata/PageMetaDataContainer.d.ts +6 -0
- package/dist/components/MushafReader/ReadingView/page-metadata/juz.constants.d.ts +2 -0
- package/dist/components/MushafReader/contexts/MushafPage/MushafPage.types.d.ts +15 -0
- package/dist/components/MushafReader/contexts/MushafPage/MushafPageProvider.d.ts +33 -0
- package/dist/components/MushafReader/contexts/MushafPage/helpers/fetch-verses.d.ts +3 -0
- package/dist/components/MushafReader/index.d.ts +13 -0
- package/dist/components/Verse/VerseText.d.ts +11 -0
- package/dist/components/Verse/pageUtils.d.ts +11 -0
- package/dist/components/chapters/ChapterHeader/index.d.ts +9 -0
- package/dist/components/chapters/ChapterIcon/ChapterIconContainer.d.ts +7 -0
- package/dist/components/chapters/ChapterIcon/index.d.ts +6 -0
- package/dist/components/dls/Bismillah/Bismillah.d.ts +2 -0
- package/dist/components/dls/MushafWord/MushafWord.d.ts +8 -0
- package/dist/config-global.d.ts +1 -0
- package/dist/hooks/use-media-query.d.ts +2 -0
- package/dist/index.cjs.js +6 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.es.js +2506 -0
- package/dist/index.es.js.map +1 -0
- package/dist/main.d.ts +0 -0
- package/dist/styles.css +1 -0
- package/dist/styles.d.ts +0 -0
- package/dist/types/MushafReader.d.ts +16 -0
- package/dist/types/Word.d.ts +3 -0
- package/dist/utils/fontFaceHelper.d.ts +13 -0
- package/dist/utils/narration-name.d.ts +1 -0
- package/dist/utils/verse.d.ts +41 -0
- package/package.json +79 -0
package/README.md
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# Misraj Mushaf Renderer
|
|
2
|
+
|
|
3
|
+
This library is a powerful and flexible React-based component for rendering Mushaf pages directly in your web application. It is designed to handle the complexities of Quranic text rendering, including multiple narrations, dynamic text sizing, and interactive features.
|
|
4
|
+
|
|
5
|
+
This project is an open-source initiative built upon the excellent foundation of the [quran.com-frontend-next](https://github.com/quran/quran.com-frontend-next) project. While the original project focused solely on the Hafs narration, this library extends its capabilities to include a wider range of Quranic narrations.
|
|
6
|
+
|
|
7
|
+
The project is also built on top of [Quran Hub API](https://api-staging.quranhub.com/docs#/) which is one of [MISRAJ](https://misraj.sa/) company non-commercial projects
|
|
8
|
+
|
|
9
|
+
## License and Acknowledgement
|
|
10
|
+
|
|
11
|
+
This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International Public License. See the `LICENSE` file for details.
|
|
12
|
+
|
|
13
|
+
A significant portion of this codebase is derived from the [quran.com-frontend-next](https://github.com/quran/quran.com-frontend-next) project. We are immensely grateful to the quran.com team for their pioneering work and for making their project open source.
|
|
14
|
+
|
|
15
|
+
## Key Features
|
|
16
|
+
|
|
17
|
+
- **Multi-Narration Support**: Unlike the original Hafs-only implementation, this library supports multiple Quranic narrations:
|
|
18
|
+
- Hafs
|
|
19
|
+
- Qaloon
|
|
20
|
+
- Qunbul
|
|
21
|
+
- Shoba
|
|
22
|
+
- Warsh
|
|
23
|
+
- Bazzi
|
|
24
|
+
- Douri
|
|
25
|
+
- Sousi
|
|
26
|
+
- **Two-page view**: Supports a side-by-side two-page view on larger screens for a more authentic reading experience.
|
|
27
|
+
- **Dynamic and Interactive**: Provides handlers for word-level interactions.
|
|
28
|
+
- **Easy Integration**: Simple to integrate into any React project with a straightforward provider-consumer pattern.
|
|
29
|
+
- **Customizable Styling**: Uses a flexible SCSS structure for easy theming and customization.
|
|
30
|
+
|
|
31
|
+
## How to Use
|
|
32
|
+
|
|
33
|
+
Make sure to import package styles file which includes css styles and fonts assets
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
// main.tsx;
|
|
37
|
+
|
|
38
|
+
import 'misraj-mushaf-renderer/styles';
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The core of the library is the `MushafPageProvider` and the `Mushaf` component.
|
|
42
|
+
|
|
43
|
+
### 1. `MushafPageProvider`
|
|
44
|
+
|
|
45
|
+
The `MushafPageProvider` is a React context provider that fetches and manages the state for a specific Mushaf page. You need to wrap any component that will render Mushaf text with it.
|
|
46
|
+
|
|
47
|
+
**Props:**
|
|
48
|
+
|
|
49
|
+
- `dataId` (string): A unique identifier for the Mushaf narration you want to render (e.g., `quran-hafs`, `quran-qaloon`).
|
|
50
|
+
- `pageNumber` (number): The page number of the Mushaf you wish to display.
|
|
51
|
+
- `children`: The child components that will consume the provider's context.
|
|
52
|
+
- `initialFontScale` (number, optional): The initial font scale. Defaults to `3`.
|
|
53
|
+
- `hasBorder` (boolean, optional): Whether to display the page border. Defaults to `true`.
|
|
54
|
+
- `initialIsTwoPagesView` (boolean, optional): The initial state for two-page view. Defaults to `false`.
|
|
55
|
+
|
|
56
|
+
### 2. `useMushafContext` Hook
|
|
57
|
+
|
|
58
|
+
This hook provides access to the state and actions of the `MushafPageProvider`. It should be used by components that are children of `MushafPageProvider`.
|
|
59
|
+
|
|
60
|
+
**State:**
|
|
61
|
+
|
|
62
|
+
- `fontScale` (number): The current font scale.
|
|
63
|
+
- `selectedVerse` (Ayah | null): The currently selected verse.
|
|
64
|
+
- `currentSurah` (Surah | null): The current surah being displayed.
|
|
65
|
+
- `ayat` (MushafPageDataType | null): The raw data for the current page.
|
|
66
|
+
- `nextPageAyat` (MushafPageDataType | null): The data for the next page, used in two-page view.
|
|
67
|
+
- `error` (Error | null): Any error that occurred while fetching data.
|
|
68
|
+
- `loading` (boolean): A boolean indicating if the page data is loading.
|
|
69
|
+
- `pageNumber` (number): The current page number.
|
|
70
|
+
- `dataId` (DataId): The current narration identifier.
|
|
71
|
+
- `isTwoPagesView` (boolean): Whether the two-page view is currently active.
|
|
72
|
+
|
|
73
|
+
**Actions:**
|
|
74
|
+
|
|
75
|
+
- `increaseFontScale()`: Increases the font scale.
|
|
76
|
+
- `decreaseFontScale()`: Decreases the font scale.
|
|
77
|
+
- `setSelectedVerse(verse: Ayah | null)`: Sets the selected verse.
|
|
78
|
+
- `setCurrentSurah(surah: Surah | null)`: Sets the current surah.
|
|
79
|
+
|
|
80
|
+
**Example:**
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
import {
|
|
84
|
+
MushafPageProvider,
|
|
85
|
+
useMushafContext,
|
|
86
|
+
} from '@src/components/MushafReader/contexts/MushafPage/MushafPageProvider';
|
|
87
|
+
import Mushaf from '@src/components/MushafReader';
|
|
88
|
+
|
|
89
|
+
function App() {
|
|
90
|
+
return (
|
|
91
|
+
<MushafPageProvider dataId="quran-hafs" pageNumber={1} initialIsTwoPagesView={true}>
|
|
92
|
+
<MushafReader />
|
|
93
|
+
</MushafPageProvider>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function MushafReader() {
|
|
98
|
+
const {
|
|
99
|
+
pageNumber,
|
|
100
|
+
currentSurah,
|
|
101
|
+
fontScale,
|
|
102
|
+
increaseFontScale,
|
|
103
|
+
decreaseFontScale,
|
|
104
|
+
setSelectedVerse,
|
|
105
|
+
} = useMushafContext();
|
|
106
|
+
|
|
107
|
+
const handleWordClick = (word) => {
|
|
108
|
+
// select the verse the word belongs to
|
|
109
|
+
setSelectedVerse(word.verse);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const handleWordHover = (word) => {
|
|
113
|
+
console.log('Word hovered:', word);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
return (
|
|
117
|
+
<div>
|
|
118
|
+
<header>
|
|
119
|
+
<h1>
|
|
120
|
+
Page {pageNumber} - Surah {currentSurah?.name}
|
|
121
|
+
</h1>
|
|
122
|
+
<div>
|
|
123
|
+
<button onClick={decreaseFontScale}>A-</button>
|
|
124
|
+
<span>Font size: {fontScale}</span>
|
|
125
|
+
<button onClick={increaseFontScale}>A+</button>
|
|
126
|
+
</div>
|
|
127
|
+
</header>
|
|
128
|
+
<Mushaf onWordClick={handleWordClick} onWordHover={handleWordHover} />
|
|
129
|
+
</div>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 3. `Mushaf` Component
|
|
135
|
+
|
|
136
|
+
This component consumes the data fetched by `MushafPageProvider` and renders the actual Mushaf page(s).
|
|
137
|
+
|
|
138
|
+
It accepts several optional props to handle user interactions and styling.
|
|
139
|
+
|
|
140
|
+
**Props:**
|
|
141
|
+
|
|
142
|
+
- `onWordClick(word: Word)`: A callback function that triggers when a user clicks on a specific word. The `word` object contains detailed information about the word, including its location, text, and verse key.
|
|
143
|
+
- `onWordHover(word: Word)`: A callback function that triggers when a user hovers over a word.
|
|
144
|
+
- `styleOverride`: An object to override default styles. See the "Overriding Styles" section for more details.
|
|
145
|
+
|
|
146
|
+
## How It Works: The Rendering Process
|
|
147
|
+
|
|
148
|
+
Rendering a Mushaf page is a complex process that this library simplifies into a hierarchy of components.
|
|
149
|
+
|
|
150
|
+
1. **`Line.tsx`** (`@src/components/MushafReader/ReadingView/Line.tsx`): The Mushaf page is broken down into lines. This component is responsible for rendering a single line of text, including chapter headers where necessary.
|
|
151
|
+
|
|
152
|
+
2. **`VerseText.tsx`** (`@src/components/Verse/VerseText.tsx`): Each line contains words from one or more verses. `VerseText` takes an array of word objects and maps over them to render the verse. It handles text alignment and applies the correct font class based on the selected narration and font scale.
|
|
153
|
+
|
|
154
|
+
3. **`MushafWord.tsx`** (`@src/components/dls/MushafWord/MushafWord.tsx`): This is the most granular component, responsible for rendering a single Mushaf word. It attaches the `onClick` and `onMouseEnter` event listeners and applies the specific font-family for the current narration via CSS classes defined in `MushafWord.module.scss`.
|
|
155
|
+
|
|
156
|
+
## Styling
|
|
157
|
+
|
|
158
|
+
The library's styling is managed through SCSS, offering a high degree of customization.
|
|
159
|
+
|
|
160
|
+
- **Component Styles**: Each component has its own scoped styles using SCSS modules (e.g., `MushafWord.module.scss`).
|
|
161
|
+
- **Global Styles** (`@src/styles/`): This directory contains the global styling configuration.
|
|
162
|
+
- **Fonts**: The `@font-face` declarations for all supported narrations are located in `@src/styles/fonts.scss`.
|
|
163
|
+
- **Responsiveness**: Breakpoints for various screen sizes are defined in `@src/styles/_breakpoints.scss` to ensure the layout is responsive.
|
|
164
|
+
|
|
165
|
+
## Overriding Styles
|
|
166
|
+
|
|
167
|
+
You can easily override the default component styles by passing a `styleOverride` object to the `Mushaf` component. This object allows you to set specific CSS variables at runtime.
|
|
168
|
+
|
|
169
|
+
**Available Options:**
|
|
170
|
+
|
|
171
|
+
- `wordHighlightColor` (string): The color of a word when it is hovered or highlighted.
|
|
172
|
+
- `chapterHeaderFontSize` (string): The font size for the chapter headers (surah names).
|
|
173
|
+
- `primaryFontColor` (string): The primary color of the Quranic text.
|
|
174
|
+
|
|
175
|
+
**Example:**
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
function MushafReader() {
|
|
179
|
+
const styleOverride = {
|
|
180
|
+
wordHighlightColor: '#00aaff', // A light blue highlight
|
|
181
|
+
chapterHeaderFontSize: '2.5rem',
|
|
182
|
+
primaryFontColor: '#333333', // A dark gray for the text
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
return (
|
|
186
|
+
<div>
|
|
187
|
+
{/* ... header and controls ... */}
|
|
188
|
+
<Mushaf styleOverride={styleOverride} />
|
|
189
|
+
</div>
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
package/dist/App.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare const classnames: {
|
|
2
|
+
ChapterIconContainer: {
|
|
3
|
+
iconContainer: string;
|
|
4
|
+
};
|
|
5
|
+
MushafWord: {
|
|
6
|
+
container: string;
|
|
7
|
+
colored: string;
|
|
8
|
+
filled: string;
|
|
9
|
+
highlightOnHover: string;
|
|
10
|
+
highlighted: string;
|
|
11
|
+
};
|
|
12
|
+
ReadingView: {
|
|
13
|
+
container: string;
|
|
14
|
+
};
|
|
15
|
+
VerseText: {
|
|
16
|
+
highlighted: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export default classnames;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as Word } from '../../../types/Word';
|
|
2
|
+
type LineProps = {
|
|
3
|
+
words: Word[];
|
|
4
|
+
lineKey: string;
|
|
5
|
+
isBigTextLayout: boolean;
|
|
6
|
+
pageIndex: number;
|
|
7
|
+
lineIndex: number;
|
|
8
|
+
onWordClick?: (word: Word, event: React.MouseEvent<HTMLElement>) => void;
|
|
9
|
+
onWordHover?: (word: Word, event: React.MouseEvent<HTMLElement>) => void;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: import('react').MemoExoticComponent<({ lineKey, words, isBigTextLayout, pageIndex, lineIndex, onWordClick, onWordHover, }: LineProps) => import("react/jsx-runtime").JSX.Element>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { default as Word } from '../../../types/Word';
|
|
3
|
+
import { Ayah } from '../../../types/verses';
|
|
4
|
+
type PageProps = {
|
|
5
|
+
verses: Ayah[];
|
|
6
|
+
pageNumber: number;
|
|
7
|
+
pageIndex: number;
|
|
8
|
+
onWordClick?: (word: Word, event: React.MouseEvent<HTMLElement>) => void;
|
|
9
|
+
onWordHover?: (word: Word, event: React.MouseEvent<HTMLElement>) => void;
|
|
10
|
+
};
|
|
11
|
+
declare const Page: ({ verses, pageNumber, pageIndex, onWordClick, onWordHover }: PageProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default Page;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as Word } from '../../../types/Word';
|
|
2
|
+
import { Ayah } from '../../../types/verses';
|
|
3
|
+
/**
|
|
4
|
+
* Groups verses into lines to match the Mushaf Page layout
|
|
5
|
+
* The returning value is an object containing the page and line number as a key,
|
|
6
|
+
* and array of word for the value. E.g.
|
|
7
|
+
* {
|
|
8
|
+
* Page1-Line2: [words],
|
|
9
|
+
* Page1-Line3: [words]
|
|
10
|
+
* ...
|
|
11
|
+
* }
|
|
12
|
+
*
|
|
13
|
+
* @returns {Record<string, Word[]>}
|
|
14
|
+
*/
|
|
15
|
+
declare const groupLinesByVerses: (verses: Ayah[]) => Record<string, Word[]>;
|
|
16
|
+
export default groupLinesByVerses;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as Word } from '../../../../types/Word';
|
|
2
|
+
type NarrationId = 'quran-hafs' | 'quran-shoba' | 'quran-warsh' | 'quran-qunbul' | 'quran-qaloon' | 'quran-alsoosi' | 'quran-aldouri' | 'quran-albazzi';
|
|
3
|
+
type ReciterId = 'ar.muhammadabdulhakim.albazzi' | 'ar.sufi.aldouri' | 'ar.husary.aldouri' | 'ar.belalya.warsh' | 'ar.abdurrahmaansudais.hafs' | 'ar.hanirifai.hafs' | 'ar.minshawimujawwad.hafs' | 'ar.abdulbasitmurattal.hafs' | 'ar.husarymujawwad.hafs' | 'ar.sufi.alsoosi' | 'ar.aljazairi.warsh' | 'ar.parhizgar.hafs' | 'ar.abdulsamad.warsh' | 'ar.muhammadabdulkareem.warsh' | 'ar.husary.qaloon' | 'ar.sufi.shoba' | 'ar.alkouchi.warsh' | 'ar.alnaehy.qaloon' | 'ar.abdulhakimabdullatif.shoba' | 'ar.aldaghoush.warsh' | 'ar.qanyouh.qaloon' | 'ar.abusneineh.qaloon' | 'ar.husary.warsh' | 'ar.muhammadabdulhakim.qunbul' | 'ar.ibrahimakhdar.hafs' | 'ar.abdullahbasfar.hafs' | 'ar.shaatree.hafs' | 'ar.ahmedajamy.hafs' | 'ar.alafasy.hafs' | 'ar.husary.hafs' | 'ar.hudhaify.hafs' | 'ar.mahermuaiqly.hafs' | 'ar.minshawi.hafs' | 'ar.muhammadayyoub.hafs' | 'ar.muhammadjibreel.hafs' | 'ar.saoodshuraym.hafs' | 'ar.aymanswoaid.hafs' | 'ar.abdulsamad.hafs';
|
|
4
|
+
export type DataId = NarrationId | ReciterId;
|
|
5
|
+
export interface MushafPageProps {
|
|
6
|
+
onWordClick?: (word: Word, event: React.MouseEvent<HTMLElement>) => void;
|
|
7
|
+
onWordHover?: (word: Word, event: React.MouseEvent<HTMLElement>) => void;
|
|
8
|
+
onPageLoad?: (pageNumber: number) => void;
|
|
9
|
+
styleOverride?: {
|
|
10
|
+
wordHighlightColor?: string;
|
|
11
|
+
chapterHeaderFontSize?: string;
|
|
12
|
+
primaryFontColor?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Ayah, Surah } from '../../../../types/verses';
|
|
3
|
+
import { DataId } from './MushafPage.types';
|
|
4
|
+
import { MushafPageDataType } from './types';
|
|
5
|
+
type MushafPageProviderProps = {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
dataId: DataId;
|
|
8
|
+
pageNumber: number;
|
|
9
|
+
initialFontScale?: number;
|
|
10
|
+
hasBorder?: boolean;
|
|
11
|
+
initialIsTwoPagesView?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const MushafPageProvider: React.FC<MushafPageProviderProps>;
|
|
14
|
+
/** Convenience: keep a compat hook name if you prefer */
|
|
15
|
+
export declare const useMushafContext: () => {
|
|
16
|
+
increaseFontScale: () => void;
|
|
17
|
+
decreaseFontScale: () => void;
|
|
18
|
+
setSelectedVerse: React.Dispatch<React.SetStateAction<Ayah | null>>;
|
|
19
|
+
setCurrentSurah: React.Dispatch<React.SetStateAction<Surah | null>>;
|
|
20
|
+
refresh: () => void;
|
|
21
|
+
fontScale: number;
|
|
22
|
+
selectedVerse: Ayah | null;
|
|
23
|
+
currentSurah: Surah | null;
|
|
24
|
+
ayat: MushafPageDataType | null;
|
|
25
|
+
nextPageAyat: MushafPageDataType | null;
|
|
26
|
+
error: Error | null;
|
|
27
|
+
loading: boolean;
|
|
28
|
+
pageNumber: number;
|
|
29
|
+
dataId: DataId;
|
|
30
|
+
hasBorder: boolean;
|
|
31
|
+
isTwoPagesView: boolean;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as Word } from '../../types/Word';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
type MushafReaderProps = {
|
|
4
|
+
onWordClick?: (word: Word, event: React.MouseEvent<HTMLElement>) => void;
|
|
5
|
+
onWordHover?: (word: Word, event: React.MouseEvent<HTMLElement>) => void;
|
|
6
|
+
styleOverride?: {
|
|
7
|
+
wordHighlightColor?: string;
|
|
8
|
+
chapterHeaderFontSize?: string;
|
|
9
|
+
primaryFontColor?: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
declare const Mushaf: ({ onWordClick, onWordHover, styleOverride }: MushafReaderProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export default Mushaf;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { default as Word } from '../../types/Word';
|
|
3
|
+
type VerseTextProps = {
|
|
4
|
+
words: Word[];
|
|
5
|
+
isHighlighted?: boolean;
|
|
6
|
+
shouldShowH1ForSEO?: boolean;
|
|
7
|
+
onWordClick?: (word: Word, event: React.MouseEvent<HTMLElement>) => void;
|
|
8
|
+
onWordHover?: (word: Word, event: React.MouseEvent<HTMLElement>) => void;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: React.MemoExoticComponent<({ words, isHighlighted, shouldShowH1ForSEO, onWordClick, onWordHover, }: VerseTextProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Util function to check if page or specific line should be center aligned to
|
|
3
|
+
* resemble the printed Madani Mushaf.
|
|
4
|
+
*
|
|
5
|
+
* @param {number} pageNumber
|
|
6
|
+
* @param {number} lineNumber
|
|
7
|
+
* @param {MushafFont} mushafFont
|
|
8
|
+
* @returns {boolean}
|
|
9
|
+
*/
|
|
10
|
+
declare const isCenterAlignedPage: (pageNumber: number, lineNumber: number) => boolean;
|
|
11
|
+
export default isCenterAlignedPage;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as Word } from '../../../types/Word';
|
|
2
|
+
type MushafWordProps = {
|
|
3
|
+
word: Word;
|
|
4
|
+
onWordClick?: (word: Word, event: React.MouseEvent<HTMLElement>) => void;
|
|
5
|
+
onWordHover?: (word: Word, event: React.MouseEvent<HTMLElement>) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import('react').MemoExoticComponent<({ word, onWordClick, onWordHover }: MushafWordProps) => import("react/jsx-runtime").JSX.Element>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const HOST_API = "https://api.quranhub.com/";
|