misraj-mushaf-renderer 1.3.17 → 1.3.21

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/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as c, jsxs as L, Fragment as r4 } from "react/jsx-runtime";
2
- import x4, { useState as j, useEffect as A0, useContext as w0, createContext as P0, useRef as t4, useCallback as K, useMemo as Q, memo as a4 } from "react";
2
+ import x4, { useState as j, useEffect as A0, useContext as w0, createContext as P0, useRef as t4, useCallback as $, useMemo as Q, memo as a4 } from "react";
3
3
  var J = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
4
4
  function n4(e) {
5
5
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
@@ -78,7 +78,7 @@ const i4 = P0(void 0), s4 = P0(void 0), j4 = ({
78
78
  hasBorder: a = !0,
79
79
  initialIsTwoPagesView: i = !1
80
80
  }) => {
81
- const s = z4("(min-width: 1024px)"), [u, o] = j(n), [C, h] = j(null), [f, l] = j(null), [g, q] = j(null), [p, v] = j(null), _ = t4(null), d = s && i, w = K(async () => {
81
+ const s = z4("(min-width: 1024px)"), [u, o] = j(n), [C, h] = j(null), [f, l] = j(null), [g, q] = j(null), [p, v] = j(null), _ = t4(null), d = s && i, w = $(async () => {
82
82
  _.current?.abort();
83
83
  const A = new AbortController();
84
84
  _.current = A, v(null);
@@ -99,9 +99,9 @@ const i4 = P0(void 0), s4 = P0(void 0), j4 = ({
99
99
  }
100
100
  }, [t, r, d]);
101
101
  A0(() => (w(), () => _.current?.abort()), [w]);
102
- const y = K(() => {
102
+ const y = $(() => {
103
103
  o((A) => A < 10 ? A + 1 : A);
104
- }, []), P = K(() => {
104
+ }, []), P = $(() => {
105
105
  o((A) => A > 3 ? A - 1 : A);
106
106
  }, []), T = Q(
107
107
  () => ({
@@ -151,7 +151,7 @@ const i4 = P0(void 0), s4 = P0(void 0), j4 = ({
151
151
  green: "#3E9257",
152
152
  blue: "#2A5D73",
153
153
  sepia: "#A97C50"
154
- }, u4 = P0(void 0), $ = () => {
154
+ }, u4 = P0(void 0), F = () => {
155
155
  const e = w0(u4);
156
156
  if (!e)
157
157
  throw new Error("useThemeContext must be used within a ThemeProvider");
@@ -181,27 +181,27 @@ const i4 = P0(void 0), s4 = P0(void 0), j4 = ({
181
181
  styleOverride: t
182
182
  };
183
183
  return /* @__PURE__ */ c(u4.Provider, { value: n, children: e });
184
- }, K4 = "Line-line", $4 = "Line-container", k4 = "Line-mobileInline", F = {
184
+ }, K4 = "Line-line", $4 = "Line-container", k4 = "Line-mobileInline", V = {
185
185
  line: K4,
186
186
  container: $4,
187
187
  mobileInline: k4
188
188
  }, U4 = "ChapterHeader-bismillahContainer", W4 = "ChapterHeader-header", T0 = {
189
189
  bismillahContainer: U4,
190
190
  header: W4
191
- }, J4 = "ChapterIconContainer-iconContainer", Q4 = "ChapterIconContainer-border", X4 = "ChapterIconContainer-blueBorder", Y4 = "ChapterIconContainer-sepiaBorder", V = {
191
+ }, J4 = "ChapterIconContainer-iconContainer", Q4 = "ChapterIconContainer-border", X4 = "ChapterIconContainer-blueBorder", Y4 = "ChapterIconContainer-sepiaBorder", G = {
192
192
  iconContainer: J4,
193
193
  border: Q4,
194
194
  blueBorder: X4,
195
195
  sepiaBorder: Y4
196
196
  }, E0 = ({ id: e }) => /* @__PURE__ */ c("span", { translate: "no", children: e?.padStart(3, "0") }), e6 = ({ chapterId: e, hasSurahPrefix: r = !0 }) => {
197
- const { hasBorder: t } = N(), { themeProps: n, styleOverride: a } = $(), { borderColor: i } = n;
197
+ const { hasBorder: t } = N(), { themeProps: n, styleOverride: a } = F(), { borderColor: i } = n;
198
198
  return /* @__PURE__ */ L(
199
199
  "span",
200
200
  {
201
- className: S(V.iconContainer, V.iconContainerLarge, {
202
- [V.border]: t,
203
- [V.blueBorder]: t && i === "blue",
204
- [V.sepiaBorder]: t && i === "sepia"
201
+ className: S(G.iconContainer, G.iconContainerLarge, {
202
+ [G.border]: t,
203
+ [G.blueBorder]: t && i === "blue",
204
+ [G.sepiaBorder]: t && i === "sepia"
205
205
  }),
206
206
  style: { ...a?.ChapterIconContainer?.iconContainer },
207
207
  children: [
@@ -357,12 +357,12 @@ const q6 = (e, r, t, n = !1) => e === f4.IndoPak ? `${e}_${t}-font-size-${r}` :
357
357
  }
358
358
  return r;
359
359
  }, A6 = "data-word-location", w6 = ({ word: e, onWordClick: r, onWordHover: t }) => {
360
- const { selectedVerse: n, dataId: a } = N(), { styleOverride: i } = $(), s = b6(e.verse_key, e.position), u = /* @__PURE__ */ c("span", { className: z.UthmanicHafs, children: e.text }), o = n?.numberInSurah === e.verse.numberInSurah, C = T6(a), h = K(
360
+ const { selectedVerse: n, dataId: a } = N(), { styleOverride: i } = F(), s = b6(e.verse_key, e.position), u = /* @__PURE__ */ c("span", { className: z.UthmanicHafs, children: e.text }), o = n?.numberInSurah === e.verse.numberInSurah, C = T6(a), h = $(
361
361
  (l) => {
362
362
  r && r(e, l);
363
363
  },
364
364
  [r, e]
365
- ), f = K(
365
+ ), f = $(
366
366
  (l) => {
367
367
  t && t(e, l);
368
368
  },
@@ -396,7 +396,7 @@ const q6 = (e, r, t, n = !1) => e === f4.IndoPak ? `${e}_${t}-font-size-${r}` :
396
396
  onWordClick: n,
397
397
  onWordHover: a
398
398
  }) => {
399
- const { fontScale: i } = N(), { styleOverride: s } = $(), [u] = e, {
399
+ const { fontScale: i } = N(), { styleOverride: s } = F(), [u] = e, {
400
400
  line_number: o,
401
401
  page_number: C,
402
402
  location: h,
@@ -455,9 +455,9 @@ const q6 = (e, r, t, n = !1) => e === f4.IndoPak ? `${e}_${t}-font-size-${r}` :
455
455
  "div",
456
456
  {
457
457
  id: e,
458
- className: S(F.container, {
459
- [F.highlighted]: f,
460
- [F.mobileInline]: t
458
+ className: S(V.container, {
459
+ [V.highlighted]: f,
460
+ [V.mobileInline]: t
461
461
  }),
462
462
  role: "button",
463
463
  tabIndex: 0,
@@ -466,8 +466,8 @@ const q6 = (e, r, t, n = !1) => e === f4.IndoPak ? `${e}_${t}-font-size-${r}` :
466
466
  /* @__PURE__ */ c(
467
467
  "div",
468
468
  {
469
- className: S(F.line, {
470
- [F.mobileInline]: t
469
+ className: S(V.line, {
470
+ [V.mobileInline]: t
471
471
  }),
472
472
  children: /* @__PURE__ */ c(
473
473
  R6,
@@ -769,7 +769,7 @@ function E() {
769
769
  var e = Array.isArray;
770
770
  return S1 = e, S1;
771
771
  }
772
- var G = { exports: {} }, x1, u9;
772
+ var Z = { exports: {} }, x1, u9;
773
773
  function se() {
774
774
  if (u9) return x1;
775
775
  u9 = 1;
@@ -778,13 +778,13 @@ function se() {
778
778
  }
779
779
  return x1 = e, x1;
780
780
  }
781
- G.exports;
781
+ Z.exports;
782
782
  var o9;
783
783
  function _4() {
784
784
  return o9 || (o9 = 1, (function(e, r) {
785
785
  var t = B(), n = se(), a = r && !r.nodeType && r, i = a && !0 && e && !e.nodeType && e, s = i && i.exports === a, u = s ? t.Buffer : void 0, o = u ? u.isBuffer : void 0, C = o || n;
786
786
  e.exports = C;
787
- })(G, G.exports)), G.exports;
787
+ })(Z, Z.exports)), Z.exports;
788
788
  }
789
789
  var H1, c9;
790
790
  function p4() {
@@ -829,8 +829,8 @@ function oe() {
829
829
  }
830
830
  return L1 = e, L1;
831
831
  }
832
- var Z = { exports: {} };
833
- Z.exports;
832
+ var K = { exports: {} };
833
+ K.exports;
834
834
  var l9;
835
835
  function ce() {
836
836
  return l9 || (l9 = 1, (function(e, r) {
@@ -842,7 +842,7 @@ function ce() {
842
842
  }
843
843
  })();
844
844
  e.exports = u;
845
- })(Z, Z.exports)), Z.exports;
845
+ })(K, K.exports)), K.exports;
846
846
  }
847
847
  var B1, d9;
848
848
  function y4() {
@@ -2033,10 +2033,13 @@ const H5 = /* @__PURE__ */ n4(x5), I5 = (e) => {
2033
2033
  green: O5,
2034
2034
  blue: L5,
2035
2035
  sepia: B5
2036
- }, z5 = ({ value: e, borderColor: r }) => /* @__PURE__ */ L("div", { className: R.pageNumberContainer, children: [
2037
- /* @__PURE__ */ c("img", { src: E5[r || "green"] }),
2038
- /* @__PURE__ */ c("p", { className: R.pageNumber, children: N5(`${e}`) })
2039
- ] }), N5 = (e) => e.split("").map((t) => D5[t]).join(""), D5 = {
2036
+ }, z5 = ({ value: e, borderColor: r }) => {
2037
+ const { styleOverride: t } = F();
2038
+ return /* @__PURE__ */ L("div", { className: R.pageNumberContainer, children: [
2039
+ /* @__PURE__ */ c("img", { src: E5[r || "green"] }),
2040
+ /* @__PURE__ */ c("p", { className: R.pageNumber, style: t?.Page?.pageNumber, children: N5(`${e}`) })
2041
+ ] });
2042
+ }, N5 = (e) => e.split("").map((t) => D5[t]).join(""), D5 = {
2040
2043
  0: "۰",
2041
2044
  1: "۱",
2042
2045
  2: "۲",
@@ -2435,7 +2438,7 @@ const H5 = /* @__PURE__ */ n4(x5), I5 = (e) => {
2435
2438
  onWordHover: a,
2436
2439
  pageStyleOverride: i
2437
2440
  }) => {
2438
- const { fontScale: s, hasBorder: u } = N(), { themeProps: o, styleOverride: C } = $(), { borderColor: h } = o, f = Q(
2441
+ const { fontScale: s, hasBorder: u } = N(), { themeProps: o, styleOverride: C } = F(), { borderColor: h } = o, f = Q(
2439
2442
  () => e && e.length ? I5(e) : {},
2440
2443
  [e]
2441
2444
  ), l = s > 3, g = e && e.length ? e[0] : void 0, q = r === 1 || r === 2;
@@ -2531,7 +2534,7 @@ const H5 = /* @__PURE__ */ n4(x5), I5 = (e) => {
2531
2534
  }
2532
2535
  );
2533
2536
  }, W5 = ({ onWordClick: e, onWordHover: r }) => {
2534
- const { ayat: t, nextPageAyat: n, pageNumber: a } = N(), { styleOverride: i } = $(), { isTwoPagesView: s } = N(), u = Number(a);
2537
+ const { ayat: t, nextPageAyat: n, pageNumber: a } = N(), { styleOverride: i } = F(), { isTwoPagesView: s } = N(), u = Number(a);
2535
2538
  return /* @__PURE__ */ c(
2536
2539
  "div",
2537
2540
  {