@siladev/qalam 0.1.0 → 0.1.2
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/dist/{QalamEditor-DlA4iLRR.js → QalamEditor-BV95C4EV.js} +3445 -3435
- package/dist/editor/index.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -6
- package/dist/{lookup-C2v6jsEw.js → lookup-CFbcujyG.js} +83 -36
- package/dist/resolver/index.js +1 -1
- package/dist/styles.css +1049 -0
- package/package.json +1 -1
package/dist/editor/index.js
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { validateAST as e } from "./schema/index.js";
|
|
2
|
-
import { Q as
|
|
3
|
-
import { Q } from "./QalamRenderer-CMsfcF02.js";
|
|
4
|
-
import { resolveAST as
|
|
2
|
+
import { Q as s, a as t } from "./QalamEditor-BV95C4EV.js";
|
|
3
|
+
import { Q as f } from "./QalamRenderer-CMsfcF02.js";
|
|
4
|
+
import { resolveAST as d } from "./resolver/index.js";
|
|
5
|
+
import { g as Q, a as p, b as u, i as S, l as g, r as i } from "./lookup-CFbcujyG.js";
|
|
5
6
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
s as QalamEditor,
|
|
8
|
+
f as QalamRenderer,
|
|
8
9
|
t as QuranRef,
|
|
9
|
-
|
|
10
|
+
Q as getAllSurahs,
|
|
11
|
+
p as getSurahInfo,
|
|
12
|
+
u as getVerseText,
|
|
13
|
+
S as isDataLoaded,
|
|
14
|
+
g as loadQuranData,
|
|
15
|
+
d as resolveAST,
|
|
16
|
+
i as resolveSurah,
|
|
10
17
|
e as validateAST
|
|
11
18
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const E = [
|
|
2
2
|
{
|
|
3
3
|
n: 1,
|
|
4
4
|
na: "الفَاتِحة",
|
|
@@ -684,55 +684,102 @@ const S = [
|
|
|
684
684
|
ac: 6
|
|
685
685
|
}
|
|
686
686
|
];
|
|
687
|
-
let
|
|
688
|
-
function
|
|
687
|
+
let b = null, h = null, i = null;
|
|
688
|
+
function Q(a) {
|
|
689
|
+
return a.replace(/[\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/g, "");
|
|
690
|
+
}
|
|
691
|
+
function M(a) {
|
|
692
|
+
let n = Q(a.trim());
|
|
693
|
+
return n = n.replace(/[أإآٱ]/g, "ا"), n = n.replace(/ة/g, "ه"), n = n.replace(/ى/g, "ي"), n = n.replace(/^ال/, ""), n;
|
|
694
|
+
}
|
|
695
|
+
function p(a) {
|
|
689
696
|
return a.toString().replace(/\d/g, (n) => "٠١٢٣٤٥٦٧٨٩"[parseInt(n)]);
|
|
690
697
|
}
|
|
691
|
-
function
|
|
698
|
+
function T(a) {
|
|
699
|
+
b = a, h = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
700
|
+
for (const n of a)
|
|
701
|
+
h.set(n.n, n), i.set(n.na, n), i.set(M(n.na), n);
|
|
702
|
+
}
|
|
703
|
+
function w() {
|
|
704
|
+
return b !== null;
|
|
705
|
+
}
|
|
706
|
+
function x(a) {
|
|
707
|
+
if (!h || !i) return null;
|
|
708
|
+
const n = parseInt(a);
|
|
709
|
+
if (!isNaN(n) && n >= 1 && n <= 114)
|
|
710
|
+
return h.get(n) || null;
|
|
711
|
+
const e = i.get(a);
|
|
712
|
+
if (e) return e;
|
|
713
|
+
const A = M(a), c = i.get(A);
|
|
714
|
+
if (c) return c;
|
|
715
|
+
for (const s of b)
|
|
716
|
+
if (M(s.na).includes(A) || A.includes(M(s.na)))
|
|
717
|
+
return s;
|
|
692
718
|
return null;
|
|
693
719
|
}
|
|
694
|
-
function
|
|
695
|
-
const
|
|
696
|
-
for (let
|
|
697
|
-
const
|
|
698
|
-
if (!
|
|
699
|
-
const
|
|
700
|
-
let
|
|
701
|
-
|
|
702
|
-
const
|
|
703
|
-
(
|
|
720
|
+
function S(a, n, e, A, c, s) {
|
|
721
|
+
const l = A ?? n, o = [];
|
|
722
|
+
for (let r = n; r <= l; r++) {
|
|
723
|
+
const f = a.a[r];
|
|
724
|
+
if (!f) continue;
|
|
725
|
+
const m = f[s];
|
|
726
|
+
let y = 0, u = m.length;
|
|
727
|
+
r === n && e !== null && e > 0 && (y = e - 1), r === l && c !== null && c > 0 && (u = c), o.push(...m.slice(y, u));
|
|
728
|
+
const g = r === l;
|
|
729
|
+
(u === m.length || !g) && o.push(f.m);
|
|
704
730
|
}
|
|
705
|
-
return
|
|
731
|
+
return o;
|
|
706
732
|
}
|
|
707
|
-
function
|
|
708
|
-
const
|
|
709
|
-
if (!
|
|
710
|
-
const
|
|
711
|
-
for (let
|
|
712
|
-
const
|
|
713
|
-
if (!
|
|
714
|
-
const
|
|
715
|
-
let
|
|
716
|
-
|
|
733
|
+
function C(a, n, e, A, c, s = !1) {
|
|
734
|
+
const l = typeof a == "number" ? h?.get(a) : x(a);
|
|
735
|
+
if (!l) return null;
|
|
736
|
+
const o = S(l, n, e, A, c, "u"), r = S(l, n, e, A, c, "h"), f = s && l.n !== 1, m = o.join(" "), y = r.join(" "), u = A ?? n, g = [];
|
|
737
|
+
for (let t = n; t <= u; t++) {
|
|
738
|
+
const d = l.a[t];
|
|
739
|
+
if (!d) continue;
|
|
740
|
+
const q = d.u;
|
|
741
|
+
let F = 0, N = q.length;
|
|
742
|
+
t === n && e !== null && e > 0 && (F = e - 1), t === u && c !== null && c > 0 && (N = c), g.push(...q.slice(F, N)), (N === q.length || t !== u) && g.push(`(${p(t)})`);
|
|
717
743
|
}
|
|
718
|
-
const
|
|
719
|
-
for (let
|
|
720
|
-
const
|
|
721
|
-
|
|
744
|
+
const j = g.join(" "), D = [];
|
|
745
|
+
for (let t = n; t <= u; t++) {
|
|
746
|
+
const d = l.a[t];
|
|
747
|
+
d && D.push(d.e);
|
|
722
748
|
}
|
|
723
|
-
const
|
|
724
|
-
return { text:
|
|
749
|
+
const z = D.join(" "), k = n === u ? p(n) : `${p(n)}-${p(u)}`, I = `${l.na}: ${k}`;
|
|
750
|
+
return { text: m, textHafsSmart: y, textCopy: j, textEmlaey: z, citation: I, basmalah: f };
|
|
751
|
+
}
|
|
752
|
+
function L() {
|
|
753
|
+
return b ? b.map((a) => ({
|
|
754
|
+
number: a.n,
|
|
755
|
+
nameArabic: a.na,
|
|
756
|
+
nameEnglish: a.ne,
|
|
757
|
+
ayaCount: a.ac
|
|
758
|
+
})) : [];
|
|
725
759
|
}
|
|
726
|
-
function
|
|
727
|
-
return
|
|
760
|
+
function $() {
|
|
761
|
+
return E.map((a) => ({
|
|
728
762
|
number: a.n,
|
|
729
763
|
nameArabic: a.na,
|
|
730
764
|
nameEnglish: a.ne,
|
|
731
765
|
ayaCount: a.ac
|
|
732
766
|
}));
|
|
733
767
|
}
|
|
768
|
+
function H(a) {
|
|
769
|
+
const n = h?.get(a);
|
|
770
|
+
return n ? {
|
|
771
|
+
number: n.n,
|
|
772
|
+
nameArabic: n.na,
|
|
773
|
+
nameEnglish: n.ne,
|
|
774
|
+
ayaCount: n.ac
|
|
775
|
+
} : null;
|
|
776
|
+
}
|
|
734
777
|
export {
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
778
|
+
H as a,
|
|
779
|
+
C as b,
|
|
780
|
+
$ as c,
|
|
781
|
+
L as g,
|
|
782
|
+
w as i,
|
|
783
|
+
T as l,
|
|
784
|
+
x as r
|
|
738
785
|
};
|
package/dist/resolver/index.js
CHANGED