@pdf-viewer/react 1.9.1-rc.0 → 1.9.1-rc.10
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/ToolbarLayout.module-cbc8e216.js +3346 -0
- package/dist/ZoomTool.module-6c5eabbb.js +12 -0
- package/dist/assets/ToolbarLayout.css +1 -1
- package/dist/assets/ZoomTool.css +1 -0
- package/dist/components/RPController.js +20 -19
- package/dist/components/RPPages.js +4 -2
- package/dist/components/layout/LayoutContainer.js +4 -2
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/RPLayout.js +5 -3
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +4 -2
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +4 -2
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +4 -2
- package/dist/components/layout/toolbar/OtherTool.js +1 -1
- package/dist/components/layout/toolbar/Paginate.js +2 -2
- package/dist/components/layout/toolbar/PrintTool.js +2 -2
- package/dist/components/layout/toolbar/RPToolbar.js +3 -2
- package/dist/components/layout/toolbar/RPToolbarEnd.js +2 -2
- package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +4 -2
- package/dist/components/layout/toolbar/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/ToolbarCustom.js +9 -7
- package/dist/components/layout/toolbar/ToolbarDefault.js +8 -6
- package/dist/components/layout/toolbar/ZoomTool.js +128 -28
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/InputPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/NextPageTool.js +5 -3
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomInTool.js +13 -13
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +38 -64
- package/dist/components/layout/toolbar/tools/ZoomOutTool.js +18 -18
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +12 -9
- package/dist/components/page/AnnotationLayer.js +4 -2
- package/dist/components/page/CanvasLayer.js +4 -2
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +4 -2
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +4 -2
- package/dist/components/page/TextLayer.js +4 -2
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/contexts/ElementPageContext.js +25 -20
- package/dist/contexts/GlobalCurrentPage.js +16 -0
- package/dist/contexts/PaginationContext.js +5 -4
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/RPDocumentContext.js +31 -29
- package/dist/contexts/RenderQueueProvider.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/contexts/ZoomContext.js +86 -39
- package/dist/main.js +1 -1
- package/dist/{th_TH-f515b3ad.js → th_TH-d627cd51.js} +19 -19
- package/dist/types/contexts/GlobalCurrentPage.d.ts +11 -0
- package/dist/types/locales/en_US.json.d.ts +3 -3
- package/dist/types/utils/hooks/useLoadPdf.d.ts +2 -1
- package/dist/types/utils/types.d.ts +9 -5
- package/dist/utils/getZoomLevel.js +13 -12
- package/dist/utils/hooks/useFileDownload.js +4 -2
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/useLoadPdf.js +64 -57
- package/dist/utils/hooks/useLocalization.js +1 -1
- package/dist/utils/hooks/usePaginate.js +4 -2
- package/dist/utils/hooks/usePinch.js +17 -17
- package/dist/utils/hooks/usePresentPage.js +4 -2
- package/dist/utils/hooks/usePrint.js +4 -2
- package/dist/utils/hooks/useScrollToPage.js +4 -2
- package/dist/utils/hooks/useSearch.js +4 -2
- package/dist/utils/hooks/useThumbnail.js +4 -2
- package/dist/utils/hooks/useVirtualReactWindow.js +4 -2
- package/dist/utils/types.js +11 -10
- package/package.json +1 -1
- package/dist/ToolbarLayout.module-cd89d275.js +0 -3455
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const o = "Search in Document", e = "Enter to search", t = "Search", l = "Previous match", a = "Next match", i = "Close", r = "Match Case", s = "Search case sensitive text", n = "Whole Words", c = "Search exact and case insensitive word(s)", p = "Previous page", d = "Current page", b = "Next page", T = "Zoom out", g = "Zoom in", L = "Select zoom level", u = "Actual
|
|
1
|
+
const o = "Search in Document", e = "Enter to search", t = "Search", l = "Previous match", a = "Next match", i = "Close", r = "Match Case", s = "Search case sensitive text", n = "Whole Words", c = "Search exact and case insensitive word(s)", p = "Previous page", d = "Current page", b = "Next page", T = "Zoom out", g = "Zoom in", L = "Select zoom level", u = "Actual Size", $ = "Page Fit", h = "Page Width", P = "Enable dark theme", m = "Enable light theme", S = "Open local file", w = "Open local file", C = "Download file", z = "Download file", F = "Print", v = "Print", M = "Preparing Document", f = "Cancel", D = "Full screen", k = "Full screen", x = "More options", W = "First page", A = "Go to first page", E = "Last page", O = "Go to last page", I = "Rotate clockwise", B = "Rotate clockwise", V = "Rotate counterclockwise", N = "Rotate counterclockwise", q = "Text selection tool", R = "Enable text selection tool", j = "Hand tool", y = "Enable hand tool", K = "Document properties", G = "View document properties", _ = "Page Scrolling", H = "Enable page scrolling", U = "Vertical Scrolling", Z = "Enable vertical scrolling", Q = "Horizontal Scrolling", J = "Enable horizontal scrolling", X = "Wrapped Scrolling", Y = "Enable wrapped scrolling", oo = "Single Page", eo = "Enable single page view", to = "Dual Page", lo = "Enable dual page view", ao = "File name", io = "File size", ro = "Title", so = "Author", no = "Subject", co = "Keywords", po = "Creator", bo = "Created on", To = "Modified on", go = "PDF producer", Lo = "PDF version", uo = "Page count", $o = "Thumbnail", ho = "Password Required", Po = "This document is password protected. Please enter a password to open the file.", mo = "Enter password", So = "Submit", wo = "Incorrect password", Co = "Drag and drop the PDF file here", nr = {
|
|
2
2
|
searchButtonTooltip: o,
|
|
3
3
|
searchInputPlaceholder: e,
|
|
4
4
|
searchInputTooltip: t,
|
|
@@ -31,8 +31,8 @@ const o = "Search in Document", e = "Enter to search", t = "Search", l = "Previo
|
|
|
31
31
|
fullScreenLabel: D,
|
|
32
32
|
fullScreenTooltip: k,
|
|
33
33
|
moreOptionTooltip: x,
|
|
34
|
-
firstPageLabel:
|
|
35
|
-
firstPageTooltip:
|
|
34
|
+
firstPageLabel: W,
|
|
35
|
+
firstPageTooltip: A,
|
|
36
36
|
lastPageLabel: E,
|
|
37
37
|
lastPageTooltip: O,
|
|
38
38
|
rotateClockwiseLabel: I,
|
|
@@ -76,7 +76,7 @@ const o = "Search in Document", e = "Enter to search", t = "Search", l = "Previo
|
|
|
76
76
|
passwordConfirmLabel: So,
|
|
77
77
|
passwordError: wo,
|
|
78
78
|
dragDropFileMessage: Co
|
|
79
|
-
}, zo = "搜索文件", Fo = "输入搜索词", vo = "搜索", Mo = "上一条", fo = "下一条", Do = "关闭", ko = "区分大小写", xo = "搜索区分大小写",
|
|
79
|
+
}, zo = "搜索文件", Fo = "输入搜索词", vo = "搜索", Mo = "上一条", fo = "下一条", Do = "关闭", ko = "区分大小写", xo = "搜索区分大小写", Wo = "全字匹配", Ao = "搜索完全匹配", Eo = "上一页", Oo = "当前页", Io = "下一页", Bo = "缩小", Vo = "放大", No = "选择缩放级别", qo = "实际大小", Ro = "适合页面", jo = "页面宽度", yo = "切换到深色模式", Ko = "切换到浅色模式", Go = "打开文件", _o = "打开文件", Ho = "下载文件", Uo = "下载文件", Zo = "打印", Qo = "打印", Jo = "准备文件", Xo = "取消", Yo = "全屏", oe = "全屏", ee = "更多选项", te = "第一页", le = "跳转到第一页", ae = "最后一页", ie = "跳转到最后一页", re = "顺时针旋转", se = "顺时针旋转", ne = "逆时针旋转", ce = "逆时针旋转", pe = "文本选择工具", de = "启用文本选择工具", be = "手型工具", Te = "启用手型工具", ge = "文件属性", Le = "查看文件属性", ue = "页面滚动", $e = "启用页面滚动", he = "垂直滚动", Pe = "启用垂直滚动", me = "水平滚动", Se = "启用水平滚动", we = "环绕滚动", Ce = "启用环绕滚动", ze = "单页面视图", Fe = "启用单页视图", ve = "双页面视图", Me = "启用双页视图", fe = "文件名称", De = "文件大小", ke = "标题", xe = "作者", We = "主题", Ae = "关键字", Ee = "创建者", Oe = "创建于", Ie = "修改于", Be = "PDF 制作程序 ", Ve = "PDF版本", Ne = "页数", qe = "缩略图", Re = "需要密码", je = "此文件受密码保护。请输入密码以打开文件。", ye = "输入密码", Ke = "提交", Ge = "密码错误", _e = "将PDF文件拖放到这里", cr = {
|
|
80
80
|
searchButtonTooltip: zo,
|
|
81
81
|
searchInputPlaceholder: Fo,
|
|
82
82
|
searchInputTooltip: vo,
|
|
@@ -85,8 +85,8 @@ const o = "Search in Document", e = "Enter to search", t = "Search", l = "Previo
|
|
|
85
85
|
searchCloseButtonTooltip: Do,
|
|
86
86
|
searchMatchCaseLabel: ko,
|
|
87
87
|
searchMatchCaseTooltip: xo,
|
|
88
|
-
searchWholeWordsLabel:
|
|
89
|
-
searchWholeWordsTooltip:
|
|
88
|
+
searchWholeWordsLabel: Wo,
|
|
89
|
+
searchWholeWordsTooltip: Ao,
|
|
90
90
|
previousPageTooltip: Eo,
|
|
91
91
|
currentPageTooltip: Oo,
|
|
92
92
|
nextPageTooltip: Io,
|
|
@@ -139,8 +139,8 @@ const o = "Search in Document", e = "Enter to search", t = "Search", l = "Previo
|
|
|
139
139
|
propertiesFileSizeLabel: De,
|
|
140
140
|
propertiesTitleLabel: ke,
|
|
141
141
|
propertiesAuthorLabel: xe,
|
|
142
|
-
propertiesSubjectLabel:
|
|
143
|
-
propertiesKeywordLabel:
|
|
142
|
+
propertiesSubjectLabel: We,
|
|
143
|
+
propertiesKeywordLabel: Ae,
|
|
144
144
|
propertiesCreatorLabel: Ee,
|
|
145
145
|
propertiesCreateOnLabel: Oe,
|
|
146
146
|
propertiesModifiedOnLabel: Ie,
|
|
@@ -154,7 +154,7 @@ const o = "Search in Document", e = "Enter to search", t = "Search", l = "Previo
|
|
|
154
154
|
passwordConfirmLabel: Ke,
|
|
155
155
|
passwordError: Ge,
|
|
156
156
|
dragDropFileMessage: _e
|
|
157
|
-
}, He = "Cerca nel documento", Ue = "Premi Invio per cercare", Ze = "Cerca", Qe = "Corrispondenza precedente", Je = "Corrispondenza successiva", Xe = "Chiudi", Ye = "Maiuscole/minuscole", ot = "Cerca testo con distinzione maiuscole/minuscole", et = "Parola intera", tt = "Cerca esatte parole senza distinzione maiuscole/minuscole", lt = "Pagina precedente", at = "Pagina corrente", it = "Pagina successiva", rt = "Ridurre", st = "Ingrandire", nt = "Seleziona un livello di zoom", ct = "Dimensioni effettive", pt = "Adatta pagina", dt = "Larghezza pagina", bt = "Abilita tema scuro", Tt = "Abilita tema chiaro", gt = "Aprire file", Lt = "Aprire file", ut = "Scaricare file", $t = "Scaricare file", ht = "Stampa", Pt = "Stampa", mt = "Preparazione del documento", St = "Annulla", wt = "Schermo intero", Ct = "Schermo intero", zt = "Altre opzioni", Ft = "Prima pagina", vt = "Vai alla prima pagina", Mt = "Ultima pagina", ft = "Vai all’ultima pagina", Dt = "Ruota in senso orario", kt = "Ruota in senso orario", xt = "Ruota in senso antiorario",
|
|
157
|
+
}, He = "Cerca nel documento", Ue = "Premi Invio per cercare", Ze = "Cerca", Qe = "Corrispondenza precedente", Je = "Corrispondenza successiva", Xe = "Chiudi", Ye = "Maiuscole/minuscole", ot = "Cerca testo con distinzione maiuscole/minuscole", et = "Parola intera", tt = "Cerca esatte parole senza distinzione maiuscole/minuscole", lt = "Pagina precedente", at = "Pagina corrente", it = "Pagina successiva", rt = "Ridurre", st = "Ingrandire", nt = "Seleziona un livello di zoom", ct = "Dimensioni effettive", pt = "Adatta pagina", dt = "Larghezza pagina", bt = "Abilita tema scuro", Tt = "Abilita tema chiaro", gt = "Aprire file", Lt = "Aprire file", ut = "Scaricare file", $t = "Scaricare file", ht = "Stampa", Pt = "Stampa", mt = "Preparazione del documento", St = "Annulla", wt = "Schermo intero", Ct = "Schermo intero", zt = "Altre opzioni", Ft = "Prima pagina", vt = "Vai alla prima pagina", Mt = "Ultima pagina", ft = "Vai all’ultima pagina", Dt = "Ruota in senso orario", kt = "Ruota in senso orario", xt = "Ruota in senso antiorario", Wt = "Ruota in senso antiorario", At = "Strumento di selezione testo", Et = "Abilita strumento di selezione testo", Ot = "Strumento mano", It = "Abilita strumento mano", Bt = "Proprietà documento", Vt = "Visualizza proprietà documento", Nt = "Scorrimento pagina", qt = "Abilita lo scorrimento delle pagine", Rt = "Scorrimento verticale", jt = "Abilita lo scorrimento verticale", yt = "Scorrimento orizzontale", Kt = "Abilita lo scorrimento orizzontale", Gt = "Scorrimento avvolto", _t = "Abilita lo scorrimento avvolto", Ht = "Singolo", Ut = "Visualizzazione singola", Zt = "Doppio", Qt = "Visualizzazione doppio", Jt = "Nome file", Xt = "Dimensione file", Yt = "Titolo", ol = "Autore", el = "Oggetto", tl = "Parole chiave", ll = "Creatore", al = "Creato il", il = "Modificato il", rl = "Produttore PDF", sl = "Versione PDF", nl = "Numero di pagine", cl = "Miniature", pl = "Password richiesta", dl = "Questo documento è protetto da password. Si prega di inserire una password per aprire il file.", bl = "Inserisci la password", Tl = "Invia", gl = "Password errata", Ll = "Trascina e rilascia il file PDF qui", pr = {
|
|
158
158
|
searchButtonTooltip: He,
|
|
159
159
|
searchInputPlaceholder: Ue,
|
|
160
160
|
searchInputTooltip: Ze,
|
|
@@ -194,8 +194,8 @@ const o = "Search in Document", e = "Enter to search", t = "Search", l = "Previo
|
|
|
194
194
|
rotateClockwiseLabel: Dt,
|
|
195
195
|
rotateClockwiseTooltip: kt,
|
|
196
196
|
rotateCounterclockwiseLabel: xt,
|
|
197
|
-
rotateCounterclockwiseTooltip:
|
|
198
|
-
textSelectionLabel:
|
|
197
|
+
rotateCounterclockwiseTooltip: Wt,
|
|
198
|
+
textSelectionLabel: At,
|
|
199
199
|
textSelectionTooltip: Et,
|
|
200
200
|
handToolLabel: Ot,
|
|
201
201
|
handToolTooltip: It,
|
|
@@ -232,7 +232,7 @@ const o = "Search in Document", e = "Enter to search", t = "Search", l = "Previo
|
|
|
232
232
|
passwordConfirmLabel: Tl,
|
|
233
233
|
passwordError: gl,
|
|
234
234
|
dragDropFileMessage: Ll
|
|
235
|
-
}, ul = "Pesquisar no documento", $l = "Pressione Enter para pesquisar", hl = "Pesquisar", Pl = "Correspondência anterior", ml = "Correspondência seguinte", Sl = "Fechar", wl = "Diferenciar maiúsculas/minúsculas", Cl = "Pesquisar texto com distinção de maiúsculas/minúsculas", zl = "Palavra inteira", Fl = "Pesquisar palavras exatas sem distinção de maiúsculas/minúsculas", vl = "Página anterior", Ml = "Página atual", fl = "Próxima página", Dl = "Reduzir", kl = "Ampliar", xl = "Selecionar nível de zoom",
|
|
235
|
+
}, ul = "Pesquisar no documento", $l = "Pressione Enter para pesquisar", hl = "Pesquisar", Pl = "Correspondência anterior", ml = "Correspondência seguinte", Sl = "Fechar", wl = "Diferenciar maiúsculas/minúsculas", Cl = "Pesquisar texto com distinção de maiúsculas/minúsculas", zl = "Palavra inteira", Fl = "Pesquisar palavras exatas sem distinção de maiúsculas/minúsculas", vl = "Página anterior", Ml = "Página atual", fl = "Próxima página", Dl = "Reduzir", kl = "Ampliar", xl = "Selecionar nível de zoom", Wl = "Tamanho real", Al = "Ajustar à página", El = "Largura da página", Ol = "Ativar tema escuro", Il = "Ativar tema claro", Bl = "Abrir arquivo", Vl = "Abrir arquivo", Nl = "Baixar arquivo", ql = "Baixar arquivo", Rl = "Imprimir", jl = "Imprimir", yl = "Preparando documento", Kl = "Cancelar", Gl = "Tela inteira", _l = "Tela inteira", Hl = "Mais opções", Ul = "Primeira página", Zl = "Ir para a primeira página", Ql = "Última página", Jl = "Ir para a última página", Xl = "Girar no sentido horário", Yl = "Girar no sentido horário", oa = "Girar no sentido anti-horário", ea = "Girar no sentido anti-horário", ta = "Ferramenta de seleção de texto", la = "Ativar ferramenta de seleção de texto", aa = "Ferramenta de mão", ia = "Ativar ferramenta de mão", ra = "Propriedades do documento", sa = "Ver propriedades do documento", na = "Rolagem página", ca = "Ativar rolagem de página", pa = "Rolagem vertical", da = "Ativar rolagem vertical", ba = "Rolagem horizontal", Ta = "Ativar rolagem horizontal", ga = "Rolagem envolvida", La = "Ativar rolagem envolvente", ua = "Página única", $a = "Ativar página única", ha = "Página dupla", Pa = "Ativar página dupla", ma = "Nome do arquivo", Sa = "Tamanho do arquivo", wa = "Título", Ca = "Autor", za = "Assunto", Fa = "Palavras-chave", va = "Criador", Ma = "Criado em", fa = "Modificado em", Da = "Produtor do PDF", ka = "Versão do PDF", xa = "Número de páginas", Wa = "Miniatura", Aa = "Senha necessária", Ea = "Este documento é protegido por senha. Por favor, insira uma senha para abrir o arquivo.", Oa = "Insira a senha", Ia = "Enviar", Ba = "Senha incorreta", Va = "Arraste e solte o arquivo PDF aqui", dr = {
|
|
236
236
|
searchButtonTooltip: ul,
|
|
237
237
|
searchInputPlaceholder: $l,
|
|
238
238
|
searchInputTooltip: hl,
|
|
@@ -249,8 +249,8 @@ const o = "Search in Document", e = "Enter to search", t = "Search", l = "Previo
|
|
|
249
249
|
zoomOutTooltip: Dl,
|
|
250
250
|
zoomInTooltip: kl,
|
|
251
251
|
zoomSelectTooltip: xl,
|
|
252
|
-
zoomActualSize:
|
|
253
|
-
zoomPageFit:
|
|
252
|
+
zoomActualSize: Wl,
|
|
253
|
+
zoomPageFit: Al,
|
|
254
254
|
zoomPageWidth: El,
|
|
255
255
|
themeEnableDarkTooltip: Ol,
|
|
256
256
|
themeEnableLightTooltip: Il,
|
|
@@ -303,14 +303,14 @@ const o = "Search in Document", e = "Enter to search", t = "Search", l = "Previo
|
|
|
303
303
|
propertiesPDFProducerLabel: Da,
|
|
304
304
|
propertiesPDFVersionLabel: ka,
|
|
305
305
|
propertiesPageCountLabel: xa,
|
|
306
|
-
thumbnailTooltip:
|
|
307
|
-
passwordModalTitle:
|
|
306
|
+
thumbnailTooltip: Wa,
|
|
307
|
+
passwordModalTitle: Aa,
|
|
308
308
|
passwordModalMessage: Ea,
|
|
309
309
|
passwordPlaceholder: Oa,
|
|
310
310
|
passwordConfirmLabel: Ia,
|
|
311
311
|
passwordError: Ba,
|
|
312
312
|
dragDropFileMessage: Va
|
|
313
|
-
}, Na = "ค้นหาในเอกสาร", qa = "กรอกคำค้นหา", Ra = "ค้นหา", ja = "ผลการค้นหาก่อนหน้า", ya = "ผลการค้นหาถัดไป", Ka = "ปิด", Ga = "ข้อความที่มีคำ", _a = "ค้นหาข้อความที่มีการแยกตัวพิมพ์ใหญ่/พิมพ์เล็ก", Ha = "ทั้งคำ", Ua = "ค้นหาคำที่ตรงตัวไม่มีการแยกตัวพิมพ์ใหญ่/พิมพ์เล็ก", Za = "หน้าก่อนหน้า", Qa = "หน้าปัจจุบัน", Ja = "หน้าถัดไป", Xa = "ย่อ", Ya = "ขยาย", oi = "เลือกระดับซูม", ei = "ขนาดจริง", ti = "พอดีหน้า", li = "พอดีความกว้าง", ai = "เปิดโหมดมืด", ii = "เปิดโหมดสว่าง", ri = "เปิดไฟล์", si = "เปิดไฟล์", ni = "ดาวน์โหลดเอกสาร", ci = "ดาวน์โหลดเอกสาร", pi = "พิมพ์", di = "พิมพ์", bi = "เตรียมเอกสาร", Ti = "ยกเลิก", gi = "เต็มจอ", Li = "เต็มจอ", ui = "ตัวเลือกเพิ่มเติม", $i = "หน้าแรก", hi = "ไปที่หน้าแรก", Pi = "หน้าสุดท้าย", mi = "ไปที่หน้าสุดท้าย", Si = "หมุนตามเข็มนาฬิกา", wi = "หมุนตามเข็มนาฬิกา", Ci = "หมุนทวนเข็มนาฬิกา", zi = "หมุนทวนเข็มนาฬิกา", Fi = "เครื่องมือเลือกข้อความ", vi = "เปิดใช้การเลือกข้อความ", Mi = "เครื่องมือแฮนด์ทูล", fi = "เปิดใช้แฮนด์ทูล", Di = "คุณสมบัติของเอกสาร", ki = "ดูคุณสมบัติของเอกสาร", xi = "การเลื่อนภายในหน้า",
|
|
313
|
+
}, Na = "ค้นหาในเอกสาร", qa = "กรอกคำค้นหา", Ra = "ค้นหา", ja = "ผลการค้นหาก่อนหน้า", ya = "ผลการค้นหาถัดไป", Ka = "ปิด", Ga = "ข้อความที่มีคำ", _a = "ค้นหาข้อความที่มีการแยกตัวพิมพ์ใหญ่/พิมพ์เล็ก", Ha = "ทั้งคำ", Ua = "ค้นหาคำที่ตรงตัวไม่มีการแยกตัวพิมพ์ใหญ่/พิมพ์เล็ก", Za = "หน้าก่อนหน้า", Qa = "หน้าปัจจุบัน", Ja = "หน้าถัดไป", Xa = "ย่อ", Ya = "ขยาย", oi = "เลือกระดับซูม", ei = "ขนาดจริง", ti = "พอดีหน้า", li = "พอดีความกว้าง", ai = "เปิดโหมดมืด", ii = "เปิดโหมดสว่าง", ri = "เปิดไฟล์", si = "เปิดไฟล์", ni = "ดาวน์โหลดเอกสาร", ci = "ดาวน์โหลดเอกสาร", pi = "พิมพ์", di = "พิมพ์", bi = "เตรียมเอกสาร", Ti = "ยกเลิก", gi = "เต็มจอ", Li = "เต็มจอ", ui = "ตัวเลือกเพิ่มเติม", $i = "หน้าแรก", hi = "ไปที่หน้าแรก", Pi = "หน้าสุดท้าย", mi = "ไปที่หน้าสุดท้าย", Si = "หมุนตามเข็มนาฬิกา", wi = "หมุนตามเข็มนาฬิกา", Ci = "หมุนทวนเข็มนาฬิกา", zi = "หมุนทวนเข็มนาฬิกา", Fi = "เครื่องมือเลือกข้อความ", vi = "เปิดใช้การเลือกข้อความ", Mi = "เครื่องมือแฮนด์ทูล", fi = "เปิดใช้แฮนด์ทูล", Di = "คุณสมบัติของเอกสาร", ki = "ดูคุณสมบัติของเอกสาร", xi = "การเลื่อนภายในหน้า", Wi = "เปิดใช้การเลื่อนภายในหน้า", Ai = "การเลื่อนแนวตั้ง", Ei = "เปิดใช้การเลื่อนแนวตั้ง", Oi = "การเลื่อนแนวนอน", Ii = "เปิดใช้การเลื่อนแนวนอน", Bi = "การเลื่อนแบบแรพ", Vi = "เปิดใช้การเลื่อนแบบแรพ", Ni = "หน้าเดี่ยว", qi = "เปิดใช้หน้าเดี่ยว", Ri = "หน้าคู่", ji = "เปิดใช้หน้าคู่", yi = "ชื่อเอกสาร", Ki = "ขนาดเอกสาร", Gi = "ชื่อเรื่อง", _i = "ผู้เขียน", Hi = "หัวข้อ", Ui = "คำสำคัญ", Zi = "ผู้สร้าง", Qi = "วันที่สร้าง", Ji = "วันที่แก้ไข", Xi = "ผู้ผลิต PDF", Yi = "เวอร์ชัน PDF", or = "จำนวนหน้า", er = "ภาพย่อ", tr = "กรุณากรอกรหัสผ่าน", lr = "เอกสารนี้ได้รับการป้องกันด้วยรหัสผ่าน กรุณาใส่รหัสผ่านเพื่อเปิดไฟล์", ar = "กรอกรหัสผ่าน", ir = "ส่ง", rr = "รหัสผ่านไม่ถูกต้อง", sr = "ลากและวางไฟล์ PDF ที่นี่", br = {
|
|
314
314
|
searchButtonTooltip: Na,
|
|
315
315
|
searchInputPlaceholder: qa,
|
|
316
316
|
searchInputTooltip: Ra,
|
|
@@ -358,8 +358,8 @@ const o = "Search in Document", e = "Enter to search", t = "Search", l = "Previo
|
|
|
358
358
|
documentPropertiesLabel: Di,
|
|
359
359
|
documentPropertiesTooltip: ki,
|
|
360
360
|
pageScrollingLabel: xi,
|
|
361
|
-
pageScrollingTooltip:
|
|
362
|
-
verticalScrollingLabel:
|
|
361
|
+
pageScrollingTooltip: Wi,
|
|
362
|
+
verticalScrollingLabel: Ai,
|
|
363
363
|
verticalScrollingTooltip: Ei,
|
|
364
364
|
horizontalLabel: Oi,
|
|
365
365
|
horizontalTooltip: Ii,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const GlobalCurrentPage: import('react').Context<{
|
|
2
|
+
currentPage: number;
|
|
3
|
+
setCurrentPage: (page: number) => void;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const useGlobalCurrentPage: () => {
|
|
6
|
+
currentPage: number;
|
|
7
|
+
setCurrentPage: (page: number) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const GlobalCurrentPageProvider: ({ children }: {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,9 +15,9 @@ declare const _default: {
|
|
|
15
15
|
"zoomOutTooltip": "Zoom out",
|
|
16
16
|
"zoomInTooltip": "Zoom in",
|
|
17
17
|
"zoomSelectTooltip": "Select zoom level",
|
|
18
|
-
"zoomActualSize": "Actual
|
|
19
|
-
"zoomPageFit": "Page
|
|
20
|
-
"zoomPageWidth": "Page
|
|
18
|
+
"zoomActualSize": "Actual Size",
|
|
19
|
+
"zoomPageFit": "Page Fit",
|
|
20
|
+
"zoomPageWidth": "Page Width",
|
|
21
21
|
"themeEnableDarkTooltip": "Enable dark theme",
|
|
22
22
|
"themeEnableLightTooltip": "Enable light theme",
|
|
23
23
|
"openLocalFileLabel": "Open local file",
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api.js';
|
|
2
|
-
import { PdfPage, RPSrc, CharacterMap, LoadPDFOptions } from '../types';
|
|
2
|
+
import { PdfPage, RPSrc, CharacterMap, LoadPDFOptions, ErrorType } from '../types';
|
|
3
3
|
export declare const useLoadPdf: (src?: RPSrc, characterMap?: CharacterMap, options?: LoadPDFOptions) => {
|
|
4
4
|
pdf: PDFDocumentProxy | undefined;
|
|
5
5
|
pages: Map<number, PdfPage>;
|
|
6
6
|
loading: boolean;
|
|
7
|
+
error: ErrorType | undefined;
|
|
7
8
|
loadingProgress: number;
|
|
8
9
|
passwordRequired: boolean | undefined;
|
|
9
10
|
passwordError: string | undefined;
|
|
@@ -12,6 +12,7 @@ export interface DocumentContextType {
|
|
|
12
12
|
filename?: string | null;
|
|
13
13
|
loading: boolean;
|
|
14
14
|
loaderProgress: number;
|
|
15
|
+
error: ErrorType | unknown;
|
|
15
16
|
}
|
|
16
17
|
export declare enum AnnotationSubType {
|
|
17
18
|
Text = 1,
|
|
@@ -44,6 +45,9 @@ export declare enum AnnotationType {
|
|
|
44
45
|
FORM_BUTTON = "form-button",
|
|
45
46
|
BUTTON = "button"
|
|
46
47
|
}
|
|
48
|
+
export declare enum ErrorType {
|
|
49
|
+
NOT_SUPPORTED = "not-supported"
|
|
50
|
+
}
|
|
47
51
|
export interface AnnotationEventPayload {
|
|
48
52
|
type: AnnotationType;
|
|
49
53
|
data: any;
|
|
@@ -66,9 +70,9 @@ export type OutlineDestination = [
|
|
|
66
70
|
];
|
|
67
71
|
export type OutlineDestinationType = string | OutlineDestination;
|
|
68
72
|
export declare enum ZoomLevel {
|
|
69
|
-
ACTUAL = "Actual",
|
|
70
|
-
PAGE_FIT = "Fit",
|
|
71
|
-
PAGE_WIDTH = "Width"
|
|
73
|
+
ACTUAL = "Actual Size",
|
|
74
|
+
PAGE_FIT = "Page Fit",
|
|
75
|
+
PAGE_WIDTH = "Page Width"
|
|
72
76
|
}
|
|
73
77
|
export type Localization = {
|
|
74
78
|
searchButtonTooltip?: string;
|
|
@@ -491,9 +495,9 @@ export interface DimensionPagesContextType {
|
|
|
491
495
|
setHeights: React.Dispatch<React.SetStateAction<number[]>>;
|
|
492
496
|
}
|
|
493
497
|
export interface ZoomContextType {
|
|
494
|
-
zoomLevel: number;
|
|
498
|
+
zoomLevel: number | ZoomLevel;
|
|
495
499
|
currentZoom: number;
|
|
496
|
-
setZoomLevel:
|
|
500
|
+
setZoomLevel: (callback: number | ZoomLevel | ((prev: number) => number | ZoomLevel)) => void;
|
|
497
501
|
}
|
|
498
502
|
export type ZoomProps = Omit<ZoomContextType, 'currentZoom'>;
|
|
499
503
|
export type InitialStateContextType = {
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { SCROLL_BAR_WIDTH as
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
1
|
+
import { SCROLL_BAR_WIDTH as a } from "./constants.js";
|
|
2
|
+
import { ViewMode as u, ZoomLevel as r } from "./types.js";
|
|
3
|
+
const Z = (o, t, m, e, c, s) => {
|
|
4
4
|
if (typeof o == "number")
|
|
5
5
|
return o;
|
|
6
|
+
const n = s === u.DUAL_PAGE ? 2 * e : e;
|
|
6
7
|
switch (o) {
|
|
7
|
-
case
|
|
8
|
-
const
|
|
9
|
-
(
|
|
10
|
-
|
|
8
|
+
case r.PAGE_FIT:
|
|
9
|
+
const f = Math.min(
|
|
10
|
+
(t - a) / n,
|
|
11
|
+
m / c
|
|
11
12
|
);
|
|
12
|
-
return Math.floor(
|
|
13
|
-
case
|
|
14
|
-
return Math.floor(
|
|
15
|
-
case
|
|
13
|
+
return Math.floor(f * 100);
|
|
14
|
+
case r.PAGE_WIDTH:
|
|
15
|
+
return Math.floor((t - a) / n * 100);
|
|
16
|
+
case r.ACTUAL:
|
|
16
17
|
default:
|
|
17
18
|
return 100;
|
|
18
19
|
}
|
|
19
20
|
};
|
|
20
21
|
export {
|
|
21
|
-
|
|
22
|
+
Z as getZoomLevel
|
|
22
23
|
};
|
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import "../../contexts/RPDocumentContext.js";
|
|
4
4
|
import "../../contexts/DocumentPasswordContext.js";
|
|
5
|
-
import { b as
|
|
5
|
+
import { b as oo } from "../../ToolbarLayout.module-cbc8e216.js";
|
|
6
6
|
import "../../contexts/DarkModeContext.js";
|
|
7
7
|
import "../../contexts/RotationContext.js";
|
|
8
8
|
import "../../contexts/LayerContext.js";
|
|
@@ -25,6 +25,7 @@ import "../../contexts/DownloadContext.js";
|
|
|
25
25
|
import "../../contexts/SmoothScrollContext.js";
|
|
26
26
|
import "../../contexts/ElementPageContext.js";
|
|
27
27
|
import "../../contexts/PagesRotateContext.js";
|
|
28
|
+
import "../../contexts/GlobalCurrentPage.js";
|
|
28
29
|
import "../../contexts/LoaderContext.js";
|
|
29
30
|
import "../../contexts/ToolComponentContext.js";
|
|
30
31
|
import "../../contexts/IconToolContext.js";
|
|
@@ -44,11 +45,12 @@ import "../../components/icons/LoaderIcon.js";
|
|
|
44
45
|
import "../../contexts/IconContext.js";
|
|
45
46
|
import "../../components/ui/RPTooltip.js";
|
|
46
47
|
import "../../components/ui/DropDown.js";
|
|
48
|
+
import "../../ZoomTool.module-6c5eabbb.js";
|
|
47
49
|
import "../../components/layout/toolbar/MenuItem.js";
|
|
48
50
|
import "../../components/layout/toolbar/MenuSeparator.js";
|
|
49
51
|
import "../dateFormatter.js";
|
|
50
52
|
import "../../components/layout/toolbar/PropertyItem.js";
|
|
51
53
|
import "../../components/layout/toolbar/RotateTool.js";
|
|
52
54
|
export {
|
|
53
|
-
|
|
55
|
+
oo as useFileDownload
|
|
54
56
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState as E, useCallback as h, useEffect as A } from "react";
|
|
2
2
|
import { appConsole as l } from "../appConsole.js";
|
|
3
|
-
const b = /* @__PURE__ */ new Date("2025-
|
|
3
|
+
const b = /* @__PURE__ */ new Date("2025-10-03T03:57:13.618Z"), d = "Please visit https://www.react-pdf.dev/manage-license/ to generate a new license key.", s = {
|
|
4
4
|
invalidLicense: `You are currently using without a valid license. ${d}`,
|
|
5
5
|
mismatchedDomain: `Your license key is not valid for the current domain / IP. ${d}`,
|
|
6
6
|
expired: `Your license key has expired. ${d}`,
|
|
@@ -1,70 +1,77 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { useState as a, useRef as N, useEffect as k } from "react";
|
|
2
|
+
import * as x from "pdfjs-dist";
|
|
3
|
+
import { ErrorType as O } from "../types.js";
|
|
4
|
+
import { getThumbnailViewport as U } from "../getThumbnailViewport.js";
|
|
5
|
+
import { useConfigContext as h } from "../../contexts/ConfigContext.js";
|
|
6
|
+
import { useDocumentPasswordContext as j } from "../../contexts/DocumentPasswordContext.js";
|
|
7
|
+
const G = (f, s, V = {}) => {
|
|
8
|
+
const [n, C] = a(), { workerUrlAdded: y } = h(), [I, L] = a(/* @__PURE__ */ new Map()), d = N(), [S, m] = a(0), [P, T] = a(!1), [q, v] = a(), { password: u, passwordError: D, setPasswordError: c, passwordRequired: g, setPasswordRequired: p } = j(), { onLoadError: i, onLoaded: w } = V;
|
|
9
|
+
return k(() => {
|
|
10
|
+
if (!y || !f)
|
|
10
11
|
return;
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
url:
|
|
14
|
-
cMapPacked: (
|
|
15
|
-
...(
|
|
16
|
-
...
|
|
17
|
-
verbosity:
|
|
18
|
-
}, n = V.getDocument(E);
|
|
19
|
-
n.onProgress = (o) => {
|
|
20
|
-
if (t === i.current) {
|
|
21
|
-
const { loaded: b, total: a } = o, R = a ? Math.min(100, Math.round(b / a * 100)) : 0;
|
|
22
|
-
f(R);
|
|
23
|
-
}
|
|
24
|
-
}, x(!0);
|
|
25
|
-
const s = n.promise.then((o) => (t === i.current && (I(o), f(100)), w && w(o), c(!1), g(""), o)).catch((o) => {
|
|
26
|
-
o instanceof Error && o.name === "PasswordException" ? (c(!0), g(o.message || "Password required")) : o instanceof Error && o.name === "InvalidPDFException" && d ? (c(!0), g("Incorrect password")) : p && p(o);
|
|
27
|
-
}).finally(() => {
|
|
28
|
-
x(!1);
|
|
29
|
-
});
|
|
30
|
-
return () => {
|
|
31
|
-
s.finally(() => {
|
|
32
|
-
n.destroy();
|
|
33
|
-
});
|
|
12
|
+
m(0), d.current = Date.now();
|
|
13
|
+
const r = d.current, E = {
|
|
14
|
+
url: f,
|
|
15
|
+
cMapPacked: (s == null ? void 0 : s.isCompressed) ?? !0,
|
|
16
|
+
...(s == null ? void 0 : s.url) && { cMapUrl: s.url },
|
|
17
|
+
...u && { password: u },
|
|
18
|
+
verbosity: x.VerbosityLevel.ERRORS
|
|
34
19
|
};
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
try {
|
|
21
|
+
const e = x.getDocument(E);
|
|
22
|
+
e.onProgress = (o) => {
|
|
23
|
+
if (r === d.current) {
|
|
24
|
+
const { loaded: R, total: l } = o, b = l ? Math.min(100, Math.round(R / l * 100)) : 0;
|
|
25
|
+
m(b);
|
|
26
|
+
}
|
|
27
|
+
}, T(!0);
|
|
28
|
+
const t = e.promise.then((o) => (r === d.current && (C(o), m(100)), w && w(o), p(!1), c(""), o)).catch((o) => {
|
|
29
|
+
o instanceof Error && o.name === "PasswordException" ? (p(!0), c(o.message || "Password required")) : o instanceof Error && o.name === "InvalidPDFException" && u ? (p(!0), c("Incorrect password")) : i && i(o);
|
|
30
|
+
}).finally(() => {
|
|
31
|
+
T(!1);
|
|
32
|
+
});
|
|
33
|
+
return () => {
|
|
34
|
+
t.finally(() => {
|
|
35
|
+
e.destroy();
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
} catch (e) {
|
|
39
|
+
v(O.NOT_SUPPORTED), i && i(e);
|
|
40
|
+
}
|
|
41
|
+
}, [f, y, u, i, w]), k(() => {
|
|
42
|
+
if (g)
|
|
37
43
|
return;
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
40
|
-
|
|
44
|
+
const r = /* @__PURE__ */ new Map();
|
|
45
|
+
if (!n || P) {
|
|
46
|
+
L(r);
|
|
41
47
|
return;
|
|
42
48
|
}
|
|
43
|
-
const E =
|
|
44
|
-
for (let
|
|
45
|
-
const o =
|
|
46
|
-
|
|
49
|
+
const E = n.numPages, e = [];
|
|
50
|
+
for (let t = 1; t <= E; t++) {
|
|
51
|
+
const o = n.getPage(t);
|
|
52
|
+
e.push(o);
|
|
47
53
|
}
|
|
48
|
-
Promise.all(
|
|
49
|
-
|
|
50
|
-
const { thumbnailViewport:
|
|
51
|
-
|
|
54
|
+
Promise.all(e).then((t) => {
|
|
55
|
+
t.map((o) => {
|
|
56
|
+
const { thumbnailViewport: R, scale: l } = U(o), b = o.getViewport();
|
|
57
|
+
r.set(o.pageNumber, {
|
|
52
58
|
page: o,
|
|
53
|
-
thumbnailViewport:
|
|
54
|
-
thumbnailScale:
|
|
55
|
-
defaultRotation:
|
|
59
|
+
thumbnailViewport: R,
|
|
60
|
+
thumbnailScale: l,
|
|
61
|
+
defaultRotation: b.rotation
|
|
56
62
|
});
|
|
57
|
-
}),
|
|
63
|
+
}), L(r);
|
|
58
64
|
});
|
|
59
|
-
}, [
|
|
60
|
-
pdf:
|
|
61
|
-
pages:
|
|
62
|
-
loading:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
}, [n, P, g]), {
|
|
66
|
+
pdf: n,
|
|
67
|
+
pages: I,
|
|
68
|
+
loading: P,
|
|
69
|
+
error: q,
|
|
70
|
+
loadingProgress: S,
|
|
71
|
+
passwordRequired: g,
|
|
72
|
+
passwordError: D
|
|
66
73
|
};
|
|
67
74
|
};
|
|
68
75
|
export {
|
|
69
|
-
|
|
76
|
+
G as useLoadPdf
|
|
70
77
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState as a, useMemo as m } from "react";
|
|
2
|
-
import { e as s, t as p, z as u, i as _, p as L } from "../../th_TH-
|
|
2
|
+
import { e as s, t as p, z as u, i as _, p as L } from "../../th_TH-d627cd51.js";
|
|
3
3
|
const f = (e) => {
|
|
4
4
|
const [o, c] = a(e), [t, i] = a({
|
|
5
5
|
en_US: s,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import "../types.js";
|
|
3
|
-
import {
|
|
3
|
+
import { r as tr } from "../../ToolbarLayout.module-cbc8e216.js";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "../../contexts/RPDocumentContext.js";
|
|
6
6
|
import "../../contexts/DocumentPasswordContext.js";
|
|
@@ -26,6 +26,7 @@ import "../../contexts/DownloadContext.js";
|
|
|
26
26
|
import "../../contexts/SmoothScrollContext.js";
|
|
27
27
|
import "../../contexts/ElementPageContext.js";
|
|
28
28
|
import "../../contexts/PagesRotateContext.js";
|
|
29
|
+
import "../../contexts/GlobalCurrentPage.js";
|
|
29
30
|
import "../../contexts/LoaderContext.js";
|
|
30
31
|
import "../../contexts/ToolComponentContext.js";
|
|
31
32
|
import "../../contexts/IconToolContext.js";
|
|
@@ -45,6 +46,7 @@ import "../../components/icons/LoaderIcon.js";
|
|
|
45
46
|
import "../../contexts/IconContext.js";
|
|
46
47
|
import "../../components/ui/RPTooltip.js";
|
|
47
48
|
import "../../components/ui/DropDown.js";
|
|
49
|
+
import "../../ZoomTool.module-6c5eabbb.js";
|
|
48
50
|
import "../../components/layout/toolbar/MenuItem.js";
|
|
49
51
|
import "../../components/layout/toolbar/MenuSeparator.js";
|
|
50
52
|
import "../dateFormatter.js";
|
|
@@ -52,5 +54,5 @@ import "../../components/layout/toolbar/PropertyItem.js";
|
|
|
52
54
|
import "../../components/layout/toolbar/RotateTool.js";
|
|
53
55
|
import "./useDebounce.js";
|
|
54
56
|
export {
|
|
55
|
-
|
|
57
|
+
tr as usePaginate
|
|
56
58
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useState as
|
|
1
|
+
import { useState as L, useRef as T, useCallback as r, useEffect as u } from "react";
|
|
2
2
|
import { useDebounce as g } from "./useDebounce.js";
|
|
3
3
|
import { useZoomContext as A } from "../../contexts/ZoomContext.js";
|
|
4
4
|
const I = (n) => {
|
|
5
|
-
const { currentZoom:
|
|
5
|
+
const { currentZoom: p, setZoomLevel: w } = A(), [D, d] = L(0), a = g(D, 100), [o, b] = L(!1), c = T(null), i = r((e) => {
|
|
6
6
|
d(e ? (t) => t + 3 : (t) => t - 3);
|
|
7
|
-
}, []),
|
|
7
|
+
}, []), f = r(
|
|
8
8
|
(e) => {
|
|
9
9
|
if (!e.ctrlKey)
|
|
10
10
|
return;
|
|
@@ -15,33 +15,33 @@ const I = (n) => {
|
|
|
15
15
|
[i]
|
|
16
16
|
);
|
|
17
17
|
u(() => {
|
|
18
|
-
if (
|
|
19
|
-
const e = Math.round(
|
|
20
|
-
d(0),
|
|
18
|
+
if (a) {
|
|
19
|
+
const e = Math.round(p * 100 + a);
|
|
20
|
+
d(0), w(e > 25 ? e : 25);
|
|
21
21
|
}
|
|
22
|
-
}, [
|
|
23
|
-
const
|
|
22
|
+
}, [a]);
|
|
23
|
+
const E = (e, t) => {
|
|
24
24
|
const s = e.clientX - t.clientX, l = e.clientY - t.clientY;
|
|
25
25
|
return Math.sqrt(s * s + l * l);
|
|
26
26
|
}, h = r(
|
|
27
27
|
(e) => {
|
|
28
28
|
if (!o || e.touches.length !== 2)
|
|
29
29
|
return;
|
|
30
|
-
const t =
|
|
30
|
+
const t = E(e.touches[0], e.touches[1]);
|
|
31
31
|
c.current = t, e.preventDefault();
|
|
32
32
|
},
|
|
33
33
|
[o]
|
|
34
34
|
), v = r(() => {
|
|
35
35
|
c.current = null;
|
|
36
|
-
}, []),
|
|
36
|
+
}, []), m = r(
|
|
37
37
|
(e) => {
|
|
38
38
|
if (!o || e.touches.length !== 2 || c.current === null)
|
|
39
39
|
return;
|
|
40
|
-
const t =
|
|
40
|
+
const t = E(e.touches[0], e.touches[1]), s = t - c.current, l = Math.abs(s) > 5, S = s > 0;
|
|
41
41
|
l && (i(S), c.current = t, e.preventDefault());
|
|
42
42
|
},
|
|
43
43
|
[i, o]
|
|
44
|
-
),
|
|
44
|
+
), y = () => {
|
|
45
45
|
document.activeElement instanceof HTMLElement && document.activeElement.blur();
|
|
46
46
|
};
|
|
47
47
|
u(() => {
|
|
@@ -53,7 +53,7 @@ const I = (n) => {
|
|
|
53
53
|
}, [o]), u(() => {
|
|
54
54
|
const e = () => {
|
|
55
55
|
const t = document.activeElement, s = !!(t != null && t.closest('[data-rp="container"]'));
|
|
56
|
-
|
|
56
|
+
b(s);
|
|
57
57
|
};
|
|
58
58
|
return window.addEventListener("focusin", e), window.addEventListener("focusout", e), e(), () => {
|
|
59
59
|
window.removeEventListener("focusin", e), window.removeEventListener("focusout", e);
|
|
@@ -62,17 +62,17 @@ const I = (n) => {
|
|
|
62
62
|
if (!n)
|
|
63
63
|
return;
|
|
64
64
|
const e = (t) => {
|
|
65
|
-
n.contains(t.target) ||
|
|
65
|
+
n.contains(t.target) || y();
|
|
66
66
|
};
|
|
67
67
|
return document.addEventListener("scroll", e), () => {
|
|
68
68
|
document.removeEventListener("scroll", e);
|
|
69
69
|
};
|
|
70
70
|
}, [n]), u(() => {
|
|
71
71
|
if (n)
|
|
72
|
-
return n.addEventListener("wheel",
|
|
73
|
-
n.removeEventListener("wheel",
|
|
72
|
+
return n.addEventListener("wheel", f, { passive: !1 }), n.addEventListener("touchstart", h, { passive: !1 }), n.addEventListener("touchmove", m, { passive: !1 }), n.addEventListener("touchend", v, { passive: !1 }), () => {
|
|
73
|
+
n.removeEventListener("wheel", f), n.removeEventListener("touchstart", h), n.removeEventListener("touchmove", m), n.removeEventListener("touchend", v);
|
|
74
74
|
};
|
|
75
|
-
}, [n,
|
|
75
|
+
}, [n, f, h, m, v]);
|
|
76
76
|
};
|
|
77
77
|
export {
|
|
78
78
|
I as usePinch
|
|
@@ -5,7 +5,7 @@ import "../calculatePage.js";
|
|
|
5
5
|
import "react/jsx-runtime";
|
|
6
6
|
import "../../contexts/RPDocumentContext.js";
|
|
7
7
|
import "../../contexts/DocumentPasswordContext.js";
|
|
8
|
-
import {
|
|
8
|
+
import { K as tr } from "../../ToolbarLayout.module-cbc8e216.js";
|
|
9
9
|
import "../../contexts/DarkModeContext.js";
|
|
10
10
|
import "../../contexts/RotationContext.js";
|
|
11
11
|
import "../../contexts/LayerContext.js";
|
|
@@ -26,6 +26,7 @@ import "../../contexts/DownloadContext.js";
|
|
|
26
26
|
import "../../contexts/SmoothScrollContext.js";
|
|
27
27
|
import "../../contexts/ElementPageContext.js";
|
|
28
28
|
import "../../contexts/PagesRotateContext.js";
|
|
29
|
+
import "../../contexts/GlobalCurrentPage.js";
|
|
29
30
|
import "../../contexts/LoaderContext.js";
|
|
30
31
|
import "../../contexts/ToolComponentContext.js";
|
|
31
32
|
import "../../contexts/IconToolContext.js";
|
|
@@ -45,6 +46,7 @@ import "../../components/icons/LoaderIcon.js";
|
|
|
45
46
|
import "../../contexts/IconContext.js";
|
|
46
47
|
import "../../components/ui/RPTooltip.js";
|
|
47
48
|
import "../../components/ui/DropDown.js";
|
|
49
|
+
import "../../ZoomTool.module-6c5eabbb.js";
|
|
48
50
|
import "../../components/layout/toolbar/MenuItem.js";
|
|
49
51
|
import "../../components/layout/toolbar/MenuSeparator.js";
|
|
50
52
|
import "../dateFormatter.js";
|
|
@@ -52,5 +54,5 @@ import "../../components/layout/toolbar/PropertyItem.js";
|
|
|
52
54
|
import "../../components/layout/toolbar/RotateTool.js";
|
|
53
55
|
import "./useDebounce.js";
|
|
54
56
|
export {
|
|
55
|
-
|
|
57
|
+
tr as usePresentPage
|
|
56
58
|
};
|