@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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** The full text to pick a word range from. */
|
|
3
|
+
text: string;
|
|
4
|
+
/** Initial [from, to] word indices. Defaults to the whole text. */
|
|
5
|
+
initialRange?: [number, number] | null;
|
|
6
|
+
/**
|
|
7
|
+
* Tailwind classes controlling the text's font, size and leading, e.g.
|
|
8
|
+
* `font-quran text-[22px] leading-[2.4]`. Layout/colour are fixed.
|
|
9
|
+
*/
|
|
10
|
+
textClass?: string;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
+
change: (payload: {
|
|
14
|
+
fromWord: number;
|
|
15
|
+
toWord: number;
|
|
16
|
+
/** True when the selection spans the entire text. */
|
|
17
|
+
isFull: boolean;
|
|
18
|
+
/** False while the user has placed Start and is waiting to place End. */
|
|
19
|
+
complete: boolean;
|
|
20
|
+
text: string;
|
|
21
|
+
}) => any;
|
|
22
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
23
|
+
onChange?: ((payload: {
|
|
24
|
+
fromWord: number;
|
|
25
|
+
toWord: number;
|
|
26
|
+
/** True when the selection spans the entire text. */
|
|
27
|
+
isFull: boolean;
|
|
28
|
+
/** False while the user has placed Start and is waiting to place End. */
|
|
29
|
+
complete: boolean;
|
|
30
|
+
text: string;
|
|
31
|
+
}) => any) | undefined;
|
|
32
|
+
}>, {
|
|
33
|
+
initialRange: [number, number] | null;
|
|
34
|
+
textClass: string;
|
|
35
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const _default: typeof __VLS_export;
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Check if a TipTap JSON doc has no meaningful content (only empty paragraphs / hard breaks). */
|
|
2
|
+
export declare function docIsEmpty(json: Record<string, unknown>): boolean;
|
|
3
|
+
/** Check if a TipTap JSON doc contains a node of the given type. */
|
|
4
|
+
export declare function docContainsNode(json: Record<string, unknown>, nodeType: string): boolean;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { EmojiItem } from '@tiptap/extension-emoji';
|
|
2
|
+
import { Editor, Range } from '@tiptap/core';
|
|
3
|
+
type MenuItem = (EmojiItem | HonorificMenuItem) & {
|
|
4
|
+
emoji?: string;
|
|
5
|
+
};
|
|
6
|
+
type HonorificMenuItem = {
|
|
7
|
+
name: string;
|
|
8
|
+
emoji: string;
|
|
9
|
+
shortcodes: string[];
|
|
10
|
+
tags: string[];
|
|
11
|
+
isHonorific: true;
|
|
12
|
+
honorificType: "jj" | "saw";
|
|
13
|
+
};
|
|
14
|
+
type SuggestionProps = {
|
|
15
|
+
clientRect?: (() => DOMRect | null) | null;
|
|
16
|
+
items: MenuItem[];
|
|
17
|
+
command: (item: MenuItem) => void;
|
|
18
|
+
editor: Editor;
|
|
19
|
+
range: Range;
|
|
20
|
+
};
|
|
21
|
+
export declare const emojiSuggestion: {
|
|
22
|
+
items: ({ query, editor }: {
|
|
23
|
+
query: string;
|
|
24
|
+
editor: unknown;
|
|
25
|
+
}) => (EmojiItem | (HonorificMenuItem & {
|
|
26
|
+
emoji?: string;
|
|
27
|
+
}))[];
|
|
28
|
+
render: () => {
|
|
29
|
+
onStart: (props: SuggestionProps) => void;
|
|
30
|
+
onUpdate: (props: SuggestionProps) => void;
|
|
31
|
+
onKeyDown: (props: {
|
|
32
|
+
event: KeyboardEvent;
|
|
33
|
+
}) => boolean;
|
|
34
|
+
onExit: () => void;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
import { Fragment, Schema } from '@tiptap/pm/model';
|
|
3
|
+
export type HonorificType = "jj" | "saw";
|
|
4
|
+
/**
|
|
5
|
+
* Parses a string for :shortcode: patterns and returns a ProseMirror Fragment
|
|
6
|
+
* with text nodes and honorific nodes. Used by find-replace.
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseReplacementText(text: string, schema: Schema): Fragment;
|
|
9
|
+
export declare const Honorific: Node<any, any>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export type ImageAlign = "left" | "center" | "right";
|
|
3
|
+
export interface ImageNodeAttributes {
|
|
4
|
+
imageId: string;
|
|
5
|
+
alt: string;
|
|
6
|
+
width: number | null;
|
|
7
|
+
height: number | null;
|
|
8
|
+
align: ImageAlign;
|
|
9
|
+
}
|
|
10
|
+
export interface ImageNodeOptions {
|
|
11
|
+
documentId?: string;
|
|
12
|
+
translate?: (key: string) => string;
|
|
13
|
+
}
|
|
14
|
+
export declare const ImageNode: Node<ImageNodeOptions, any>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export type MushafAlign = "left" | "center" | "right";
|
|
3
|
+
export interface QuranMushafEndpoint {
|
|
4
|
+
surah: number;
|
|
5
|
+
ayah: number;
|
|
6
|
+
word: number;
|
|
7
|
+
}
|
|
8
|
+
export interface QuranMushafAttributes {
|
|
9
|
+
page: number;
|
|
10
|
+
lineStart: number;
|
|
11
|
+
lineEnd: number;
|
|
12
|
+
from: QuranMushafEndpoint | null;
|
|
13
|
+
to: QuranMushafEndpoint | null;
|
|
14
|
+
width: number | null;
|
|
15
|
+
height: number | null;
|
|
16
|
+
align: MushafAlign;
|
|
17
|
+
}
|
|
18
|
+
export declare const QuranMushaf: Node<any, any>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
export type QuranTextEncoding = "uthmani" | "qpc_hafs";
|
|
3
|
+
export interface QuranVerseAttributes {
|
|
4
|
+
surah: number;
|
|
5
|
+
ayah: number;
|
|
6
|
+
fromAyah: number | null;
|
|
7
|
+
toAyah: number | null;
|
|
8
|
+
fromWord: number | null;
|
|
9
|
+
toWord: number | null;
|
|
10
|
+
surahNameArabic: string;
|
|
11
|
+
surahNameEnglish: string;
|
|
12
|
+
text: string;
|
|
13
|
+
encoding: QuranTextEncoding;
|
|
14
|
+
}
|
|
15
|
+
export declare const QuranVerse: Node<any, any>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Range, Extension } from '@tiptap/core';
|
|
2
|
+
import { PluginKey } from '@tiptap/pm/state';
|
|
3
|
+
export interface SearchReplaceOptions {
|
|
4
|
+
searchResultClass: string;
|
|
5
|
+
}
|
|
6
|
+
export interface SearchReplaceStorage {
|
|
7
|
+
searchTerm: string;
|
|
8
|
+
replaceTerm: string;
|
|
9
|
+
results: Range[];
|
|
10
|
+
lastSearchTerm: string;
|
|
11
|
+
caseSensitive: boolean;
|
|
12
|
+
lastCaseSensitive: boolean;
|
|
13
|
+
resultIndex: number;
|
|
14
|
+
lastResultIndex: number;
|
|
15
|
+
}
|
|
16
|
+
declare module "@tiptap/core" {
|
|
17
|
+
interface Commands<ReturnType> {
|
|
18
|
+
searchAndReplace: {
|
|
19
|
+
setSearchTerm: (searchTerm: string) => ReturnType;
|
|
20
|
+
setReplaceTerm: (replaceTerm: string) => ReturnType;
|
|
21
|
+
setCaseSensitive: (caseSensitive: boolean) => ReturnType;
|
|
22
|
+
resetIndex: () => ReturnType;
|
|
23
|
+
nextSearchResult: () => ReturnType;
|
|
24
|
+
previousSearchResult: () => ReturnType;
|
|
25
|
+
replace: () => ReturnType;
|
|
26
|
+
replaceAll: () => ReturnType;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export declare const searchReplacePluginKey: PluginKey<any>;
|
|
31
|
+
export declare const SearchReplace: Extension<SearchReplaceOptions, SearchReplaceStorage>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NodeViewRenderer, NodeViewRendererProps } from '@tiptap/core';
|
|
2
|
+
import { Node as PMNode } from '@tiptap/pm/model';
|
|
3
|
+
export type ImageAlign = "left" | "center" | "right";
|
|
4
|
+
interface Options {
|
|
5
|
+
nodeName: string;
|
|
6
|
+
buildImg: (props: NodeViewRendererProps) => HTMLImageElement;
|
|
7
|
+
syncImg?: (img: HTMLImageElement, newNode: PMNode, oldNode: PMNode) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function createResizableImageNodeView(opts: Options): NodeViewRenderer;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PageWord } from './useQuranSelection';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
page: number;
|
|
4
|
+
rangeLo: number | null;
|
|
5
|
+
rangeHi: number | null;
|
|
6
|
+
startIdx: number | null;
|
|
7
|
+
endIdx: number | null;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
+
wordTap: (globalIdx: number) => any;
|
|
11
|
+
pageLoaded: (words: PageWord[]) => any;
|
|
12
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
onWordTap?: ((globalIdx: number) => any) | undefined;
|
|
14
|
+
onPageLoaded?: ((words: PageWord[]) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MushafPage } from '../../services/quran';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
pages: MushafPage[];
|
|
4
|
+
activeIdx: number;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
select: (idx: number) => any;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onSelect?: ((idx: number) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AyahResult, SurahMatch } from '../../services/quran';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
active?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
6
|
+
selectVerse: (verse: AyahResult) => any;
|
|
7
|
+
browseSurah: (surah: SurahMatch) => any;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onSelectVerse?: ((verse: AyahResult) => any) | undefined;
|
|
10
|
+
onBrowseSurah?: ((surah: SurahMatch) => any) | undefined;
|
|
11
|
+
}>, {
|
|
12
|
+
active: boolean;
|
|
13
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Endpoint } from './useQuranSelection';
|
|
2
|
+
import { SurahMatch } from '../../services/quran';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
surah: SurahMatch;
|
|
5
|
+
preselectVerse: number | null;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
8
|
+
back: () => any;
|
|
9
|
+
insertMushaf: (payload: {
|
|
10
|
+
page: number;
|
|
11
|
+
lineStart: number;
|
|
12
|
+
lineEnd: number;
|
|
13
|
+
from: Endpoint;
|
|
14
|
+
to: Endpoint;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
}) => any;
|
|
18
|
+
insertInline: (payload: {
|
|
19
|
+
surah: number;
|
|
20
|
+
fromAyah: number;
|
|
21
|
+
toAyah: number;
|
|
22
|
+
surahNameArabic: string;
|
|
23
|
+
surahNameEnglish: string;
|
|
24
|
+
text: string;
|
|
25
|
+
}) => any;
|
|
26
|
+
refineWords: (payload: {
|
|
27
|
+
surah: number;
|
|
28
|
+
ayah: number;
|
|
29
|
+
fromWord: number;
|
|
30
|
+
toWord: number;
|
|
31
|
+
surahNameArabic: string;
|
|
32
|
+
surahNameEnglish: string;
|
|
33
|
+
text: string;
|
|
34
|
+
}) => any;
|
|
35
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
36
|
+
onBack?: (() => any) | undefined;
|
|
37
|
+
onInsertMushaf?: ((payload: {
|
|
38
|
+
page: number;
|
|
39
|
+
lineStart: number;
|
|
40
|
+
lineEnd: number;
|
|
41
|
+
from: Endpoint;
|
|
42
|
+
to: Endpoint;
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
}) => any) | undefined;
|
|
46
|
+
onInsertInline?: ((payload: {
|
|
47
|
+
surah: number;
|
|
48
|
+
fromAyah: number;
|
|
49
|
+
toAyah: number;
|
|
50
|
+
surahNameArabic: string;
|
|
51
|
+
surahNameEnglish: string;
|
|
52
|
+
text: string;
|
|
53
|
+
}) => any) | undefined;
|
|
54
|
+
onRefineWords?: ((payload: {
|
|
55
|
+
surah: number;
|
|
56
|
+
ayah: number;
|
|
57
|
+
fromWord: number;
|
|
58
|
+
toWord: number;
|
|
59
|
+
surahNameArabic: string;
|
|
60
|
+
surahNameEnglish: string;
|
|
61
|
+
text: string;
|
|
62
|
+
}) => any) | undefined;
|
|
63
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
64
|
+
declare const _default: typeof __VLS_export;
|
|
65
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AyahResult } from '../../services/quran';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
verse: AyahResult;
|
|
4
|
+
initialRange?: [number, number] | null;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
back: () => any;
|
|
8
|
+
insert: (payload: {
|
|
9
|
+
surah: number;
|
|
10
|
+
ayah: number;
|
|
11
|
+
surahNameArabic: string;
|
|
12
|
+
surahNameEnglish: string;
|
|
13
|
+
fromWord: number | null;
|
|
14
|
+
toWord: number | null;
|
|
15
|
+
text: string;
|
|
16
|
+
}) => any;
|
|
17
|
+
expandToBrowser: () => any;
|
|
18
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
19
|
+
onBack?: (() => any) | undefined;
|
|
20
|
+
onInsert?: ((payload: {
|
|
21
|
+
surah: number;
|
|
22
|
+
ayah: number;
|
|
23
|
+
surahNameArabic: string;
|
|
24
|
+
surahNameEnglish: string;
|
|
25
|
+
fromWord: number | null;
|
|
26
|
+
toWord: number | null;
|
|
27
|
+
text: string;
|
|
28
|
+
}) => any) | undefined;
|
|
29
|
+
onExpandToBrowser?: (() => any) | undefined;
|
|
30
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
declare const _default: typeof __VLS_export;
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface VerseRefAttrs {
|
|
2
|
+
surah: number;
|
|
3
|
+
surahNameArabic: string;
|
|
4
|
+
surahNameEnglish?: string;
|
|
5
|
+
ayah?: number;
|
|
6
|
+
fromAyah?: number | null;
|
|
7
|
+
toAyah?: number | null;
|
|
8
|
+
fromWord?: number | null;
|
|
9
|
+
toWord?: number | null;
|
|
10
|
+
}
|
|
11
|
+
export declare function formatReference(attrs: VerseRefAttrs): string;
|
|
12
|
+
export declare function shortReference(attrs: VerseRefAttrs): string;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
export interface PageWord {
|
|
3
|
+
surah: number;
|
|
4
|
+
ayah: number;
|
|
5
|
+
wordIdxInAyah: number;
|
|
6
|
+
globalIdx: number;
|
|
7
|
+
lastInAyah: boolean;
|
|
8
|
+
lineNumber: number;
|
|
9
|
+
}
|
|
10
|
+
export type InsertMode = "inline" | "mushaf";
|
|
11
|
+
export interface Endpoint {
|
|
12
|
+
surah: number;
|
|
13
|
+
ayah: number;
|
|
14
|
+
word: number;
|
|
15
|
+
}
|
|
16
|
+
export type BlockedReason = "cross-surah-inline";
|
|
17
|
+
export interface UseQuranSelection {
|
|
18
|
+
startIdx: Ref<number | null>;
|
|
19
|
+
endIdx: Ref<number | null>;
|
|
20
|
+
mode: Ref<InsertMode>;
|
|
21
|
+
hasSelection: ComputedRef<boolean>;
|
|
22
|
+
rangeLo: ComputedRef<number | null>;
|
|
23
|
+
rangeHi: ComputedRef<number | null>;
|
|
24
|
+
from: ComputedRef<Endpoint | null>;
|
|
25
|
+
to: ComputedRef<Endpoint | null>;
|
|
26
|
+
inlineAllowed: ComputedRef<boolean>;
|
|
27
|
+
isCrossSurah: ComputedRef<boolean>;
|
|
28
|
+
blockedReason: Ref<BlockedReason | null>;
|
|
29
|
+
tapWord(globalIdx: number): void;
|
|
30
|
+
reset(): void;
|
|
31
|
+
setMode(m: InsertMode): void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Selection state machine for the surah-browser mushaf view.
|
|
35
|
+
*
|
|
36
|
+
* Selections are always full-verse aligned — taps snap to verse boundaries.
|
|
37
|
+
* Partial-word selection lives elsewhere (the single-verse slider step).
|
|
38
|
+
*
|
|
39
|
+
* Tap semantics:
|
|
40
|
+
* • First tap → select the tapped verse.
|
|
41
|
+
* • Tap a new verse before the current range → extend backward.
|
|
42
|
+
* • Tap a new verse after the current range → extend forward.
|
|
43
|
+
* • Tap a verse already inside the range → collapse to just that verse.
|
|
44
|
+
*
|
|
45
|
+
* Inline mode is allowed only when the selection stays within a single surah.
|
|
46
|
+
* Mushaf mode has no extra restriction beyond same-page (enforced upstream).
|
|
47
|
+
*/
|
|
48
|
+
export declare function useQuranSelection(pageWords: Ref<PageWord[]>, initial?: {
|
|
49
|
+
mode?: InsertMode;
|
|
50
|
+
}): UseQuranSelection;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InjectionKey, Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Read-only dark-mode flag. The host owns theme state (SPA: useTheme();
|
|
4
|
+
* embed SDK later: options.theme), so the editor only consumes it.
|
|
5
|
+
* Default: light.
|
|
6
|
+
*/
|
|
7
|
+
export declare const IsDarkKey: InjectionKey<Ref<boolean>>;
|
|
8
|
+
export declare function useIsDark(): Ref<boolean>;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
editor: {
|
|
3
|
+
placeholder: string;
|
|
4
|
+
saving: string;
|
|
5
|
+
saved: string;
|
|
6
|
+
backIcon: string;
|
|
7
|
+
slashHint: string;
|
|
8
|
+
failedToLoad: string;
|
|
9
|
+
tryAgainLater: string;
|
|
10
|
+
insert: string;
|
|
11
|
+
insertQuran: string;
|
|
12
|
+
insertHadith: string;
|
|
13
|
+
insertJJ: string;
|
|
14
|
+
insertSAW: string;
|
|
15
|
+
insertToggleList: string;
|
|
16
|
+
insertTable: string;
|
|
17
|
+
insertImage: string;
|
|
18
|
+
image: {
|
|
19
|
+
uploading: string;
|
|
20
|
+
uploadFailed: string;
|
|
21
|
+
retry: string;
|
|
22
|
+
cancel: string;
|
|
23
|
+
tooLarge: string;
|
|
24
|
+
singleOnly: string;
|
|
25
|
+
failedToLoad: string;
|
|
26
|
+
rejectedTitle: string;
|
|
27
|
+
rejectedDetail: string;
|
|
28
|
+
};
|
|
29
|
+
atom: {
|
|
30
|
+
copy: string;
|
|
31
|
+
delete: string;
|
|
32
|
+
};
|
|
33
|
+
verse: {
|
|
34
|
+
viewTafsir: string;
|
|
35
|
+
};
|
|
36
|
+
hadith: {
|
|
37
|
+
viewDetails: string;
|
|
38
|
+
};
|
|
39
|
+
findReplace: {
|
|
40
|
+
title: string;
|
|
41
|
+
findPlaceholder: string;
|
|
42
|
+
replacePlaceholder: string;
|
|
43
|
+
noResults: string;
|
|
44
|
+
next: string;
|
|
45
|
+
previous: string;
|
|
46
|
+
replace: string;
|
|
47
|
+
replaceAll: string;
|
|
48
|
+
caseSensitive: string;
|
|
49
|
+
close: string;
|
|
50
|
+
};
|
|
51
|
+
table: {
|
|
52
|
+
addRowAfter: string;
|
|
53
|
+
deleteRow: string;
|
|
54
|
+
addColAfter: string;
|
|
55
|
+
deleteCol: string;
|
|
56
|
+
toggleHeader: string;
|
|
57
|
+
deleteTable: string;
|
|
58
|
+
};
|
|
59
|
+
unsavedWarning: string;
|
|
60
|
+
tapToResave: string;
|
|
61
|
+
tapToRetry: string;
|
|
62
|
+
backLabel: string;
|
|
63
|
+
};
|
|
64
|
+
errors: {
|
|
65
|
+
loadDocument: string;
|
|
66
|
+
saveFailed: string;
|
|
67
|
+
documentTooLarge: string;
|
|
68
|
+
};
|
|
69
|
+
quran: {
|
|
70
|
+
dialogTitle: string;
|
|
71
|
+
searchPlaceholder: string;
|
|
72
|
+
noResults: string;
|
|
73
|
+
searchError: string;
|
|
74
|
+
selectionHint: string;
|
|
75
|
+
refineWords: string;
|
|
76
|
+
insert: string;
|
|
77
|
+
cancel: string;
|
|
78
|
+
back: string;
|
|
79
|
+
surahsSection: string;
|
|
80
|
+
versesSection: string;
|
|
81
|
+
verses: string;
|
|
82
|
+
browse: string;
|
|
83
|
+
typeToSearch: string;
|
|
84
|
+
openSurahInMushaf: string;
|
|
85
|
+
selectMoreVerses: string;
|
|
86
|
+
selectMoreVersesSub: string;
|
|
87
|
+
page: string;
|
|
88
|
+
previousPage: string;
|
|
89
|
+
nextPage: string;
|
|
90
|
+
pagePickerPlaceholder: string;
|
|
91
|
+
noMatches: string;
|
|
92
|
+
tapWordToStart: string;
|
|
93
|
+
tapWordToBegin: string;
|
|
94
|
+
tapVerseToSelect: string;
|
|
95
|
+
tapVerseToSelectFull: string;
|
|
96
|
+
selectedRef: string;
|
|
97
|
+
selection: string;
|
|
98
|
+
reset: string;
|
|
99
|
+
insertAs: string;
|
|
100
|
+
inline: string;
|
|
101
|
+
mushaf: string;
|
|
102
|
+
inlineDescription: string;
|
|
103
|
+
mushafDescription: string;
|
|
104
|
+
snappedToFullVerses: string;
|
|
105
|
+
inlineNoCrossSurah: string;
|
|
106
|
+
crossSurahBlocked: string;
|
|
107
|
+
preview: string;
|
|
108
|
+
previewError: string;
|
|
109
|
+
insertText: string;
|
|
110
|
+
insertMushafImage: string;
|
|
111
|
+
};
|
|
112
|
+
wordSelect: {
|
|
113
|
+
tapEndWord: string;
|
|
114
|
+
};
|
|
115
|
+
hadith: {
|
|
116
|
+
dialogTitle: string;
|
|
117
|
+
searchPlaceholder: string;
|
|
118
|
+
noResults: string;
|
|
119
|
+
searchError: string;
|
|
120
|
+
selectionHint: string;
|
|
121
|
+
insert: string;
|
|
122
|
+
};
|
|
123
|
+
hadithDetail: {
|
|
124
|
+
ariaLabel: string;
|
|
125
|
+
close: string;
|
|
126
|
+
openOnSunnah: string;
|
|
127
|
+
collection: string;
|
|
128
|
+
book: string;
|
|
129
|
+
grade: string;
|
|
130
|
+
translation: string;
|
|
131
|
+
error: string;
|
|
132
|
+
retry: string;
|
|
133
|
+
};
|
|
134
|
+
verseDetail: {
|
|
135
|
+
ariaLabel: string;
|
|
136
|
+
close: string;
|
|
137
|
+
openOnQuranCom: string;
|
|
138
|
+
translation: string;
|
|
139
|
+
translationSource: string;
|
|
140
|
+
transliteration: string;
|
|
141
|
+
tafsir: string;
|
|
142
|
+
tafsirLanguage: string;
|
|
143
|
+
error: string;
|
|
144
|
+
retry: string;
|
|
145
|
+
prev: string;
|
|
146
|
+
next: string;
|
|
147
|
+
};
|
|
148
|
+
reportData: {
|
|
149
|
+
tooltip: string;
|
|
150
|
+
title: string;
|
|
151
|
+
referenceLabel: string;
|
|
152
|
+
placeholder: string;
|
|
153
|
+
submit: string;
|
|
154
|
+
cancel: string;
|
|
155
|
+
success: string;
|
|
156
|
+
error: string;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
export default _default;
|