@embedpdf/viewer-chrome 3.0.0-next.14 → 3.0.0-next.16
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/README.md +175 -132
- package/dist/annotation-fonts-DWjVOTP0.js +80 -0
- package/dist/annotation-fonts-DWjVOTP0.js.map +1 -0
- package/dist/annotation-fonts-dpfVkhnq.cjs +91 -0
- package/dist/annotation-fonts-dpfVkhnq.cjs.map +1 -0
- package/dist/annotation-style-B3XKAyZ-.cjs +879 -0
- package/dist/annotation-style-B3XKAyZ-.cjs.map +1 -0
- package/dist/annotation-style-CXF3X47Z.js +879 -0
- package/dist/annotation-style-CXF3X47Z.js.map +1 -0
- package/dist/ar-B132r9bo.cjs +659 -0
- package/dist/ar-B132r9bo.cjs.map +1 -0
- package/dist/ar-BLWFJoA_.js +659 -0
- package/dist/ar-BLWFJoA_.js.map +1 -0
- package/dist/attachments-panel-Cxln8xos.cjs +217 -0
- package/dist/attachments-panel-Cxln8xos.cjs.map +1 -0
- package/dist/attachments-panel-H1ucRbwo.js +217 -0
- package/dist/attachments-panel-H1ucRbwo.js.map +1 -0
- package/dist/chrome.cjs +399 -242
- package/dist/chrome.cjs.map +1 -1
- package/dist/chrome.d.cts +5 -35
- package/dist/chrome.d.ts +5 -35
- package/dist/chrome.js +398 -239
- package/dist/chrome.js.map +1 -1
- package/dist/commands-BkgLP3Om.js +1348 -0
- package/dist/commands-BkgLP3Om.js.map +1 -0
- package/dist/commands-DL1gjZt7.cjs +1473 -0
- package/dist/commands-DL1gjZt7.cjs.map +1 -0
- package/dist/commands.cjs +13 -649
- package/dist/commands.d.cts +30 -3
- package/dist/commands.d.ts +30 -3
- package/dist/commands.js +2 -647
- package/dist/comments-panel-BsnWedTh.cjs +514 -0
- package/dist/comments-panel-BsnWedTh.cjs.map +1 -0
- package/dist/comments-panel-D7Eadws9.js +514 -0
- package/dist/comments-panel-D7Eadws9.js.map +1 -0
- package/dist/de-7_MvFWzN.cjs +658 -0
- package/dist/de-7_MvFWzN.cjs.map +1 -0
- package/dist/de-BUhwc9-x.js +658 -0
- package/dist/de-BUhwc9-x.js.map +1 -0
- package/dist/dialog-BIb373cg.js +55 -0
- package/dist/dialog-BIb373cg.js.map +1 -0
- package/dist/dialog-CngKTnAM.cjs +60 -0
- package/dist/dialog-CngKTnAM.cjs.map +1 -0
- package/dist/es-DgYj-1L3.cjs +658 -0
- package/dist/es-DgYj-1L3.cjs.map +1 -0
- package/dist/es-DoXTqFoO.js +658 -0
- package/dist/es-DoXTqFoO.js.map +1 -0
- package/dist/form-design-panel-CgV_5YWC.js +418 -0
- package/dist/form-design-panel-CgV_5YWC.js.map +1 -0
- package/dist/form-design-panel-D0FdmWXW.cjs +418 -0
- package/dist/form-design-panel-D0FdmWXW.cjs.map +1 -0
- package/dist/fr-B-8NDhBA.js +658 -0
- package/dist/fr-B-8NDhBA.js.map +1 -0
- package/dist/fr-C856dmQJ.cjs +658 -0
- package/dist/fr-C856dmQJ.cjs.map +1 -0
- package/dist/he-BFTeNc4t.cjs +659 -0
- package/dist/he-BFTeNc4t.cjs.map +1 -0
- package/dist/he-Dlh0fNXM.js +659 -0
- package/dist/he-Dlh0fNXM.js.map +1 -0
- package/dist/icons-1UfLUZ_y.cjs +1029 -0
- package/dist/icons-1UfLUZ_y.cjs.map +1 -0
- package/dist/icons-7dB0Y1ct.js +875 -0
- package/dist/icons-7dB0Y1ct.js.map +1 -0
- package/dist/index.cjs +3651 -5447
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +646 -144
- package/dist/index.d.ts +646 -144
- package/dist/index.js +3618 -5368
- package/dist/index.js.map +1 -1
- package/dist/it-Bef-2Yxq.cjs +658 -0
- package/dist/it-Bef-2Yxq.cjs.map +1 -0
- package/dist/it-BkirG7ol.js +658 -0
- package/dist/it-BkirG7ol.js.map +1 -0
- package/dist/ja-CGEjCE-s.js +658 -0
- package/dist/ja-CGEjCE-s.js.map +1 -0
- package/dist/ja-DNw2zqSD.cjs +658 -0
- package/dist/ja-DNw2zqSD.cjs.map +1 -0
- package/dist/ko-CTkl5vMh.js +658 -0
- package/dist/ko-CTkl5vMh.js.map +1 -0
- package/dist/ko-YHzeBqP6.cjs +658 -0
- package/dist/ko-YHzeBqP6.cjs.map +1 -0
- package/dist/labels-BiM9wp9K.cjs +21 -0
- package/dist/labels-BiM9wp9K.cjs.map +1 -0
- package/dist/labels-C6_i87Oj.js +16 -0
- package/dist/labels-C6_i87Oj.js.map +1 -0
- package/dist/link-editor-CAS7MZM2.cjs +125 -0
- package/dist/link-editor-CAS7MZM2.cjs.map +1 -0
- package/dist/link-editor-CkwtqRvb.js +125 -0
- package/dist/link-editor-CkwtqRvb.js.map +1 -0
- package/dist/measurement-CQdbnIrn.js +325 -0
- package/dist/measurement-CQdbnIrn.js.map +1 -0
- package/dist/measurement-Cxv1Ahxx.cjs +326 -0
- package/dist/measurement-Cxv1Ahxx.cjs.map +1 -0
- package/dist/nl-BjkbaLq3.cjs +658 -0
- package/dist/nl-BjkbaLq3.cjs.map +1 -0
- package/dist/nl-Dya4sR8_.js +658 -0
- package/dist/nl-Dya4sR8_.js.map +1 -0
- package/dist/outline-panel-BpGtBdj0.cjs +707 -0
- package/dist/outline-panel-BpGtBdj0.cjs.map +1 -0
- package/dist/outline-panel-DO5_REYw.js +707 -0
- package/dist/outline-panel-DO5_REYw.js.map +1 -0
- package/dist/outline-properties-BCa2cc0t.js +330 -0
- package/dist/outline-properties-BCa2cc0t.js.map +1 -0
- package/dist/outline-properties-DT3FIxCw.cjs +330 -0
- package/dist/outline-properties-DT3FIxCw.cjs.map +1 -0
- package/dist/pl-CKKdVnpZ.cjs +658 -0
- package/dist/pl-CKKdVnpZ.cjs.map +1 -0
- package/dist/pl-DA9b5NVg.js +658 -0
- package/dist/pl-DA9b5NVg.js.map +1 -0
- package/dist/print-dialog-BqIrHCBh.cjs +276 -0
- package/dist/print-dialog-BqIrHCBh.cjs.map +1 -0
- package/dist/print-dialog-DvcI2m2_.js +276 -0
- package/dist/print-dialog-DvcI2m2_.js.map +1 -0
- package/dist/pt-DLcszlzi.cjs +658 -0
- package/dist/pt-DLcszlzi.cjs.map +1 -0
- package/dist/pt-Nm8yyjbX.js +658 -0
- package/dist/pt-Nm8yyjbX.js.map +1 -0
- package/dist/redact-confirm-C6EiK8yN.cjs +83 -0
- package/dist/redact-confirm-C6EiK8yN.cjs.map +1 -0
- package/dist/redact-confirm-CKuv9iN_.js +83 -0
- package/dist/redact-confirm-CKuv9iN_.js.map +1 -0
- package/dist/redaction-panel-CgNZ-pQk.js +96 -0
- package/dist/redaction-panel-CgNZ-pQk.js.map +1 -0
- package/dist/redaction-panel-ZhX0dlMi.cjs +96 -0
- package/dist/redaction-panel-ZhX0dlMi.cjs.map +1 -0
- package/dist/search-panel-BE4xzWlm.js +249 -0
- package/dist/search-panel-BE4xzWlm.js.map +1 -0
- package/dist/search-panel-wcbTNG1z.cjs +249 -0
- package/dist/search-panel-wcbTNG1z.cjs.map +1 -0
- package/dist/sheet-DTBFiwde.cjs +461 -0
- package/dist/sheet-DTBFiwde.cjs.map +1 -0
- package/dist/sheet-DyjKfAq0.js +378 -0
- package/dist/sheet-DyjKfAq0.js.map +1 -0
- package/dist/sign-dialog-D5WGx-Yn.cjs +155 -0
- package/dist/sign-dialog-D5WGx-Yn.cjs.map +1 -0
- package/dist/sign-dialog-DerNe8qT.js +155 -0
- package/dist/sign-dialog-DerNe8qT.js.map +1 -0
- package/dist/signature-inspector-Bz6TAfZM.cjs +160 -0
- package/dist/signature-inspector-Bz6TAfZM.cjs.map +1 -0
- package/dist/signature-inspector-CsGr9EBk.js +160 -0
- package/dist/signature-inspector-CsGr9EBk.js.map +1 -0
- package/dist/signature-maker-D_YfBXLn.cjs +393 -0
- package/dist/signature-maker-D_YfBXLn.cjs.map +1 -0
- package/dist/signature-maker-Dnth4rV4.js +393 -0
- package/dist/signature-maker-Dnth4rV4.js.map +1 -0
- package/dist/signatures-panel-Ci_LaI1C.cjs +294 -0
- package/dist/signatures-panel-Ci_LaI1C.cjs.map +1 -0
- package/dist/signatures-panel-DZ9ywrjz.js +294 -0
- package/dist/signatures-panel-DZ9ywrjz.js.map +1 -0
- package/dist/stamp-store-BHvRs-Do.cjs +147 -0
- package/dist/stamp-store-BHvRs-Do.cjs.map +1 -0
- package/dist/stamp-store-WuF-L3Jj.js +112 -0
- package/dist/stamp-store-WuF-L3Jj.js.map +1 -0
- package/dist/stamps-panel-BrczStaz.js +225 -0
- package/dist/stamps-panel-BrczStaz.js.map +1 -0
- package/dist/stamps-panel-Cv9nJBwx.cjs +225 -0
- package/dist/stamps-panel-Cv9nJBwx.cjs.map +1 -0
- package/dist/theme-Be0OZokZ.js +97 -0
- package/dist/theme-Be0OZokZ.js.map +1 -0
- package/dist/theme-FR26JI3r.cjs +126 -0
- package/dist/theme-FR26JI3r.cjs.map +1 -0
- package/dist/toolbar-DF361xWY.js +1565 -0
- package/dist/toolbar-DF361xWY.js.map +1 -0
- package/dist/toolbar-ddvpsvTb.cjs +1660 -0
- package/dist/toolbar-ddvpsvTb.cjs.map +1 -0
- package/dist/zh-cn-BMPPkLpL.js +658 -0
- package/dist/zh-cn-BMPPkLpL.js.map +1 -0
- package/dist/zh-cn-CZOO3p4H.cjs +658 -0
- package/dist/zh-cn-CZOO3p4H.cjs.map +1 -0
- package/package.json +6 -4
- package/src/styles.css +161 -89
- package/dist/commands.cjs.map +0 -1
- package/dist/commands.js.map +0 -1
- package/dist/es-BXLlBo2b.cjs +0 -321
- package/dist/es-BXLlBo2b.cjs.map +0 -1
- package/dist/es-CLgTsFDS.js +0 -321
- package/dist/es-CLgTsFDS.js.map +0 -1
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { a as PRINT_DIALOG } from "./commands-BkgLP3Om.js";
|
|
2
|
+
import { t as Dialog } from "./dialog-BIb373cg.js";
|
|
3
|
+
import { useEffect, useId, useRef, useState } from "react";
|
|
4
|
+
import { useDocumentId, useDocuments, usePageList } from "@embedpdf/react/runtime";
|
|
5
|
+
import { useStageState } from "@embedpdf/react/stage";
|
|
6
|
+
import { useT } from "@embedpdf/react/i18n";
|
|
7
|
+
import { useSurface } from "@embedpdf/react/shell";
|
|
8
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/ui/print-pages.ts
|
|
10
|
+
/**
|
|
11
|
+
* The pages a Print dialog's range names, as people type them: page numbers counted from 1, and
|
|
12
|
+
* ranges of them, separated by commas ("1-3, 5"). They come out in the document's order, each
|
|
13
|
+
* once, as the browser's own print dialog prints them. `null` when the text names no page, or a
|
|
14
|
+
* page the document doesn't have.
|
|
15
|
+
*/
|
|
16
|
+
function pagesInRange(text, pageCount) {
|
|
17
|
+
const parts = text.split(/[,,、،]/).map((part) => part.trim()).filter((part) => part !== "");
|
|
18
|
+
if (parts.length === 0) return null;
|
|
19
|
+
const pages = /* @__PURE__ */ new Set();
|
|
20
|
+
for (const part of parts) {
|
|
21
|
+
const match = /^(\d+)(?:\s*[-–]\s*(\d+))?$/.exec(part);
|
|
22
|
+
if (!match) return null;
|
|
23
|
+
const first = Number(match[1]);
|
|
24
|
+
const last = match[2] === void 0 ? first : Number(match[2]);
|
|
25
|
+
if (first < 1 || first > last || last > pageCount) return null;
|
|
26
|
+
for (let page = first; page <= last; page += 1) pages.add(page);
|
|
27
|
+
}
|
|
28
|
+
return [...pages].sort((a, b) => a - b);
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/ui/print-dialog.tsx
|
|
32
|
+
/**
|
|
33
|
+
* The Print dialog, which `document:print` opens: every page, the current page or a range of
|
|
34
|
+
* them, and whether annotations print. Nothing is made while the user chooses: Print prepares
|
|
35
|
+
* the printout the choices describe, shows how far that is, and opens the browser's print dialog
|
|
36
|
+
* as soon as it is ready. Safari prints only from a tap, and the one on Print was spent preparing,
|
|
37
|
+
* so there the printout waits for another (`PreparedPrint.needsTap`). Cancel stops it at any
|
|
38
|
+
* point. Form fields always print, each as its own print setting says; annotations follow
|
|
39
|
+
* theirs.
|
|
40
|
+
*/
|
|
41
|
+
/** The pages a choice names: `undefined` for every page, `null` when it names none. */
|
|
42
|
+
function chosenPages(choice, pages, currentIndex, range) {
|
|
43
|
+
if (choice === "all") return void 0;
|
|
44
|
+
if (choice === "current") {
|
|
45
|
+
const page = pages[currentIndex];
|
|
46
|
+
return page ? [page.ref] : null;
|
|
47
|
+
}
|
|
48
|
+
return pagesInRange(range, pages.length)?.map((page) => pages[page - 1].ref) ?? null;
|
|
49
|
+
}
|
|
50
|
+
/** Cancel the printout on its way, or free the one made. */
|
|
51
|
+
function drop(held) {
|
|
52
|
+
held.current?.cancel.abort();
|
|
53
|
+
held.current?.prepared?.dispose();
|
|
54
|
+
held.current = null;
|
|
55
|
+
}
|
|
56
|
+
function PrintDialog() {
|
|
57
|
+
const surface = useSurface(PRINT_DIALOG);
|
|
58
|
+
return surface.isOpen ? /* @__PURE__ */ jsx(PrintForm, { onClose: surface.close }) : null;
|
|
59
|
+
}
|
|
60
|
+
function PrintForm({ onClose }) {
|
|
61
|
+
const t = useT();
|
|
62
|
+
const titleId = useId();
|
|
63
|
+
const rangeId = useId();
|
|
64
|
+
const choiceName = useId();
|
|
65
|
+
const documents = useDocuments();
|
|
66
|
+
const documentId = useDocumentId();
|
|
67
|
+
const pages = usePageList();
|
|
68
|
+
const currentIndex = useStageState((state) => state.currentPageIndex);
|
|
69
|
+
const [choice, setChoice] = useState("all");
|
|
70
|
+
const [range, setRange] = useState("");
|
|
71
|
+
const [includeAnnotations, setIncludeAnnotations] = useState(true);
|
|
72
|
+
const [job, setJob] = useState({ kind: "choosing" });
|
|
73
|
+
const held = useRef(null);
|
|
74
|
+
const cancelButton = useRef(null);
|
|
75
|
+
const printButton = useRef(null);
|
|
76
|
+
const quality = documents.getPrintQuality(documentId ?? void 0);
|
|
77
|
+
const chosen = chosenPages(choice, pages, currentIndex, range);
|
|
78
|
+
useEffect(() => () => drop(held), []);
|
|
79
|
+
const print = (prepared) => {
|
|
80
|
+
setJob({ kind: "printing" });
|
|
81
|
+
prepared.print().then(onClose, (error) => {
|
|
82
|
+
console.warn("[embedpdf] print failed", error);
|
|
83
|
+
setJob({ kind: "failed" });
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
const prepare = (pagesToPrint) => {
|
|
87
|
+
drop(held);
|
|
88
|
+
const job = {
|
|
89
|
+
cancel: new AbortController(),
|
|
90
|
+
prepared: null
|
|
91
|
+
};
|
|
92
|
+
const { signal } = job.cancel;
|
|
93
|
+
held.current = job;
|
|
94
|
+
setJob({
|
|
95
|
+
kind: "preparing",
|
|
96
|
+
progress: null
|
|
97
|
+
});
|
|
98
|
+
documents.preparePrint(documentId ?? void 0, {
|
|
99
|
+
...pagesToPrint ? { pages: pagesToPrint } : {},
|
|
100
|
+
includeAnnotations,
|
|
101
|
+
signal,
|
|
102
|
+
onProgress: (progress) => {
|
|
103
|
+
if (!signal.aborted) setJob({
|
|
104
|
+
kind: "preparing",
|
|
105
|
+
progress
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}).then((prepared) => {
|
|
109
|
+
if (signal.aborted) return prepared.dispose();
|
|
110
|
+
job.prepared = prepared;
|
|
111
|
+
if (prepared.needsTap) setJob({
|
|
112
|
+
kind: "ready",
|
|
113
|
+
prepared
|
|
114
|
+
});
|
|
115
|
+
else print(prepared);
|
|
116
|
+
}, (error) => {
|
|
117
|
+
if (signal.aborted) return;
|
|
118
|
+
console.warn("[embedpdf] preparing the printout failed", error);
|
|
119
|
+
setJob({ kind: "failed" });
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
useEffect(() => {
|
|
123
|
+
if (job.kind === "preparing" && job.progress === null) cancelButton.current?.focus();
|
|
124
|
+
if (job.kind === "ready") printButton.current?.focus();
|
|
125
|
+
}, [job]);
|
|
126
|
+
const choosing = job.kind === "choosing" || job.kind === "failed";
|
|
127
|
+
const status = job.kind === "preparing" ? job.progress && job.progress.pagesRendered > 0 ? t("print.preparingPage", { params: {
|
|
128
|
+
page: Math.min(job.progress.pagesRendered + 1, job.progress.pageCount),
|
|
129
|
+
total: job.progress.pageCount
|
|
130
|
+
} }) : t("print.preparing") : job.kind === "ready" ? t("print.ready") : job.kind === "failed" ? t("print.failed") : null;
|
|
131
|
+
const note = quality?.kind !== "images" ? null : quality.dpi < 300 ? t("print.lowResolution", { params: { dpi: quality.dpi } }) : t("print.images", { params: { dpi: quality.dpi } });
|
|
132
|
+
return /* @__PURE__ */ jsx(Dialog, {
|
|
133
|
+
labelledBy: titleId,
|
|
134
|
+
onClose: () => {
|
|
135
|
+
if (job.kind !== "printing") onClose();
|
|
136
|
+
},
|
|
137
|
+
className: "border-border bg-surface w-96 rounded-lg border p-4 shadow-xl",
|
|
138
|
+
children: /* @__PURE__ */ jsxs("form", {
|
|
139
|
+
onSubmit: (event) => {
|
|
140
|
+
event.preventDefault();
|
|
141
|
+
if (job.kind === "ready") print(job.prepared);
|
|
142
|
+
else if (choosing && chosen !== null) prepare(chosen);
|
|
143
|
+
},
|
|
144
|
+
children: [
|
|
145
|
+
/* @__PURE__ */ jsx("h2", {
|
|
146
|
+
id: titleId,
|
|
147
|
+
className: "text-fg text-base font-semibold",
|
|
148
|
+
children: t("print.title")
|
|
149
|
+
}),
|
|
150
|
+
choosing ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
151
|
+
/* @__PURE__ */ jsxs("fieldset", {
|
|
152
|
+
className: "mt-3",
|
|
153
|
+
children: [/* @__PURE__ */ jsx("legend", {
|
|
154
|
+
className: "text-fg-secondary text-sm font-medium",
|
|
155
|
+
children: t("print.pages")
|
|
156
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
157
|
+
className: "mt-1 flex flex-col gap-1",
|
|
158
|
+
children: [
|
|
159
|
+
/* @__PURE__ */ jsx(Choice, {
|
|
160
|
+
name: choiceName,
|
|
161
|
+
checked: choice === "all",
|
|
162
|
+
onChoose: () => setChoice("all"),
|
|
163
|
+
label: t("print.allPages")
|
|
164
|
+
}),
|
|
165
|
+
/* @__PURE__ */ jsx(Choice, {
|
|
166
|
+
name: choiceName,
|
|
167
|
+
checked: choice === "current",
|
|
168
|
+
onChoose: () => setChoice("current"),
|
|
169
|
+
label: t("print.currentPage")
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ jsxs("div", {
|
|
172
|
+
className: "flex items-center gap-2",
|
|
173
|
+
children: [/* @__PURE__ */ jsx(Choice, {
|
|
174
|
+
name: choiceName,
|
|
175
|
+
checked: choice === "range",
|
|
176
|
+
onChoose: () => setChoice("range"),
|
|
177
|
+
label: t("print.range"),
|
|
178
|
+
controls: rangeId
|
|
179
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
180
|
+
id: rangeId,
|
|
181
|
+
type: "text",
|
|
182
|
+
inputMode: "numeric",
|
|
183
|
+
"aria-label": t("print.rangeLabel"),
|
|
184
|
+
"aria-invalid": choice === "range" && chosen === null,
|
|
185
|
+
placeholder: t("print.rangePlaceholder"),
|
|
186
|
+
value: range,
|
|
187
|
+
onFocus: () => setChoice("range"),
|
|
188
|
+
onChange: (event) => setRange(event.target.value),
|
|
189
|
+
className: "border-border bg-surface text-fg focus:border-accent focus:ring-accent min-w-0 flex-1 rounded-md border px-1.5 py-1 text-sm tabular-nums outline-none focus:ring-1 aria-[invalid=true]:border-red-600"
|
|
190
|
+
})]
|
|
191
|
+
}),
|
|
192
|
+
choice === "range" && chosen === null && range.trim() !== "" ? /* @__PURE__ */ jsx("p", {
|
|
193
|
+
className: "text-xs text-red-600",
|
|
194
|
+
children: t("print.rangeInvalid", { params: { total: pages.length } })
|
|
195
|
+
}) : null
|
|
196
|
+
]
|
|
197
|
+
})]
|
|
198
|
+
}),
|
|
199
|
+
/* @__PURE__ */ jsxs("label", {
|
|
200
|
+
className: "mt-3 flex cursor-pointer items-center gap-2 text-sm",
|
|
201
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
202
|
+
type: "checkbox",
|
|
203
|
+
className: "accent-accent",
|
|
204
|
+
checked: includeAnnotations,
|
|
205
|
+
onChange: (event) => setIncludeAnnotations(event.target.checked)
|
|
206
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
207
|
+
className: "text-fg",
|
|
208
|
+
children: t("print.annotations")
|
|
209
|
+
})]
|
|
210
|
+
}),
|
|
211
|
+
note ? /* @__PURE__ */ jsx("p", {
|
|
212
|
+
className: "text-fg-muted mt-3 text-xs",
|
|
213
|
+
children: note
|
|
214
|
+
}) : null
|
|
215
|
+
] }) : /* @__PURE__ */ jsx(ProgressBar, {
|
|
216
|
+
progress: job.kind === "preparing" ? job.progress : null,
|
|
217
|
+
done: job.kind !== "preparing"
|
|
218
|
+
}),
|
|
219
|
+
/* @__PURE__ */ jsx("p", {
|
|
220
|
+
role: "status",
|
|
221
|
+
className: "text-fg-muted mt-2 min-h-5 text-sm",
|
|
222
|
+
children: status
|
|
223
|
+
}),
|
|
224
|
+
/* @__PURE__ */ jsxs("div", {
|
|
225
|
+
className: "mt-3 flex justify-end gap-2",
|
|
226
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
227
|
+
ref: cancelButton,
|
|
228
|
+
type: "button",
|
|
229
|
+
disabled: job.kind === "printing",
|
|
230
|
+
onClick: onClose,
|
|
231
|
+
className: "border-border text-fg hover:bg-hover rounded-md border px-3 py-1.5 text-sm",
|
|
232
|
+
children: t("print.cancel")
|
|
233
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
234
|
+
ref: printButton,
|
|
235
|
+
type: "submit",
|
|
236
|
+
disabled: choosing ? chosen === null : job.kind !== "ready",
|
|
237
|
+
className: "bg-accent text-on-accent hover:bg-accent-hover rounded-md px-3 py-1.5 text-sm disabled:opacity-60",
|
|
238
|
+
children: t("print.print")
|
|
239
|
+
})]
|
|
240
|
+
})
|
|
241
|
+
]
|
|
242
|
+
})
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* How far preparing got: the bar moves until the first page is ready (a PDF copy arrives all at
|
|
247
|
+
* once), then fills page by page. Full once the printout is made.
|
|
248
|
+
*/
|
|
249
|
+
function ProgressBar({ progress, done }) {
|
|
250
|
+
const fraction = done ? 1 : progress && progress.pagesRendered > 0 ? progress.pagesRendered / progress.pageCount : null;
|
|
251
|
+
return /* @__PURE__ */ jsx("div", {
|
|
252
|
+
"aria-hidden": "true",
|
|
253
|
+
className: "bg-hover mt-4 h-1.5 overflow-hidden rounded-full",
|
|
254
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
255
|
+
className: `bg-accent h-full rounded-full transition-[width] ${fraction === null ? "w-full animate-pulse" : ""}`,
|
|
256
|
+
style: fraction === null ? void 0 : { width: `${fraction * 100}%` }
|
|
257
|
+
})
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
function Choice({ name, checked, onChoose, label, controls }) {
|
|
261
|
+
return /* @__PURE__ */ jsxs("label", {
|
|
262
|
+
className: "text-fg flex cursor-pointer items-center gap-2 text-sm",
|
|
263
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
264
|
+
type: "radio",
|
|
265
|
+
name,
|
|
266
|
+
className: "accent-accent",
|
|
267
|
+
checked,
|
|
268
|
+
onChange: onChoose,
|
|
269
|
+
"aria-controls": controls
|
|
270
|
+
}), label]
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
//#endregion
|
|
274
|
+
export { PrintDialog };
|
|
275
|
+
|
|
276
|
+
//# sourceMappingURL=print-dialog-DvcI2m2_.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"print-dialog-DvcI2m2_.js","names":[],"sources":["../src/ui/print-pages.ts","../src/ui/print-dialog.tsx"],"sourcesContent":["/**\n * The pages a Print dialog's range names, as people type them: page numbers counted from 1, and\n * ranges of them, separated by commas (\"1-3, 5\"). They come out in the document's order, each\n * once, as the browser's own print dialog prints them. `null` when the text names no page, or a\n * page the document doesn't have.\n */\nexport function pagesInRange(text: string, pageCount: number): number[] | null {\n const parts = text\n // The comma, and the commas Chinese, Japanese and Arabic keyboards type.\n .split(/[,,、،]/)\n .map((part) => part.trim())\n .filter((part) => part !== '');\n if (parts.length === 0) return null;\n const pages = new Set<number>();\n for (const part of parts) {\n // A hyphen or an en dash, which some keyboards type for \"to\".\n const match = /^(\\d+)(?:\\s*[-–]\\s*(\\d+))?$/.exec(part);\n if (!match) return null;\n const first = Number(match[1]);\n const last = match[2] === undefined ? first : Number(match[2]);\n if (first < 1 || first > last || last > pageCount) return null;\n for (let page = first; page <= last; page += 1) pages.add(page);\n }\n return [...pages].sort((a, b) => a - b);\n}\n","/**\n * The Print dialog, which `document:print` opens: every page, the current page or a range of\n * them, and whether annotations print. Nothing is made while the user chooses: Print prepares\n * the printout the choices describe, shows how far that is, and opens the browser's print dialog\n * as soon as it is ready. Safari prints only from a tap, and the one on Print was spent preparing,\n * so there the printout waits for another (`PreparedPrint.needsTap`). Cancel stops it at any\n * point. Form fields always print, each as its own print setting says; annotations follow\n * theirs.\n */\nimport { useT } from '@embedpdf/react/i18n';\nimport {\n useDocumentId,\n useDocuments,\n usePageList,\n type PageInfo,\n type PageRef,\n type PreparedPrint,\n type PrintProgress,\n} from '@embedpdf/react/runtime';\nimport { useSurface } from '@embedpdf/react/shell';\nimport { useStageState } from '@embedpdf/react/stage';\nimport { useEffect, useId, useRef, useState } from 'react';\n\nimport { PRINT_DIALOG } from '../config/commands';\nimport { Dialog } from './dialog';\nimport { pagesInRange } from './print-pages';\n\ntype PageChoice = 'all' | 'current' | 'range';\n\n/** The pages a choice names: `undefined` for every page, `null` when it names none. */\nfunction chosenPages(\n choice: PageChoice,\n pages: readonly PageInfo[],\n currentIndex: number,\n range: string,\n): PageRef[] | undefined | null {\n if (choice === 'all') return undefined;\n if (choice === 'current') {\n const page = pages[currentIndex];\n return page ? [page.ref] : null;\n }\n return pagesInRange(range, pages.length)?.map((page) => pages[page - 1]!.ref) ?? null;\n}\n\n/**\n * The printout: not asked for yet, on its way (with how far), ready and waiting for the tap\n * Safari needs, being printed, or failed (the choices show again, to try once more).\n */\ntype Job =\n | { readonly kind: 'choosing' }\n | { readonly kind: 'preparing'; readonly progress: PrintProgress | null }\n | { readonly kind: 'ready'; readonly prepared: PreparedPrint }\n | { readonly kind: 'printing' }\n | { readonly kind: 'failed' };\n\n/** The printout the dialog holds: cancelled while on its way, freed once made. */\ninterface HeldPrint {\n readonly cancel: AbortController;\n prepared: PreparedPrint | null;\n}\n\n/** Cancel the printout on its way, or free the one made. */\nfunction drop(held: { current: HeldPrint | null }) {\n held.current?.cancel.abort();\n held.current?.prepared?.dispose();\n held.current = null;\n}\n\nexport function PrintDialog() {\n const surface = useSurface(PRINT_DIALOG);\n return surface.isOpen ? <PrintForm onClose={surface.close} /> : null;\n}\n\nfunction PrintForm({ onClose }: { onClose: () => void }) {\n const t = useT();\n const titleId = useId();\n const rangeId = useId();\n const choiceName = useId();\n const documents = useDocuments();\n const documentId = useDocumentId();\n const pages = usePageList();\n const currentIndex = useStageState((state) => state.currentPageIndex);\n const [choice, setChoice] = useState<PageChoice>('all');\n const [range, setRange] = useState('');\n const [includeAnnotations, setIncludeAnnotations] = useState(true);\n const [job, setJob] = useState<Job>({ kind: 'choosing' });\n const held = useRef<HeldPrint | null>(null);\n const cancelButton = useRef<HTMLButtonElement>(null);\n const printButton = useRef<HTMLButtonElement>(null);\n const quality = documents.getPrintQuality(documentId ?? undefined);\n const chosen = chosenPages(choice, pages, currentIndex, range);\n\n // Closing the dialog, by Cancel, Escape or a finished print, drops the printout.\n useEffect(() => () => drop(held), []);\n\n const print = (prepared: PreparedPrint) => {\n setJob({ kind: 'printing' });\n prepared.print().then(onClose, (error: unknown) => {\n console.warn('[embedpdf] print failed', error);\n setJob({ kind: 'failed' });\n });\n };\n\n const prepare = (pagesToPrint: readonly PageRef[] | undefined) => {\n drop(held);\n const job: HeldPrint = { cancel: new AbortController(), prepared: null };\n const { signal } = job.cancel;\n held.current = job;\n setJob({ kind: 'preparing', progress: null });\n documents\n .preparePrint(documentId ?? undefined, {\n ...(pagesToPrint ? { pages: pagesToPrint } : {}),\n includeAnnotations,\n signal,\n onProgress: (progress) => {\n if (!signal.aborted) setJob({ kind: 'preparing', progress });\n },\n })\n .then(\n (prepared) => {\n if (signal.aborted) return prepared.dispose();\n job.prepared = prepared;\n if (prepared.needsTap) setJob({ kind: 'ready', prepared });\n else print(prepared);\n },\n (error: unknown) => {\n if (signal.aborted) return;\n console.warn('[embedpdf] preparing the printout failed', error);\n setJob({ kind: 'failed' });\n },\n );\n };\n\n // While the printout is made, the choices give way to its progress: focus goes to Cancel, and\n // to Print once a printout waits for its tap.\n useEffect(() => {\n if (job.kind === 'preparing' && job.progress === null) cancelButton.current?.focus();\n if (job.kind === 'ready') printButton.current?.focus();\n }, [job]);\n\n const choosing = job.kind === 'choosing' || job.kind === 'failed';\n const status =\n job.kind === 'preparing'\n ? job.progress && job.progress.pagesRendered > 0\n ? t('print.preparingPage', {\n params: {\n page: Math.min(job.progress.pagesRendered + 1, job.progress.pageCount),\n total: job.progress.pageCount,\n },\n })\n : t('print.preparing')\n : job.kind === 'ready'\n ? t('print.ready')\n : job.kind === 'failed'\n ? t('print.failed')\n : null;\n // Pictures of the pages; a document that allows only low-resolution printing says so.\n const note =\n quality?.kind !== 'images'\n ? null\n : quality.dpi < 300\n ? t('print.lowResolution', { params: { dpi: quality.dpi } })\n : t('print.images', { params: { dpi: quality.dpi } });\n\n return (\n <Dialog\n labelledBy={titleId}\n onClose={() => {\n if (job.kind !== 'printing') onClose();\n }}\n className=\"border-border bg-surface w-96 rounded-lg border p-4 shadow-xl\"\n >\n <form\n onSubmit={(event) => {\n event.preventDefault();\n if (job.kind === 'ready') print(job.prepared);\n else if (choosing && chosen !== null) prepare(chosen);\n }}\n >\n <h2 id={titleId} className=\"text-fg text-base font-semibold\">\n {t('print.title')}\n </h2>\n {choosing ? (\n <>\n <fieldset className=\"mt-3\">\n <legend className=\"text-fg-secondary text-sm font-medium\">{t('print.pages')}</legend>\n <div className=\"mt-1 flex flex-col gap-1\">\n <Choice\n name={choiceName}\n checked={choice === 'all'}\n onChoose={() => setChoice('all')}\n label={t('print.allPages')}\n />\n <Choice\n name={choiceName}\n checked={choice === 'current'}\n onChoose={() => setChoice('current')}\n label={t('print.currentPage')}\n />\n <div className=\"flex items-center gap-2\">\n <Choice\n name={choiceName}\n checked={choice === 'range'}\n onChoose={() => setChoice('range')}\n label={t('print.range')}\n controls={rangeId}\n />\n <input\n id={rangeId}\n type=\"text\"\n inputMode=\"numeric\"\n aria-label={t('print.rangeLabel')}\n aria-invalid={choice === 'range' && chosen === null}\n placeholder={t('print.rangePlaceholder')}\n value={range}\n onFocus={() => setChoice('range')}\n onChange={(event) => setRange(event.target.value)}\n className=\"border-border bg-surface text-fg focus:border-accent focus:ring-accent min-w-0 flex-1 rounded-md border px-1.5 py-1 text-sm tabular-nums outline-none focus:ring-1 aria-[invalid=true]:border-red-600\"\n />\n </div>\n {choice === 'range' && chosen === null && range.trim() !== '' ? (\n <p className=\"text-xs text-red-600\">\n {t('print.rangeInvalid', { params: { total: pages.length } })}\n </p>\n ) : null}\n </div>\n </fieldset>\n <label className=\"mt-3 flex cursor-pointer items-center gap-2 text-sm\">\n <input\n type=\"checkbox\"\n className=\"accent-accent\"\n checked={includeAnnotations}\n onChange={(event) => setIncludeAnnotations(event.target.checked)}\n />\n <span className=\"text-fg\">{t('print.annotations')}</span>\n </label>\n {note ? <p className=\"text-fg-muted mt-3 text-xs\">{note}</p> : null}\n </>\n ) : (\n <ProgressBar\n progress={job.kind === 'preparing' ? job.progress : null}\n done={job.kind !== 'preparing'}\n />\n )}\n <p role=\"status\" className=\"text-fg-muted mt-2 min-h-5 text-sm\">\n {status}\n </p>\n <div className=\"mt-3 flex justify-end gap-2\">\n <button\n ref={cancelButton}\n type=\"button\"\n disabled={job.kind === 'printing'}\n onClick={onClose}\n className=\"border-border text-fg hover:bg-hover rounded-md border px-3 py-1.5 text-sm\"\n >\n {t('print.cancel')}\n </button>\n <button\n ref={printButton}\n type=\"submit\"\n disabled={choosing ? chosen === null : job.kind !== 'ready'}\n className=\"bg-accent text-on-accent hover:bg-accent-hover rounded-md px-3 py-1.5 text-sm disabled:opacity-60\"\n >\n {t('print.print')}\n </button>\n </div>\n </form>\n </Dialog>\n );\n}\n\n/**\n * How far preparing got: the bar moves until the first page is ready (a PDF copy arrives all at\n * once), then fills page by page. Full once the printout is made.\n */\nfunction ProgressBar({ progress, done }: { progress: PrintProgress | null; done: boolean }) {\n const fraction = done\n ? 1\n : progress && progress.pagesRendered > 0\n ? progress.pagesRendered / progress.pageCount\n : null;\n return (\n <div aria-hidden=\"true\" className=\"bg-hover mt-4 h-1.5 overflow-hidden rounded-full\">\n <div\n className={`bg-accent h-full rounded-full transition-[width] ${fraction === null ? 'w-full animate-pulse' : ''}`}\n style={fraction === null ? undefined : { width: `${fraction * 100}%` }}\n />\n </div>\n );\n}\n\nfunction Choice({\n name,\n checked,\n onChoose,\n label,\n controls,\n}: {\n /** The group's name, so the arrow keys move between its choices. */\n name: string;\n checked: boolean;\n onChoose: () => void;\n label: string;\n /** The field this choice turns on, for assistive technology. */\n controls?: string;\n}) {\n return (\n <label className=\"text-fg flex cursor-pointer items-center gap-2 text-sm\">\n <input\n type=\"radio\"\n name={name}\n className=\"accent-accent\"\n checked={checked}\n onChange={onChoose}\n aria-controls={controls}\n />\n {label}\n </label>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAMA,SAAgB,aAAa,MAAc,WAAoC;CAC7E,MAAM,QAAQ,KAEX,MAAM,QAAQ,CAAC,CACf,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,CAC1B,QAAQ,SAAS,SAAS,EAAE;CAC/B,IAAI,MAAM,WAAW,GAAG,OAAO;CAC/B,MAAM,wBAAQ,IAAI,IAAY;CAC9B,KAAK,MAAM,QAAQ,OAAO;EAExB,MAAM,QAAQ,8BAA8B,KAAK,IAAI;EACrD,IAAI,CAAC,OAAO,OAAO;EACnB,MAAM,QAAQ,OAAO,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