@qirtaas/core 0.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/LICENSE +21 -0
- package/README.md +60 -0
- package/dist/client.d.ts +27 -0
- package/dist/components/EmbedEditorApp.vue.d.ts +29 -0
- package/dist/components/EmbedRendererApp.vue.d.ts +16 -0
- package/dist/composables/useDocumentAutosave.d.ts +41 -0
- package/dist/composables/useHadithDetail.d.ts +44 -0
- package/dist/composables/useIsMobile.d.ts +3 -0
- package/dist/composables/useVerseDetail.d.ts +66 -0
- package/dist/data/mushaf.d.ts +19 -0
- package/dist/editor/AtomBubbleMenu.vue.d.ts +26 -0
- package/dist/editor/DocumentEditor.vue.d.ts +29 -0
- package/dist/editor/EditorToolbar.vue.d.ts +19 -0
- package/dist/editor/EmojiMenu.vue.d.ts +20 -0
- package/dist/editor/FindReplaceBar.vue.d.ts +14 -0
- package/dist/editor/HadithDetailPanel.vue.d.ts +3 -0
- package/dist/editor/HadithNodeView.vue.d.ts +17 -0
- package/dist/editor/HadithSearchDialog.vue.d.ts +22 -0
- package/dist/editor/HonorificView.vue.d.ts +11 -0
- package/dist/editor/ImageUploadDialog.vue.d.ts +12 -0
- package/dist/editor/QuranSearchDialog.vue.d.ts +51 -0
- package/dist/editor/QuranVerseView.vue.d.ts +23 -0
- package/dist/editor/ReportDataDialog.vue.d.ts +12 -0
- package/dist/editor/SlashMenu.vue.d.ts +12 -0
- package/dist/editor/TableBubbleMenu.vue.d.ts +7 -0
- package/dist/editor/VerseDetailContainer.vue.d.ts +6 -0
- package/dist/editor/VerseDetailPanel.vue.d.ts +3 -0
- package/dist/editor/WordRangePicker.vue.d.ts +37 -0
- package/dist/editor/docUtils.d.ts +4 -0
- package/dist/editor/emojiSuggestion.d.ts +37 -0
- package/dist/editor/extensions/HadithNode.d.ts +8 -0
- package/dist/editor/extensions/Honorific.d.ts +9 -0
- package/dist/editor/extensions/ImageNode.d.ts +14 -0
- package/dist/editor/extensions/QuranMushaf.d.ts +18 -0
- package/dist/editor/extensions/QuranVerse.d.ts +15 -0
- package/dist/editor/extensions/SearchReplace.d.ts +31 -0
- package/dist/editor/extensions/SlashCommand.d.ts +8 -0
- package/dist/editor/extensions/resizableImageNodeView.d.ts +10 -0
- package/dist/editor/quran/MushafPage.vue.d.ts +17 -0
- package/dist/editor/quran/PagePicker.vue.d.ts +12 -0
- package/dist/editor/quran/QuranSearchStep.vue.d.ts +15 -0
- package/dist/editor/quran/SurahBrowserStep.vue.d.ts +65 -0
- package/dist/editor/quran/WordSelectStep.vue.d.ts +32 -0
- package/dist/editor/quran/formatReference.d.ts +12 -0
- package/dist/editor/quran/useQuranSelection.d.ts +50 -0
- package/dist/editor/runtime/analytics.d.ts +3 -0
- package/dist/editor/runtime/context.d.ts +8 -0
- package/dist/i18n/ar.d.ts +159 -0
- package/dist/i18n/en.d.ts +159 -0
- package/dist/index.d.ts +4 -0
- package/dist/mount/deleteDocument.d.ts +11 -0
- package/dist/mount/duplicateDocument.d.ts +15 -0
- package/dist/mount/editor.d.ts +11 -0
- package/dist/mount/overlay.d.ts +10 -0
- package/dist/mount/renderer.d.ts +10 -0
- package/dist/mount/types.d.ts +80 -0
- package/dist/qirtaas.css +1 -0
- package/dist/qirtaas.js +77248 -0
- package/dist/qirtaas.umd.js +2218 -0
- package/dist/services/contentChannel.d.ts +6 -0
- package/dist/services/documents.d.ts +23 -0
- package/dist/services/embedTransport.d.ts +11 -0
- package/dist/services/fetchChannel.d.ts +17 -0
- package/dist/services/hadith.d.ts +18 -0
- package/dist/services/images.d.ts +10 -0
- package/dist/services/quran.d.ts +52 -0
- package/dist/services/rendererTransport.d.ts +12 -0
- package/dist/services/tokenManager.d.ts +12 -0
- package/dist/services/transport.d.ts +18 -0
- package/dist/styles/primevuePreset.d.ts +12 -0
- package/package.json +59 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alrimaal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# @qirtaas/core
|
|
2
|
+
|
|
3
|
+
Framework-agnostic, embeddable rich-text editor SDK for Islamic scholarly
|
|
4
|
+
writing (Qur'an verses, hadith, RTL/Arabic typography). Ships a single bundle
|
|
5
|
+
with a self-contained mount API and its own scoped styles, so it drops into any
|
|
6
|
+
host page without leaking CSS or fighting the host's framework.
|
|
7
|
+
|
|
8
|
+
For React or Vue hosts, prefer the idiomatic wrappers
|
|
9
|
+
[`@qirtaas/react`](https://www.npmjs.com/package/@qirtaas/react) and
|
|
10
|
+
[`@qirtaas/vue`](https://www.npmjs.com/package/@qirtaas/vue).
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm install @qirtaas/core
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage (ESM)
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
import { createQirtaasClient } from "@qirtaas/core";
|
|
22
|
+
import "@qirtaas/core/qirtaas.css";
|
|
23
|
+
|
|
24
|
+
const qirtaas = createQirtaasClient({
|
|
25
|
+
apiUrl: "https://api.example.com",
|
|
26
|
+
getToken: () => fetchEmbedJwt(), // called on init, before expiry, and on 401
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const editor = qirtaas.mountEditor("#editor", {
|
|
30
|
+
documentId: "<uuid>",
|
|
31
|
+
locale: "en",
|
|
32
|
+
theme: "light",
|
|
33
|
+
onReady: () => console.log("ready"),
|
|
34
|
+
onChange: (json) => console.log(json),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// Read-only renderer (public read via a share token):
|
|
38
|
+
qirtaas.mountRenderer("#renderer", {
|
|
39
|
+
shareToken: "<token>",
|
|
40
|
+
theme: "light",
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Usage (script tag / UMD)
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<link rel="stylesheet" href="https://unpkg.com/@qirtaas/core/dist/qirtaas.css" />
|
|
48
|
+
<script src="https://unpkg.com/@qirtaas/core/dist/qirtaas.umd.js"></script>
|
|
49
|
+
<script>
|
|
50
|
+
const qirtaas = Qirtaas.createQirtaasClient({ apiUrl, getToken });
|
|
51
|
+
qirtaas.mountEditor("#editor", { documentId });
|
|
52
|
+
</script>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The host must give the editor mount element a bounded height; the renderer grows
|
|
56
|
+
with its content.
|
|
57
|
+
|
|
58
|
+
## License
|
|
59
|
+
|
|
60
|
+
MIT
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DuplicateDocumentResult } from './mount/duplicateDocument';
|
|
2
|
+
import { EditorMountOptions, EditorInstance, RendererMountOptions, RendererInstance } from './mount/types';
|
|
3
|
+
export interface QirtaasClientOptions {
|
|
4
|
+
/** Qirtaas API base URL. Default: https://api.qirtaas.io */
|
|
5
|
+
apiUrl?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Returns a short-lived embed token, shared by the editor, deleteDocument and
|
|
8
|
+
* duplicateDocument (called on init, before exp, and on 401). Optional: a
|
|
9
|
+
* renderer-only client — which carries its own per-read auth — can omit it;
|
|
10
|
+
* mountEditor, deleteDocument and duplicateDocument throw if it is missing.
|
|
11
|
+
*/
|
|
12
|
+
getToken?: () => Promise<string> | string;
|
|
13
|
+
}
|
|
14
|
+
export interface QirtaasClient {
|
|
15
|
+
/** Boot the editor onto a host node, authorized by the client's getToken. */
|
|
16
|
+
mountEditor(el: Element | string, options?: EditorMountOptions): EditorInstance;
|
|
17
|
+
/** Boot the read-only renderer; auth (signature/token/shareToken) is per-call. */
|
|
18
|
+
mountRenderer(el: Element | string, options: RendererMountOptions): RendererInstance;
|
|
19
|
+
/** Delete a document over the embed-token channel (no mount required). */
|
|
20
|
+
deleteDocument(documentId: string): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Copy a document's content into a new document, returning the new id. Lets a
|
|
23
|
+
* host keep a stable published document while the author edits a private clone.
|
|
24
|
+
*/
|
|
25
|
+
duplicateDocument(documentId: string): Promise<DuplicateDocumentResult>;
|
|
26
|
+
}
|
|
27
|
+
export declare function createQirtaasClient(config?: QirtaasClientOptions): QirtaasClient;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ErrorCode, Json, SaveState } from '../mount/types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
documentId?: string;
|
|
4
|
+
initialContent?: Json | null;
|
|
5
|
+
editable?: boolean;
|
|
6
|
+
autofocus?: boolean;
|
|
7
|
+
theme?: "light" | "dark";
|
|
8
|
+
autosaveEnabled?: boolean;
|
|
9
|
+
autosaveDebounceMs?: number;
|
|
10
|
+
onReady?: () => void;
|
|
11
|
+
onChange?: (json: Json) => void;
|
|
12
|
+
onSaveStateChange?: (state: SaveState) => void;
|
|
13
|
+
onDocumentCreated?: (id: string) => void;
|
|
14
|
+
onError?: (code: ErrorCode, detail?: unknown) => void;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {
|
|
17
|
+
getJSON: () => Json | null;
|
|
18
|
+
save: () => Promise<void>;
|
|
19
|
+
setEditable: (editable: boolean) => void | undefined;
|
|
20
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
21
|
+
autofocus: boolean;
|
|
22
|
+
theme: "light" | "dark";
|
|
23
|
+
editable: boolean;
|
|
24
|
+
initialContent: Json | null;
|
|
25
|
+
autosaveEnabled: boolean;
|
|
26
|
+
autosaveDebounceMs: number;
|
|
27
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ErrorCode, Json } from '../mount/types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** Resolves the read-only document content (auth handled by the transport). */
|
|
4
|
+
load: () => Promise<Json | null>;
|
|
5
|
+
/** Forwarded to the editor so image reads carry `document_id` — required for
|
|
6
|
+
the signature read path to authorize linked images. */
|
|
7
|
+
documentId?: string;
|
|
8
|
+
theme?: "light" | "dark";
|
|
9
|
+
onReady?: () => void;
|
|
10
|
+
onError?: (code: ErrorCode, detail?: unknown) => void;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
13
|
+
theme: "light" | "dark";
|
|
14
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const _default: typeof __VLS_export;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { Json, SaveState } from '../mount/types';
|
|
3
|
+
export interface DocumentAutosaveOptions {
|
|
4
|
+
/** Reads the current content snapshot to persist. */
|
|
5
|
+
getContent: () => Json | null;
|
|
6
|
+
/** Persist the snapshot (create-or-update). Returns rejected image ids, if any. */
|
|
7
|
+
persist: (content: Json) => Promise<{
|
|
8
|
+
rejected_image_ids?: string[];
|
|
9
|
+
} | void>;
|
|
10
|
+
/** Skip persisting when this returns false (e.g. an empty, not-yet-created doc). */
|
|
11
|
+
shouldPersist?: (content: Json | null) => boolean;
|
|
12
|
+
/** Debounce window in ms (default 1500). */
|
|
13
|
+
debounceMs?: number;
|
|
14
|
+
/** When false, edits never schedule a save (host drives saveNow()). */
|
|
15
|
+
enabled?: boolean;
|
|
16
|
+
/** Notified on every save-state transition. */
|
|
17
|
+
onStateChange?: (state: SaveState) => void;
|
|
18
|
+
/** Notified with image ids the server refused to link. */
|
|
19
|
+
onRejectedImages?: (ids: string[]) => void;
|
|
20
|
+
/** Notified when a persist call throws (shell maps to a code / toast). */
|
|
21
|
+
onError?: (err: unknown) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface DocumentAutosave {
|
|
24
|
+
/** Current save state (reactive). */
|
|
25
|
+
state: Ref<SaveState>;
|
|
26
|
+
/** Mark content dirty and schedule a debounced save. */
|
|
27
|
+
schedule(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Flush any pending change immediately, awaiting an in-flight save first.
|
|
30
|
+
* Rejects if the persist fails (e.g. offline), so callers can react; the
|
|
31
|
+
* failure is also surfaced via `state`/`onError`.
|
|
32
|
+
*/
|
|
33
|
+
saveNow(): Promise<void>;
|
|
34
|
+
/** Reset dirty/state/timers — e.g. after loading a fresh document. */
|
|
35
|
+
reset(): void;
|
|
36
|
+
/** Whether there are unsaved changes. */
|
|
37
|
+
isDirty(): boolean;
|
|
38
|
+
/** Pause/resume saving (e.g. suspend while a document is loading). */
|
|
39
|
+
setSuspended(suspended: boolean): void;
|
|
40
|
+
}
|
|
41
|
+
export declare function useDocumentAutosave(opts: DocumentAutosaveOptions): DocumentAutosave;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { HadithResult } from '../services/hadith';
|
|
2
|
+
declare function open(slug: string, number: number): Promise<void>;
|
|
3
|
+
declare function close(): void;
|
|
4
|
+
declare function retry(): Promise<void>;
|
|
5
|
+
export declare function useHadithDetail(): {
|
|
6
|
+
isOpen: import('vue').Ref<boolean, boolean>;
|
|
7
|
+
loading: import('vue').Ref<boolean, boolean>;
|
|
8
|
+
error: import('vue').Ref<boolean, boolean>;
|
|
9
|
+
data: import('vue').Ref<{
|
|
10
|
+
id: number;
|
|
11
|
+
slug: string;
|
|
12
|
+
collection_name_arabic: string;
|
|
13
|
+
collection_name_english: string;
|
|
14
|
+
number: number | null;
|
|
15
|
+
text: string;
|
|
16
|
+
translation_en: string;
|
|
17
|
+
narrator_chain: string;
|
|
18
|
+
grade: string;
|
|
19
|
+
arabic_bab_name: string;
|
|
20
|
+
english_bab_name: string;
|
|
21
|
+
english_grade: string;
|
|
22
|
+
text_highlighted?: string | null | undefined;
|
|
23
|
+
} | null, HadithResult | {
|
|
24
|
+
id: number;
|
|
25
|
+
slug: string;
|
|
26
|
+
collection_name_arabic: string;
|
|
27
|
+
collection_name_english: string;
|
|
28
|
+
number: number | null;
|
|
29
|
+
text: string;
|
|
30
|
+
translation_en: string;
|
|
31
|
+
narrator_chain: string;
|
|
32
|
+
grade: string;
|
|
33
|
+
arabic_bab_name: string;
|
|
34
|
+
english_bab_name: string;
|
|
35
|
+
english_grade: string;
|
|
36
|
+
text_highlighted?: string | null | undefined;
|
|
37
|
+
} | null>;
|
|
38
|
+
activeSlug: import('vue').Ref<string | null, string | null>;
|
|
39
|
+
activeNumber: import('vue').Ref<number | null, number | null>;
|
|
40
|
+
open: typeof open;
|
|
41
|
+
close: typeof close;
|
|
42
|
+
retry: typeof retry;
|
|
43
|
+
};
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { VerseDetail, VerseTafsir } from '../services/quran';
|
|
2
|
+
declare function setSelectedTafsirSlug(slug: string): void;
|
|
3
|
+
declare function setSelectedTafsirLanguage(language: string): void;
|
|
4
|
+
/**
|
|
5
|
+
* Resolve the effective tafsir language:
|
|
6
|
+
* 1. User's persisted choice if still available.
|
|
7
|
+
* 2. Default mapped from UI locale (ar -> arabic, else english).
|
|
8
|
+
* 3. First available language as a final fallback.
|
|
9
|
+
*/
|
|
10
|
+
declare function resolveTafsirLanguage(uiLocale: string): string | null;
|
|
11
|
+
/** Tafsirs filtered to the currently-effective language. */
|
|
12
|
+
declare function tafsirsForLanguage(language: string | null): VerseTafsir[];
|
|
13
|
+
declare function open(surah: number, ayah: number, locale: string): Promise<void>;
|
|
14
|
+
declare function close(): void;
|
|
15
|
+
declare function retry(locale: string): Promise<void>;
|
|
16
|
+
declare function goPrev(): Promise<void>;
|
|
17
|
+
declare function goNext(): Promise<void>;
|
|
18
|
+
export declare function useVerseDetail(): {
|
|
19
|
+
isOpen: import('vue').Ref<boolean, boolean>;
|
|
20
|
+
loading: import('vue').Ref<boolean, boolean>;
|
|
21
|
+
error: import('vue').Ref<boolean, boolean>;
|
|
22
|
+
data: import('vue').Ref<{
|
|
23
|
+
surah: number;
|
|
24
|
+
ayah: number;
|
|
25
|
+
surah_name_arabic: string;
|
|
26
|
+
surah_name_english: string;
|
|
27
|
+
arabic_text: string;
|
|
28
|
+
translation_en: string;
|
|
29
|
+
tafsirs: {
|
|
30
|
+
slug: string;
|
|
31
|
+
name: string;
|
|
32
|
+
language: string;
|
|
33
|
+
text: string;
|
|
34
|
+
}[];
|
|
35
|
+
} | null, VerseDetail | {
|
|
36
|
+
surah: number;
|
|
37
|
+
ayah: number;
|
|
38
|
+
surah_name_arabic: string;
|
|
39
|
+
surah_name_english: string;
|
|
40
|
+
arabic_text: string;
|
|
41
|
+
translation_en: string;
|
|
42
|
+
tafsirs: {
|
|
43
|
+
slug: string;
|
|
44
|
+
name: string;
|
|
45
|
+
language: string;
|
|
46
|
+
text: string;
|
|
47
|
+
}[];
|
|
48
|
+
} | null>;
|
|
49
|
+
activeSurah: import('vue').Ref<number | null, number | null>;
|
|
50
|
+
activeAyah: import('vue').Ref<number | null, number | null>;
|
|
51
|
+
selectedTafsirSlug: import('vue').Ref<string | null, string | null>;
|
|
52
|
+
setSelectedTafsirSlug: typeof setSelectedTafsirSlug;
|
|
53
|
+
selectedTafsirLanguage: import('vue').Ref<string | null, string | null>;
|
|
54
|
+
setSelectedTafsirLanguage: typeof setSelectedTafsirLanguage;
|
|
55
|
+
availableTafsirLanguages: import('vue').ComputedRef<string[]>;
|
|
56
|
+
resolveTafsirLanguage: typeof resolveTafsirLanguage;
|
|
57
|
+
tafsirsForLanguage: typeof tafsirsForLanguage;
|
|
58
|
+
open: typeof open;
|
|
59
|
+
close: typeof close;
|
|
60
|
+
retry: typeof retry;
|
|
61
|
+
hasPrev: import('vue').ComputedRef<boolean>;
|
|
62
|
+
hasNext: import('vue').ComputedRef<boolean>;
|
|
63
|
+
goPrev: typeof goPrev;
|
|
64
|
+
goNext: typeof goNext;
|
|
65
|
+
};
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface SurahInfo {
|
|
2
|
+
number: number;
|
|
3
|
+
name_arabic: string;
|
|
4
|
+
name_english: string;
|
|
5
|
+
verse_count: number;
|
|
6
|
+
first_page: number;
|
|
7
|
+
}
|
|
8
|
+
export interface VerseRef {
|
|
9
|
+
surah: number;
|
|
10
|
+
ayah: number;
|
|
11
|
+
}
|
|
12
|
+
export interface MushafPage {
|
|
13
|
+
page_number: number;
|
|
14
|
+
first: VerseRef;
|
|
15
|
+
last: VerseRef;
|
|
16
|
+
label: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const SURAHS: SurahInfo[];
|
|
19
|
+
export declare const MUSHAF_PAGES: MushafPage[];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
nodeTypes: string[];
|
|
5
|
+
};
|
|
6
|
+
declare function onAction(): void;
|
|
7
|
+
declare var __VLS_8: {
|
|
8
|
+
attrs: import('prosemirror-model').Attrs | null;
|
|
9
|
+
onAction: typeof onAction;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_Slots = {} & {
|
|
12
|
+
action?: (props: typeof __VLS_8) => any;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
15
|
+
action: (nodeType: string, attrs: Record<string, unknown>) => any;
|
|
16
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
+
onAction?: ((nodeType: string, attrs: Record<string, unknown>) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue: Record<string, unknown> | null;
|
|
3
|
+
editable?: boolean;
|
|
4
|
+
autofocus?: boolean;
|
|
5
|
+
documentId?: string;
|
|
6
|
+
};
|
|
7
|
+
declare function insertImageFromInput(file: File): void;
|
|
8
|
+
declare function insertTable(): void;
|
|
9
|
+
declare function openQuranDialog(): void;
|
|
10
|
+
declare function openHadithDialog(): void;
|
|
11
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {
|
|
12
|
+
editor: import('vue').ShallowRef<import('@tiptap/vue-3').Editor | undefined, import('@tiptap/vue-3').Editor | undefined>;
|
|
13
|
+
openQuranDialog: typeof openQuranDialog;
|
|
14
|
+
openHadithDialog: typeof openHadithDialog;
|
|
15
|
+
insertTable: typeof insertTable;
|
|
16
|
+
insertImageFromInput: typeof insertImageFromInput;
|
|
17
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
18
|
+
"update:modelValue": (value: Record<string, unknown>) => any;
|
|
19
|
+
ready: () => any;
|
|
20
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
"onUpdate:modelValue"?: ((value: Record<string, unknown>) => any) | undefined;
|
|
22
|
+
onReady?: (() => any) | undefined;
|
|
23
|
+
}>, {
|
|
24
|
+
autofocus: boolean;
|
|
25
|
+
editable: boolean;
|
|
26
|
+
documentId: string;
|
|
27
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor: Editor | undefined;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
6
|
+
"open-quran": () => any;
|
|
7
|
+
"open-hadith": () => any;
|
|
8
|
+
"insert-table": () => any;
|
|
9
|
+
"open-find-replace": () => any;
|
|
10
|
+
"insert-image": (file: File) => any;
|
|
11
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
"onOpen-quran"?: (() => any) | undefined;
|
|
13
|
+
"onOpen-hadith"?: (() => any) | undefined;
|
|
14
|
+
"onInsert-table"?: (() => any) | undefined;
|
|
15
|
+
"onOpen-find-replace"?: (() => any) | undefined;
|
|
16
|
+
"onInsert-image"?: ((file: File) => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
items: {
|
|
3
|
+
name: string;
|
|
4
|
+
emoji?: string;
|
|
5
|
+
}[];
|
|
6
|
+
selectedIndex: number;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
+
select: (item: {
|
|
10
|
+
name: string;
|
|
11
|
+
emoji?: string;
|
|
12
|
+
}) => any;
|
|
13
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
onSelect?: ((item: {
|
|
15
|
+
name: string;
|
|
16
|
+
emoji?: string;
|
|
17
|
+
}) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
};
|
|
5
|
+
declare function focusInput(): void;
|
|
6
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {
|
|
7
|
+
focus: typeof focusInput;
|
|
8
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
+
close: () => any;
|
|
10
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
onClose?: (() => any) | undefined;
|
|
12
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
node: {
|
|
4
|
+
attrs: {
|
|
5
|
+
collectionNameArabic: string;
|
|
6
|
+
collectionNameEnglish: string;
|
|
7
|
+
number: number;
|
|
8
|
+
text: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
editor: Editor;
|
|
12
|
+
getPos: () => number;
|
|
13
|
+
deleteNode: () => void;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
visible: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
5
|
+
insert: (data: {
|
|
6
|
+
collectionNameArabic: string;
|
|
7
|
+
collectionNameEnglish: string;
|
|
8
|
+
number: number | null;
|
|
9
|
+
text: string;
|
|
10
|
+
}) => any;
|
|
11
|
+
"update:visible": (value: boolean) => any;
|
|
12
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
onInsert?: ((data: {
|
|
14
|
+
collectionNameArabic: string;
|
|
15
|
+
collectionNameEnglish: string;
|
|
16
|
+
number: number | null;
|
|
17
|
+
text: string;
|
|
18
|
+
}) => any) | undefined;
|
|
19
|
+
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
20
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HonorificType } from './extensions/Honorific';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
node: {
|
|
4
|
+
attrs: {
|
|
5
|
+
type: HonorificType;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
file: File | null;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
5
|
+
cancel: () => any;
|
|
6
|
+
uploaded: (imageId: string) => any;
|
|
7
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
8
|
+
onCancel?: (() => any) | undefined;
|
|
9
|
+
onUploaded?: ((imageId: string) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Endpoint } from './quran/useQuranSelection';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
visible: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
6
|
+
insert: (data: {
|
|
7
|
+
surah: number;
|
|
8
|
+
ayah: number;
|
|
9
|
+
fromAyah: number | null;
|
|
10
|
+
toAyah: number | null;
|
|
11
|
+
fromWord: number | null;
|
|
12
|
+
toWord: number | null;
|
|
13
|
+
surahNameArabic: string;
|
|
14
|
+
surahNameEnglish: string;
|
|
15
|
+
text: string;
|
|
16
|
+
}) => any;
|
|
17
|
+
insertMushaf: (data: {
|
|
18
|
+
page: number;
|
|
19
|
+
lineStart: number;
|
|
20
|
+
lineEnd: number;
|
|
21
|
+
from: Endpoint;
|
|
22
|
+
to: Endpoint;
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
}) => any;
|
|
26
|
+
"update:visible": (value: boolean) => any;
|
|
27
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
28
|
+
onInsert?: ((data: {
|
|
29
|
+
surah: number;
|
|
30
|
+
ayah: number;
|
|
31
|
+
fromAyah: number | null;
|
|
32
|
+
toAyah: number | null;
|
|
33
|
+
fromWord: number | null;
|
|
34
|
+
toWord: number | null;
|
|
35
|
+
surahNameArabic: string;
|
|
36
|
+
surahNameEnglish: string;
|
|
37
|
+
text: string;
|
|
38
|
+
}) => any) | undefined;
|
|
39
|
+
onInsertMushaf?: ((data: {
|
|
40
|
+
page: number;
|
|
41
|
+
lineStart: number;
|
|
42
|
+
lineEnd: number;
|
|
43
|
+
from: Endpoint;
|
|
44
|
+
to: Endpoint;
|
|
45
|
+
width: number;
|
|
46
|
+
height: number;
|
|
47
|
+
}) => any) | undefined;
|
|
48
|
+
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
49
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
50
|
+
declare const _default: typeof __VLS_export;
|
|
51
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/core';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
node: {
|
|
4
|
+
attrs: {
|
|
5
|
+
surah: number;
|
|
6
|
+
ayah: number;
|
|
7
|
+
fromAyah: number | null;
|
|
8
|
+
toAyah: number | null;
|
|
9
|
+
fromWord: number | null;
|
|
10
|
+
toWord: number | null;
|
|
11
|
+
surahNameArabic: string;
|
|
12
|
+
surahNameEnglish: string;
|
|
13
|
+
text: string;
|
|
14
|
+
encoding: "uthmani" | "qpc_hafs";
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
editor: Editor;
|
|
18
|
+
getPos: () => number;
|
|
19
|
+
deleteNode: () => void;
|
|
20
|
+
};
|
|
21
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
visible: boolean;
|
|
3
|
+
kind: "quran" | "hadith";
|
|
4
|
+
reference: string;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
"update:visible": (value: boolean) => any;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SlashCommandItem } from './extensions/SlashCommand';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
items: SlashCommandItem[];
|
|
4
|
+
selectedIndex: number;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
select: (item: SlashCommandItem) => any;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onSelect?: ((item: SlashCommandItem) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Editor } from '@tiptap/vue-3';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
overlay?: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|