@embedpdf/viewer-chrome 3.0.0-next.15 → 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/dist/{annotation-fonts-BqoLZ4Mp.js → annotation-fonts-DWjVOTP0.js} +2 -2
- package/dist/{annotation-fonts-BqoLZ4Mp.js.map → annotation-fonts-DWjVOTP0.js.map} +1 -1
- package/dist/{annotation-fonts-Dt0IQXhz.cjs → annotation-fonts-dpfVkhnq.cjs} +2 -2
- package/dist/{annotation-fonts-Dt0IQXhz.cjs.map → annotation-fonts-dpfVkhnq.cjs.map} +1 -1
- package/dist/{annotation-style-Bzvvp8-N.cjs → annotation-style-B3XKAyZ-.cjs} +3 -3
- package/dist/{annotation-style-Bzvvp8-N.cjs.map → annotation-style-B3XKAyZ-.cjs.map} +1 -1
- package/dist/{annotation-style--rPIZsuP.js → annotation-style-CXF3X47Z.js} +3 -3
- package/dist/{annotation-style--rPIZsuP.js.map → annotation-style-CXF3X47Z.js.map} +1 -1
- package/dist/{ar-DnEj5vbP.cjs → ar-B132r9bo.cjs} +93 -1
- package/dist/ar-B132r9bo.cjs.map +1 -0
- package/dist/{ar-D9XKAmDx.js → ar-BLWFJoA_.js} +93 -1
- 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 +21 -0
- package/dist/chrome.cjs.map +1 -1
- package/dist/chrome.js +21 -0
- package/dist/chrome.js.map +1 -1
- package/dist/{commands-BmgxhJ8B.js → commands-BkgLP3Om.js} +418 -23
- package/dist/commands-BkgLP3Om.js.map +1 -0
- package/dist/{commands-CYt4SFUX.cjs → commands-DL1gjZt7.cjs} +433 -20
- package/dist/commands-DL1gjZt7.cjs.map +1 -0
- package/dist/commands.cjs +2 -1
- package/dist/commands.d.cts +3 -1
- package/dist/commands.d.ts +3 -1
- package/dist/commands.js +2 -2
- package/dist/{comments-panel-pEcQg4Vs.cjs → comments-panel-BsnWedTh.cjs} +2 -2
- package/dist/{comments-panel-pEcQg4Vs.cjs.map → comments-panel-BsnWedTh.cjs.map} +1 -1
- package/dist/{comments-panel-MUVgLCBI.js → comments-panel-D7Eadws9.js} +2 -2
- package/dist/{comments-panel-MUVgLCBI.js.map → comments-panel-D7Eadws9.js.map} +1 -1
- package/dist/{de-Dv6zvbnd.cjs → de-7_MvFWzN.cjs} +93 -1
- package/dist/de-7_MvFWzN.cjs.map +1 -0
- package/dist/{de-Bdr4aWzm.js → de-BUhwc9-x.js} +93 -1
- package/dist/de-BUhwc9-x.js.map +1 -0
- package/dist/{dialog-B5GBisKv.js → dialog-BIb373cg.js} +3 -3
- package/dist/dialog-BIb373cg.js.map +1 -0
- package/dist/{dialog-t8F13BL_.cjs → dialog-CngKTnAM.cjs} +3 -3
- package/dist/dialog-CngKTnAM.cjs.map +1 -0
- package/dist/{es-BP09DR9w.cjs → es-DgYj-1L3.cjs} +93 -1
- package/dist/es-DgYj-1L3.cjs.map +1 -0
- package/dist/{es-BSXz5tBv.js → es-DoXTqFoO.js} +93 -1
- package/dist/es-DoXTqFoO.js.map +1 -0
- package/dist/{form-design-panel-vWWU9uB-.js → form-design-panel-CgV_5YWC.js} +3 -3
- package/dist/{form-design-panel-vWWU9uB-.js.map → form-design-panel-CgV_5YWC.js.map} +1 -1
- package/dist/{form-design-panel-B5MXTZ96.cjs → form-design-panel-D0FdmWXW.cjs} +3 -3
- package/dist/{form-design-panel-B5MXTZ96.cjs.map → form-design-panel-D0FdmWXW.cjs.map} +1 -1
- package/dist/{fr-Ckn3K9v1.js → fr-B-8NDhBA.js} +93 -1
- package/dist/fr-B-8NDhBA.js.map +1 -0
- package/dist/{fr-BBQQn7tJ.cjs → fr-C856dmQJ.cjs} +93 -1
- package/dist/fr-C856dmQJ.cjs.map +1 -0
- package/dist/{he-DRsG7bH7.cjs → he-BFTeNc4t.cjs} +93 -1
- package/dist/he-BFTeNc4t.cjs.map +1 -0
- package/dist/{he-wdGU5PkU.js → he-Dlh0fNXM.js} +93 -1
- package/dist/he-Dlh0fNXM.js.map +1 -0
- package/dist/{icons-x0Tc05bs.cjs → icons-1UfLUZ_y.cjs} +20 -1
- package/dist/icons-1UfLUZ_y.cjs.map +1 -0
- package/dist/{icons-BrK5iVL8.js → icons-7dB0Y1ct.js} +20 -1
- package/dist/icons-7dB0Y1ct.js.map +1 -0
- package/dist/index.cjs +740 -171
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +727 -170
- package/dist/index.js.map +1 -1
- package/dist/{it-BuP4o0xQ.cjs → it-Bef-2Yxq.cjs} +93 -1
- package/dist/it-Bef-2Yxq.cjs.map +1 -0
- package/dist/{it-Us-VmvIu.js → it-BkirG7ol.js} +93 -1
- package/dist/it-BkirG7ol.js.map +1 -0
- package/dist/{ja-Cizj0-5O.js → ja-CGEjCE-s.js} +93 -1
- package/dist/ja-CGEjCE-s.js.map +1 -0
- package/dist/{ja-DovEd6ts.cjs → ja-DNw2zqSD.cjs} +93 -1
- package/dist/ja-DNw2zqSD.cjs.map +1 -0
- package/dist/{ko-DlrXliE1.js → ko-CTkl5vMh.js} +93 -1
- package/dist/ko-CTkl5vMh.js.map +1 -0
- package/dist/{ko-B-qJEol2.cjs → ko-YHzeBqP6.cjs} +93 -1
- package/dist/ko-YHzeBqP6.cjs.map +1 -0
- package/dist/{link-editor-CSjqPnj1.cjs → link-editor-CAS7MZM2.cjs} +2 -2
- package/dist/{link-editor-CSjqPnj1.cjs.map → link-editor-CAS7MZM2.cjs.map} +1 -1
- package/dist/{link-editor-SxM1nnJU.js → link-editor-CkwtqRvb.js} +2 -2
- package/dist/{link-editor-SxM1nnJU.js.map → link-editor-CkwtqRvb.js.map} +1 -1
- package/dist/{measurement-Bs61XWbJ.js → measurement-CQdbnIrn.js} +2 -2
- package/dist/{measurement-Bs61XWbJ.js.map → measurement-CQdbnIrn.js.map} +1 -1
- package/dist/{measurement-CcCsHPOX.cjs → measurement-Cxv1Ahxx.cjs} +2 -2
- package/dist/{measurement-CcCsHPOX.cjs.map → measurement-Cxv1Ahxx.cjs.map} +1 -1
- package/dist/{nl-D3KZDDiJ.cjs → nl-BjkbaLq3.cjs} +93 -1
- package/dist/nl-BjkbaLq3.cjs.map +1 -0
- package/dist/{nl-0aF7M_0h.js → nl-Dya4sR8_.js} +93 -1
- 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-DSFhAUqx.cjs → pl-CKKdVnpZ.cjs} +93 -1
- package/dist/pl-CKKdVnpZ.cjs.map +1 -0
- package/dist/{pl-BW--AaCI.js → pl-DA9b5NVg.js} +93 -1
- 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-C5S-8MC5.cjs → pt-DLcszlzi.cjs} +93 -1
- package/dist/pt-DLcszlzi.cjs.map +1 -0
- package/dist/{pt-DIhpU5pT.js → pt-Nm8yyjbX.js} +93 -1
- package/dist/pt-Nm8yyjbX.js.map +1 -0
- package/dist/{redact-confirm-CX_SY2ZN.cjs → redact-confirm-C6EiK8yN.cjs} +2 -2
- package/dist/{redact-confirm-CX_SY2ZN.cjs.map → redact-confirm-C6EiK8yN.cjs.map} +1 -1
- package/dist/{redact-confirm-B6j36TPw.js → redact-confirm-CKuv9iN_.js} +2 -2
- package/dist/{redact-confirm-B6j36TPw.js.map → redact-confirm-CKuv9iN_.js.map} +1 -1
- package/dist/{redaction-panel-IJDshSJI.js → redaction-panel-CgNZ-pQk.js} +2 -2
- package/dist/{redaction-panel-IJDshSJI.js.map → redaction-panel-CgNZ-pQk.js.map} +1 -1
- package/dist/{redaction-panel-BmoIl-Ll.cjs → redaction-panel-ZhX0dlMi.cjs} +2 -2
- package/dist/{redaction-panel-BmoIl-Ll.cjs.map → redaction-panel-ZhX0dlMi.cjs.map} +1 -1
- package/dist/{search-panel-HfIhJm1M.js → search-panel-BE4xzWlm.js} +4 -4
- package/dist/{search-panel-HfIhJm1M.js.map → search-panel-BE4xzWlm.js.map} +1 -1
- package/dist/{search-panel-s9IoiOtv.cjs → search-panel-wcbTNG1z.cjs} +4 -4
- package/dist/{search-panel-s9IoiOtv.cjs.map → search-panel-wcbTNG1z.cjs.map} +1 -1
- package/dist/{sheet-BDsa_Sup.cjs → sheet-DTBFiwde.cjs} +30 -11
- package/dist/sheet-DTBFiwde.cjs.map +1 -0
- package/dist/{sheet-R6XDgyEf.js → sheet-DyjKfAq0.js} +25 -12
- package/dist/sheet-DyjKfAq0.js.map +1 -0
- package/dist/{sign-dialog-CgnR7akj.cjs → sign-dialog-D5WGx-Yn.cjs} +2 -2
- package/dist/{sign-dialog-CgnR7akj.cjs.map → sign-dialog-D5WGx-Yn.cjs.map} +1 -1
- package/dist/{sign-dialog-GDqCoQhA.js → sign-dialog-DerNe8qT.js} +2 -2
- package/dist/{sign-dialog-GDqCoQhA.js.map → sign-dialog-DerNe8qT.js.map} +1 -1
- package/dist/{signature-inspector-DyO313Qf.cjs → signature-inspector-Bz6TAfZM.cjs} +4 -10
- package/dist/signature-inspector-Bz6TAfZM.cjs.map +1 -0
- package/dist/{signature-inspector-okFz8do6.js → signature-inspector-CsGr9EBk.js} +4 -10
- package/dist/signature-inspector-CsGr9EBk.js.map +1 -0
- package/dist/{signature-maker-BoYa8vgA.cjs → signature-maker-D_YfBXLn.cjs} +3 -3
- package/dist/{signature-maker-BoYa8vgA.cjs.map → signature-maker-D_YfBXLn.cjs.map} +1 -1
- package/dist/{signature-maker-BhCmYyHD.js → signature-maker-Dnth4rV4.js} +3 -3
- package/dist/{signature-maker-BhCmYyHD.js.map → signature-maker-Dnth4rV4.js.map} +1 -1
- package/dist/{signatures-panel-B56PC6d9.cjs → signatures-panel-Ci_LaI1C.cjs} +4 -10
- package/dist/signatures-panel-Ci_LaI1C.cjs.map +1 -0
- package/dist/{signatures-panel-CgnFfhFm.js → signatures-panel-DZ9ywrjz.js} +4 -10
- package/dist/signatures-panel-DZ9ywrjz.js.map +1 -0
- package/dist/{stamps-panel-CDO0FPyK.js → stamps-panel-BrczStaz.js} +4 -10
- package/dist/stamps-panel-BrczStaz.js.map +1 -0
- package/dist/{stamps-panel-B9NYGayn.cjs → stamps-panel-Cv9nJBwx.cjs} +4 -10
- 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-z9od3tKl.js → toolbar-DF361xWY.js} +7 -6
- package/dist/toolbar-DF361xWY.js.map +1 -0
- package/dist/{toolbar-CJu2wKTU.cjs → toolbar-ddvpsvTb.cjs} +7 -6
- package/dist/toolbar-ddvpsvTb.cjs.map +1 -0
- package/dist/{zh-cn-CxkUUBct.js → zh-cn-BMPPkLpL.js} +93 -1
- package/dist/zh-cn-BMPPkLpL.js.map +1 -0
- package/dist/{zh-cn-3tmMeHqv.cjs → zh-cn-CZOO3p4H.cjs} +93 -1
- package/dist/zh-cn-CZOO3p4H.cjs.map +1 -0
- package/package.json +4 -4
- package/src/styles.css +8 -0
- package/dist/ar-D9XKAmDx.js.map +0 -1
- package/dist/ar-DnEj5vbP.cjs.map +0 -1
- package/dist/commands-BmgxhJ8B.js.map +0 -1
- package/dist/commands-CYt4SFUX.cjs.map +0 -1
- package/dist/de-Bdr4aWzm.js.map +0 -1
- package/dist/de-Dv6zvbnd.cjs.map +0 -1
- package/dist/dialog-B5GBisKv.js.map +0 -1
- package/dist/dialog-t8F13BL_.cjs.map +0 -1
- package/dist/es-BP09DR9w.cjs.map +0 -1
- package/dist/es-BSXz5tBv.js.map +0 -1
- package/dist/fr-BBQQn7tJ.cjs.map +0 -1
- package/dist/fr-Ckn3K9v1.js.map +0 -1
- package/dist/he-DRsG7bH7.cjs.map +0 -1
- package/dist/he-wdGU5PkU.js.map +0 -1
- package/dist/icons-BrK5iVL8.js.map +0 -1
- package/dist/icons-x0Tc05bs.cjs.map +0 -1
- package/dist/it-BuP4o0xQ.cjs.map +0 -1
- package/dist/it-Us-VmvIu.js.map +0 -1
- package/dist/ja-Cizj0-5O.js.map +0 -1
- package/dist/ja-DovEd6ts.cjs.map +0 -1
- package/dist/ko-B-qJEol2.cjs.map +0 -1
- package/dist/ko-DlrXliE1.js.map +0 -1
- package/dist/nl-0aF7M_0h.js.map +0 -1
- package/dist/nl-D3KZDDiJ.cjs.map +0 -1
- package/dist/pl-BW--AaCI.js.map +0 -1
- package/dist/pl-DSFhAUqx.cjs.map +0 -1
- package/dist/pt-C5S-8MC5.cjs.map +0 -1
- package/dist/pt-DIhpU5pT.js.map +0 -1
- package/dist/sheet-BDsa_Sup.cjs.map +0 -1
- package/dist/sheet-R6XDgyEf.js.map +0 -1
- package/dist/signature-inspector-DyO313Qf.cjs.map +0 -1
- package/dist/signature-inspector-okFz8do6.js.map +0 -1
- package/dist/signatures-panel-B56PC6d9.cjs.map +0 -1
- package/dist/signatures-panel-CgnFfhFm.js.map +0 -1
- package/dist/stamps-panel-B9NYGayn.cjs.map +0 -1
- package/dist/stamps-panel-CDO0FPyK.js.map +0 -1
- package/dist/toolbar-CJu2wKTU.cjs.map +0 -1
- package/dist/toolbar-z9od3tKl.js.map +0 -1
- package/dist/zh-cn-3tmMeHqv.cjs.map +0 -1
- package/dist/zh-cn-CxkUUBct.js.map +0 -1
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { d as useLayoutEnv, n as Icon } from "./icons-7dB0Y1ct.js";
|
|
2
|
+
import { n as CommandButton } from "./toolbar-DF361xWY.js";
|
|
3
|
+
import { i as useCloseOnPick } from "./sheet-DyjKfAq0.js";
|
|
4
|
+
import { useMemo, useRef, useState } from "react";
|
|
5
|
+
import { usePageList } from "@embedpdf/react/runtime";
|
|
6
|
+
import { displayNameOf, useAttachment, useAttachmentState } from "@embedpdf/react/attachment";
|
|
7
|
+
import { useI18nSettings, useT } from "@embedpdf/react/i18n";
|
|
8
|
+
import { useCommand, useCommands } from "@embedpdf/react/commands";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
//#region src/ui/attachments-panel.tsx
|
|
11
|
+
/**
|
|
12
|
+
* The attachments panel: the files the document carries, its attachments first, then the files
|
|
13
|
+
* pinned to its pages. A row shows the file's kind, its name (without the characters that can
|
|
14
|
+
* disguise one), its size and description, and a page's file says its page. Clicking an
|
|
15
|
+
* attachment saves it; clicking a page's file goes to it. A row's menu saves, goes to the page
|
|
16
|
+
* and deletes. A session that may add files adds one with the header's button, or drops files
|
|
17
|
+
* on the panel; a drop there never opens them as documents.
|
|
18
|
+
*/
|
|
19
|
+
/** A file's size in the viewer's language: bytes, then kB and MB with one decimal. */
|
|
20
|
+
function sizeText(bytes, locale) {
|
|
21
|
+
const [value, unit] = bytes < 1e3 ? [bytes, "byte"] : bytes < 1e6 ? [bytes / 1e3, "kilobyte"] : [bytes / 1e6, "megabyte"];
|
|
22
|
+
return new Intl.NumberFormat(locale, {
|
|
23
|
+
style: "unit",
|
|
24
|
+
unit,
|
|
25
|
+
unitDisplay: "short",
|
|
26
|
+
maximumFractionDigits: unit === "byte" ? 0 : 1
|
|
27
|
+
}).format(value);
|
|
28
|
+
}
|
|
29
|
+
/** The icon for a file's kind, by its type. */
|
|
30
|
+
function iconOf(file) {
|
|
31
|
+
const type = file.mimeType ?? "";
|
|
32
|
+
if (type === "application/pdf") return "file";
|
|
33
|
+
if (type.startsWith("image/")) return "photo";
|
|
34
|
+
return "paperclip";
|
|
35
|
+
}
|
|
36
|
+
/** Whether a drag carries files: what the panel takes. */
|
|
37
|
+
const carriesFiles = (event) => event.dataTransfer.types.includes("Files");
|
|
38
|
+
function AttachmentsPanel() {
|
|
39
|
+
const t = useT();
|
|
40
|
+
const locale = useI18nSettings((settings) => settings.locale) ?? void 0;
|
|
41
|
+
const attachment = useAttachment();
|
|
42
|
+
const { files, selected, status } = useAttachmentState();
|
|
43
|
+
const commands = useCommands();
|
|
44
|
+
const add = useCommand("attachment:add");
|
|
45
|
+
const closeOnPick = useCloseOnPick();
|
|
46
|
+
const pages = usePageList();
|
|
47
|
+
const canAdd = add.visible && add.enabled;
|
|
48
|
+
const entered = useRef(0);
|
|
49
|
+
const [dropping, setDropping] = useState(false);
|
|
50
|
+
const pageLabelOf = useMemo(() => {
|
|
51
|
+
const byKey = new Map(pages.map((page) => [page.ref.objectNumber, page]));
|
|
52
|
+
return (file) => {
|
|
53
|
+
if (file.home.kind !== "page") return null;
|
|
54
|
+
const page = byKey.get(file.home.ref.page.objectNumber);
|
|
55
|
+
return page ? page.label ?? String(page.index + 1) : null;
|
|
56
|
+
};
|
|
57
|
+
}, [pages]);
|
|
58
|
+
const selectedIds = new Set(selected.map((file) => file.id));
|
|
59
|
+
/** A click on a row: an attachment saves, a page's file goes to its page. */
|
|
60
|
+
const pick = (file) => {
|
|
61
|
+
attachment.select([file]);
|
|
62
|
+
if (file.home.kind === "page") {
|
|
63
|
+
attachment.reveal(file);
|
|
64
|
+
closeOnPick();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
commands.execute("attachment:save").catch(() => {});
|
|
68
|
+
};
|
|
69
|
+
const dropProps = canAdd ? {
|
|
70
|
+
onDragEnter: (event) => {
|
|
71
|
+
if (!carriesFiles(event)) return;
|
|
72
|
+
event.preventDefault();
|
|
73
|
+
event.stopPropagation();
|
|
74
|
+
entered.current += 1;
|
|
75
|
+
setDropping(true);
|
|
76
|
+
},
|
|
77
|
+
onDragOver: (event) => {
|
|
78
|
+
if (!carriesFiles(event)) return;
|
|
79
|
+
event.preventDefault();
|
|
80
|
+
event.stopPropagation();
|
|
81
|
+
event.dataTransfer.dropEffect = "copy";
|
|
82
|
+
},
|
|
83
|
+
onDragLeave: () => {
|
|
84
|
+
if (entered.current === 0) return;
|
|
85
|
+
entered.current -= 1;
|
|
86
|
+
if (entered.current === 0) setDropping(false);
|
|
87
|
+
},
|
|
88
|
+
onDrop: (event) => {
|
|
89
|
+
entered.current = 0;
|
|
90
|
+
setDropping(false);
|
|
91
|
+
if (!carriesFiles(event)) return;
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
event.stopPropagation();
|
|
94
|
+
const dropped = Array.from(event.dataTransfer.files);
|
|
95
|
+
if (dropped.length === 0) return;
|
|
96
|
+
const args = { files: dropped };
|
|
97
|
+
commands.execute("attachment:add", { args }).catch(() => {});
|
|
98
|
+
}
|
|
99
|
+
} : {};
|
|
100
|
+
const message = (text, withAdd = false) => /* @__PURE__ */ jsxs("div", {
|
|
101
|
+
className: "text-fg-muted flex flex-col items-center gap-3 p-6 text-center text-sm",
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ jsx("p", { children: text }),
|
|
104
|
+
withAdd && canAdd && /* @__PURE__ */ jsx("button", {
|
|
105
|
+
type: "button",
|
|
106
|
+
onClick: () => void add.run(),
|
|
107
|
+
className: "border-border text-fg hover:bg-hover rounded-md border px-3 py-1.5 text-sm",
|
|
108
|
+
children: add.label
|
|
109
|
+
}),
|
|
110
|
+
withAdd && canAdd && /* @__PURE__ */ jsx("p", {
|
|
111
|
+
className: "text-xs",
|
|
112
|
+
children: t("attachments.dropHint")
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
});
|
|
116
|
+
const body = (() => {
|
|
117
|
+
if (files.length === 0) {
|
|
118
|
+
if (status === "idle" || status === "loading") return message(t("attachments.loading"));
|
|
119
|
+
if (status === "forbidden" || status === "error") return message(t("attachments.failed"));
|
|
120
|
+
return message(t("attachments.empty"), true);
|
|
121
|
+
}
|
|
122
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
123
|
+
"aria-label": t("panels.attachments"),
|
|
124
|
+
className: "min-h-0 flex-1 overflow-y-auto p-1",
|
|
125
|
+
children: files.map((file) => /* @__PURE__ */ jsx(FileRow, {
|
|
126
|
+
file,
|
|
127
|
+
page: pageLabelOf(file),
|
|
128
|
+
selected: selectedIds.has(file.id),
|
|
129
|
+
pending: attachment.isPending(file),
|
|
130
|
+
locale,
|
|
131
|
+
onPick: () => pick(file),
|
|
132
|
+
onMenu: () => attachment.select([file])
|
|
133
|
+
}, file.id))
|
|
134
|
+
});
|
|
135
|
+
})();
|
|
136
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
137
|
+
className: "relative flex min-h-0 flex-1 flex-col",
|
|
138
|
+
...dropProps,
|
|
139
|
+
children: [
|
|
140
|
+
add.visible && /* @__PURE__ */ jsxs("div", {
|
|
141
|
+
className: "border-border-subtle flex items-center gap-1 border-b p-2",
|
|
142
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
143
|
+
className: "text-fg-muted min-w-0 flex-1 truncate text-xs",
|
|
144
|
+
children: t(files.length === 1 ? "attachments.count" : "attachments.countPlural", { params: { count: String(files.length) } })
|
|
145
|
+
}), /* @__PURE__ */ jsx(CommandButton, {
|
|
146
|
+
cmd: add,
|
|
147
|
+
variant: "icon",
|
|
148
|
+
run: () => void add.run()
|
|
149
|
+
})]
|
|
150
|
+
}),
|
|
151
|
+
body,
|
|
152
|
+
dropping && /* @__PURE__ */ jsx("div", {
|
|
153
|
+
className: "border-accent bg-accent/10 text-fg pointer-events-none absolute inset-1 flex items-center justify-center rounded-md border-2 border-dashed text-sm",
|
|
154
|
+
children: t("attachments.drop")
|
|
155
|
+
})
|
|
156
|
+
]
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
function FileRow({ file, page, selected, pending, locale, onPick, onMenu }) {
|
|
160
|
+
const t = useT();
|
|
161
|
+
const { touch } = useLayoutEnv();
|
|
162
|
+
const menuButton = useRef(null);
|
|
163
|
+
const name = displayNameOf(file);
|
|
164
|
+
const details = [
|
|
165
|
+
pending ? t("attachments.adding") : file.size === null ? null : sizeText(file.size, locale),
|
|
166
|
+
page === null ? null : t("attachments.onPage", { params: { page } }),
|
|
167
|
+
file.description
|
|
168
|
+
].filter((part) => !!part);
|
|
169
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
170
|
+
onContextMenu: (event) => {
|
|
171
|
+
event.preventDefault();
|
|
172
|
+
onMenu();
|
|
173
|
+
menuButton.current?.querySelector("button")?.click();
|
|
174
|
+
},
|
|
175
|
+
className: `group flex items-center gap-1 rounded pe-1 ${selected ? "bg-accent/10" : "hover:bg-hover"} ${pending ? "opacity-60" : ""}`,
|
|
176
|
+
children: [/* @__PURE__ */ jsxs("button", {
|
|
177
|
+
type: "button",
|
|
178
|
+
onClick: onPick,
|
|
179
|
+
title: name,
|
|
180
|
+
className: "flex min-w-0 flex-1 items-center gap-2 rounded px-2 py-1.5 text-start",
|
|
181
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
182
|
+
name: iconOf(file),
|
|
183
|
+
size: 16,
|
|
184
|
+
className: "text-fg-muted shrink-0"
|
|
185
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
186
|
+
className: "min-w-0 flex-1",
|
|
187
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
188
|
+
className: "text-fg block truncate text-sm",
|
|
189
|
+
children: /* @__PURE__ */ jsx("bdi", { children: name })
|
|
190
|
+
}), details.length > 0 && /* @__PURE__ */ jsx("span", {
|
|
191
|
+
className: "text-fg-muted block truncate text-xs",
|
|
192
|
+
children: details.join(" · ")
|
|
193
|
+
})]
|
|
194
|
+
})]
|
|
195
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
196
|
+
ref: menuButton,
|
|
197
|
+
onClick: (event) => event.stopPropagation(),
|
|
198
|
+
onPointerDownCapture: onMenu,
|
|
199
|
+
className: `shrink-0 ${selected || touch ? "" : "opacity-0 focus-within:opacity-100 group-hover:opacity-100"}`,
|
|
200
|
+
children: /* @__PURE__ */ jsx(RowMenuButton, {})
|
|
201
|
+
})]
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
/** A row's menu button: the attachment commands for the selected file. */
|
|
205
|
+
function RowMenuButton() {
|
|
206
|
+
const more = useCommand("menu:attachment-item");
|
|
207
|
+
if (!more.visible) return null;
|
|
208
|
+
return /* @__PURE__ */ jsx(CommandButton, {
|
|
209
|
+
cmd: more,
|
|
210
|
+
variant: "icon",
|
|
211
|
+
run: () => void more.run()
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
//#endregion
|
|
215
|
+
export { AttachmentsPanel };
|
|
216
|
+
|
|
217
|
+
//# sourceMappingURL=attachments-panel-H1ucRbwo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachments-panel-H1ucRbwo.js","names":[],"sources":["../src/ui/attachments-panel.tsx"],"sourcesContent":["/**\n * The attachments panel: the files the document carries, its attachments first, then the files\n * pinned to its pages. A row shows the file's kind, its name (without the characters that can\n * disguise one), its size and description, and a page's file says its page. Clicking an\n * attachment saves it; clicking a page's file goes to it. A row's menu saves, goes to the page\n * and deletes. A session that may add files adds one with the header's button, or drops files\n * on the panel; a drop there never opens them as documents.\n */\nimport {\n displayNameOf,\n useAttachment,\n useAttachmentState,\n type AttachedFile,\n} from '@embedpdf/react/attachment';\nimport { useCommand, useCommands } from '@embedpdf/react/commands';\nimport { useI18nSettings, useT } from '@embedpdf/react/i18n';\nimport { usePageList } from '@embedpdf/react/runtime';\nimport { useMemo, useRef, useState, type DragEvent } from 'react';\n\nimport { useLayoutEnv } from '../config-context';\nimport { Icon, type IconName } from './icons';\nimport { useCloseOnPick } from './panel-frame';\nimport { CommandButton } from './toolbar';\nimport type { AttachmentAddArgs } from '../config/attachments';\n\n/** A file's size in the viewer's language: bytes, then kB and MB with one decimal. */\nfunction sizeText(bytes: number, locale: string | undefined): string {\n const [value, unit] =\n bytes < 1000\n ? [bytes, 'byte']\n : bytes < 1_000_000\n ? [bytes / 1000, 'kilobyte']\n : [bytes / 1_000_000, 'megabyte'];\n return new Intl.NumberFormat(locale, {\n style: 'unit',\n unit,\n unitDisplay: 'short',\n maximumFractionDigits: unit === 'byte' ? 0 : 1,\n }).format(value);\n}\n\n/** The icon for a file's kind, by its type. */\nfunction iconOf(file: AttachedFile): IconName {\n const type = file.mimeType ?? '';\n if (type === 'application/pdf') return 'file';\n if (type.startsWith('image/')) return 'photo';\n return 'paperclip';\n}\n\n/** Whether a drag carries files: what the panel takes. */\nconst carriesFiles = (event: DragEvent) => event.dataTransfer.types.includes('Files');\n\nexport function AttachmentsPanel() {\n const t = useT();\n const locale = useI18nSettings((settings) => settings.locale) ?? undefined;\n const attachment = useAttachment();\n const { files, selected, status } = useAttachmentState();\n const commands = useCommands();\n const add = useCommand('attachment:add');\n const closeOnPick = useCloseOnPick();\n const pages = usePageList();\n const canAdd = add.visible && add.enabled;\n // A drag enters and leaves every element it crosses: count them, so the target stays until\n // the drag leaves the panel.\n const entered = useRef(0);\n const [dropping, setDropping] = useState(false);\n\n const pageLabelOf = useMemo(() => {\n const byKey = new Map(pages.map((page) => [page.ref.objectNumber, page]));\n return (file: AttachedFile): string | null => {\n if (file.home.kind !== 'page') return null;\n const page = byKey.get(file.home.ref.page.objectNumber);\n return page ? (page.label ?? String(page.index + 1)) : null;\n };\n }, [pages]);\n const selectedIds = new Set(selected.map((file) => file.id));\n\n /** A click on a row: an attachment saves, a page's file goes to its page. */\n const pick = (file: AttachedFile) => {\n attachment.select([file]);\n if (file.home.kind === 'page') {\n attachment.reveal(file);\n closeOnPick();\n return;\n }\n // A failing command reports itself through the commands' onExecutionFailed.\n void commands.execute('attachment:save').catch(() => {});\n };\n\n const dropProps = canAdd\n ? {\n onDragEnter: (event: DragEvent) => {\n if (!carriesFiles(event)) return;\n event.preventDefault();\n event.stopPropagation();\n entered.current += 1;\n setDropping(true);\n },\n onDragOver: (event: DragEvent) => {\n if (!carriesFiles(event)) return;\n event.preventDefault();\n event.stopPropagation();\n event.dataTransfer.dropEffect = 'copy';\n },\n onDragLeave: () => {\n if (entered.current === 0) return;\n entered.current -= 1;\n if (entered.current === 0) setDropping(false);\n },\n onDrop: (event: DragEvent) => {\n entered.current = 0;\n setDropping(false);\n if (!carriesFiles(event)) return;\n // The panel's drop: the files are attached, never opened as documents.\n event.preventDefault();\n event.stopPropagation();\n const dropped = Array.from(event.dataTransfer.files);\n if (dropped.length === 0) return;\n const args: AttachmentAddArgs = { files: dropped };\n void commands.execute('attachment:add', { args }).catch(() => {});\n },\n }\n : {};\n\n const message = (text: string, withAdd = false) => (\n <div className=\"text-fg-muted flex flex-col items-center gap-3 p-6 text-center text-sm\">\n <p>{text}</p>\n {withAdd && canAdd && (\n <button\n type=\"button\"\n onClick={() => void add.run()}\n className=\"border-border text-fg hover:bg-hover rounded-md border px-3 py-1.5 text-sm\"\n >\n {add.label}\n </button>\n )}\n {withAdd && canAdd && <p className=\"text-xs\">{t('attachments.dropHint')}</p>}\n </div>\n );\n\n const body = (() => {\n if (files.length === 0) {\n if (status === 'idle' || status === 'loading') return message(t('attachments.loading'));\n if (status === 'forbidden' || status === 'error') return message(t('attachments.failed'));\n return message(t('attachments.empty'), true);\n }\n return (\n <ul aria-label={t('panels.attachments')} className=\"min-h-0 flex-1 overflow-y-auto p-1\">\n {files.map((file) => (\n <FileRow\n key={file.id}\n file={file}\n page={pageLabelOf(file)}\n selected={selectedIds.has(file.id)}\n pending={attachment.isPending(file)}\n locale={locale}\n onPick={() => pick(file)}\n onMenu={() => attachment.select([file])}\n />\n ))}\n </ul>\n );\n })();\n\n return (\n <div className=\"relative flex min-h-0 flex-1 flex-col\" {...dropProps}>\n {add.visible && (\n <div className=\"border-border-subtle flex items-center gap-1 border-b p-2\">\n <span className=\"text-fg-muted min-w-0 flex-1 truncate text-xs\">\n {t(files.length === 1 ? 'attachments.count' : 'attachments.countPlural', {\n params: { count: String(files.length) },\n })}\n </span>\n <CommandButton cmd={add} variant=\"icon\" run={() => void add.run()} />\n </div>\n )}\n {body}\n {dropping && (\n <div className=\"border-accent bg-accent/10 text-fg pointer-events-none absolute inset-1 flex items-center justify-center rounded-md border-2 border-dashed text-sm\">\n {t('attachments.drop')}\n </div>\n )}\n </div>\n );\n}\n\ninterface FileRowProps {\n readonly file: AttachedFile;\n /** The page a page's file is on, as the document labels it; null for an attachment. */\n readonly page: string | null;\n readonly selected: boolean;\n /** Its add waits for the engine. */\n readonly pending: boolean;\n /** The viewer's language, for sizes; the browser's when it has none. */\n readonly locale: string | undefined;\n readonly onPick: () => void;\n /** Its menu is about to open: the row's file becomes the selection the menu acts on. */\n readonly onMenu: () => void;\n}\n\nfunction FileRow({ file, page, selected, pending, locale, onPick, onMenu }: FileRowProps) {\n const t = useT();\n // A finger has no hover: the menu button shows on every row.\n const { touch } = useLayoutEnv();\n const menuButton = useRef<HTMLSpanElement>(null);\n const name = displayNameOf(file);\n const details = [\n pending ? t('attachments.adding') : file.size === null ? null : sizeText(file.size, locale),\n page === null ? null : t('attachments.onPage', { params: { page } }),\n file.description,\n ].filter((part): part is string => !!part);\n\n return (\n <li\n onContextMenu={(event) => {\n event.preventDefault();\n onMenu();\n menuButton.current?.querySelector('button')?.click();\n }}\n className={`group flex items-center gap-1 rounded pe-1 ${\n selected ? 'bg-accent/10' : 'hover:bg-hover'\n } ${pending ? 'opacity-60' : ''}`}\n >\n <button\n type=\"button\"\n onClick={onPick}\n title={name}\n className=\"flex min-w-0 flex-1 items-center gap-2 rounded px-2 py-1.5 text-start\"\n >\n <Icon name={iconOf(file)} size={16} className=\"text-fg-muted shrink-0\" />\n <span className=\"min-w-0 flex-1\">\n <span className=\"text-fg block truncate text-sm\">\n <bdi>{name}</bdi>\n </span>\n {details.length > 0 && (\n <span className=\"text-fg-muted block truncate text-xs\">{details.join(' · ')}</span>\n )}\n </span>\n </button>\n <span\n ref={menuButton}\n onClick={(event) => event.stopPropagation()}\n onPointerDownCapture={onMenu}\n className={`shrink-0 ${\n selected || touch ? '' : 'opacity-0 focus-within:opacity-100 group-hover:opacity-100'\n }`}\n >\n <RowMenuButton />\n </span>\n </li>\n );\n}\n\n/** A row's menu button: the attachment commands for the selected file. */\nfunction RowMenuButton() {\n const more = useCommand('menu:attachment-item');\n if (!more.visible) return null;\n return <CommandButton cmd={more} variant=\"icon\" run={() => void more.run()} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0BA,SAAS,SAAS,OAAe,QAAoC;CACnE,MAAM,CAAC,OAAO,QACZ,QAAQ,MACJ,CAAC,OAAO,MAAM,IACd,QAAQ,MACN,CAAC,QAAQ,KAAM,UAAU,IACzB,CAAC,QAAQ,KAAW,UAAU;CACtC,OAAO,IAAI,KAAK,aAAa,QAAQ;EACnC,OAAO;EACP;EACA,aAAa;EACb,uBAAuB,SAAS,SAAS,IAAI;CAC/C,CAAC,CAAC,CAAC,OAAO,KAAK;AACjB;;AAGA,SAAS,OAAO,MAA8B;CAC5C,MAAM,OAAO,KAAK,YAAY;CAC9B,IAAI,SAAS,mBAAmB,OAAO;CACvC,IAAI,KAAK,WAAW,QAAQ,GAAG,OAAO;CACtC,OAAO;AACT;;AAGA,MAAM,gBAAgB,UAAqB,MAAM,aAAa,MAAM,SAAS,OAAO;AAEpF,SAAgB,mBAAmB;CACjC,MAAM,IAAI,KAAK;CACf,MAAM,SAAS,iBAAiB,aAAa,SAAS,MAAM,KAAK,KAAA;CACjE,MAAM,aAAa,cAAc;CACjC,MAAM,EAAE,OAAO,UAAU,WAAW,mBAA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A0B,CAAA,GACxE,qBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACE,oBAAC,QAAD;KAAM,WAAU;KACd,UAAA,oBAAC,OAAD,EAAA,UAAM,KAAU,CAAA;IACZ,CAAA,GACL,QAAQ,SAAS,KAChB,oBAAC,QAAD;KAAM,WAAU;KAAwC,UAAA,QAAQ,KAAK,KAAK;IAAQ,CAAA,CAEhF;GACA,CAAA,CAAA;EACR,CAAA,GAAA,oBAAC,QAAD;GACE,KAAK;GACL,UAAU,UAAU,MAAM,gBAAgB;GAC1C,sBAAsB;GACtB,WAAW,YACT,YAAY,QAAQ,KAAK;GAG3B,UAAA,oBAAC,eAAD,CAAgB,CAAA;EACZ,CAAA,CACJ;;AAER;;AAGA,SAAS,gBAAgB;CACvB,MAAM,OAAO,WAAW,sBAAsB;CAC9C,IAAI,CAAC,KAAK,SAAS,OAAO;CAC1B,OAAO,oBAAC,eAAD;EAAe,KAAK;EAAM,SAAQ;EAAO,WAAW,KAAK,KAAK,IAAI;CAAI,CAAA;AAC/E"}
|
package/dist/chrome.cjs
CHANGED
|
@@ -275,6 +275,7 @@ const DEFAULT_LAYOUT = {
|
|
|
275
275
|
"annotation:stamp-from-selection",
|
|
276
276
|
"annotation:link",
|
|
277
277
|
"annotation:goto-link",
|
|
278
|
+
"annotation:save-file",
|
|
278
279
|
"annotation:remove-link",
|
|
279
280
|
"annotation:group",
|
|
280
281
|
"annotation:ungroup"
|
|
@@ -329,6 +330,26 @@ const DEFAULT_LAYOUT = {
|
|
|
329
330
|
"zoom:fit-width",
|
|
330
331
|
"zoom:automatic"
|
|
331
332
|
]
|
|
333
|
+
],
|
|
334
|
+
"outline-item": [
|
|
335
|
+
["outline:add", "outline:add-child"],
|
|
336
|
+
[
|
|
337
|
+
"outline:rename",
|
|
338
|
+
"outline:set-destination",
|
|
339
|
+
"outline:properties"
|
|
340
|
+
],
|
|
341
|
+
["outline:delete"]
|
|
342
|
+
],
|
|
343
|
+
"attachment-item": [["attachment:save", "attachment:go-to"], ["attachment:delete"]],
|
|
344
|
+
page: [
|
|
345
|
+
["page:rotate-clockwise", "page:rotate-counterclockwise"],
|
|
346
|
+
[
|
|
347
|
+
"page:insert-blank",
|
|
348
|
+
"page:insert-file",
|
|
349
|
+
"page:duplicate"
|
|
350
|
+
],
|
|
351
|
+
["page:extract"],
|
|
352
|
+
["page:delete"]
|
|
332
353
|
]
|
|
333
354
|
},
|
|
334
355
|
panels: {
|
package/dist/chrome.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chrome.cjs","names":[],"sources":["../src/config/chrome.ts"],"sourcesContent":["/**\n * The default layout: every bar, menu and panel the viewer ships, as plain\n * data. Structure only: no breakpoints, no show/hide lists, no locale\n * overrides, no dividers or spacers, no hand-written overflow menus. What fits\n * is measured and solved at runtime (@embedpdf/core-ui); the \"More\" menu is\n * derived, and so are the mode tabs (the `modes` group lists one per bar with\n * a `mode`).\n *\n * `importance` (1 makes room first … 5 never leaves the bar) is the only\n * responsive knob. The bar, group and menu ids are API: they don't change\n * between minor versions.\n */\nimport { createLayout, type LayoutData, type LayoutGroupObject } from '@embedpdf/core-ui';\n\n// Shared by the mode bars: plain values, so composition is just a const. Both are dependent:\n// they show beside a mode's tools, and a bar left with only them shows nothing, nor its tab.\nconst style: LayoutGroupObject = {\n id: 'style',\n items: ['panel:style'],\n importance: 4,\n dependent: true,\n};\nconst history: LayoutGroupObject = {\n id: 'history',\n items: ['history:undo', 'history:redo'],\n importance: 3,\n dependent: true,\n};\n\nexport const DEFAULT_LAYOUT: LayoutData = {\n bars: {\n main: {\n place: 'top',\n // The start section sits left-aligned: document menu, view, the zoom\n // field, pan and pointer. Only the mode tabs are truly centered.\n start: [\n { id: 'document', items: ['menu:document'], importance: 5 },\n {\n id: 'view',\n items: [{ command: 'panel:thumbnails', importance: 5 }, 'menu:view'],\n importance: 4,\n },\n // The zoom field; when it can't fit it draws its 'button' variant,\n // and in the \"More\" menu it stands in as menu:zoom.\n {\n id: 'zoom',\n items: [{ custom: 'zoom', command: 'menu:zoom', variants: ['inline', 'button'] }],\n importance: 4,\n },\n { id: 'tools', items: ['tool:pan', 'tool:pointer'], importance: 2 },\n ],\n center: [\n {\n // The tabs: View, then one per mode bar. The group ladder: full strip\n // → trailing tabs shed behind a chevron → select → the \"More\" menu.\n // The tabs sit at importance 1 so the strip compacts first; the group\n // at 4 so its compact forms last.\n id: 'modes',\n items: [],\n shed: true,\n collapse: 'select',\n importance: 4,\n titleKey: 'commands.mode.group',\n },\n ],\n end: [\n {\n id: 'panels',\n items: [\n // The View only label: it shows only while nothing can change the document, and\n // draws its icon alone when there's no room.\n { custom: 'view-only', variants: ['label', 'icon'] },\n 'panel:search',\n 'panel:comments',\n ],\n importance: 5,\n },\n ],\n },\n\n // ── the mode bars: along main, one at a time ──────────────────────────────\n annotate: {\n place: { with: 'main' },\n mode: 'annotate',\n titleKey: 'commands.mode.annotate',\n center: [\n { id: 'comment', items: ['tool:note', 'tool:link'], importance: 4 },\n {\n id: 'markup',\n items: ['tool:highlight', 'tool:strikeout', 'tool:underline', 'tool:squiggly'],\n importance: 4,\n },\n { id: 'draw', items: ['tool:ink', 'tool:ink-highlight'], importance: 3 },\n {\n id: 'text',\n items: ['tool:free-text', 'tool:insert-text', 'tool:replace-text', 'tool:callout'],\n importance: 2,\n },\n style,\n history,\n ],\n },\n shapes: {\n place: { with: 'main' },\n mode: 'shapes',\n titleKey: 'commands.mode.shapes',\n center: [\n {\n id: 'shapes',\n items: ['tool:square', 'tool:circle', 'tool:line', 'tool:arrow'],\n importance: 4,\n },\n { id: 'polygons', items: ['tool:polygon', 'tool:polyline'], importance: 2 },\n style,\n history,\n ],\n },\n insert: {\n place: { with: 'main' },\n mode: 'insert',\n titleKey: 'commands.mode.insert',\n center: [\n {\n id: 'stamps',\n items: [\n 'tool:stamp',\n // Quick marks (`plugins.stamp.quick`): thumbnails that arm on click; in\n // a menu the stamps panel stands in for them.\n { custom: 'quick-stamps', command: 'tool:stamp', importance: 3 },\n 'tool:attachment',\n 'tool:signature',\n 'tool:image',\n ],\n importance: 4,\n },\n style,\n history,\n ],\n },\n form: {\n place: { with: 'main' },\n mode: 'form',\n titleKey: 'commands.mode.form',\n center: [\n // The design switch first: what a field is, in its sidebar; how it looks is Style's.\n { id: 'design', items: ['form:design'], importance: 5 },\n { id: 'fields', items: ['tool:text-field', 'tool:checkbox', 'tool:radio'], importance: 4 },\n { id: 'choices', items: ['tool:combo-box', 'tool:list-box'], importance: 2 },\n { id: 'buttons', items: ['tool:button'], importance: 2 },\n { id: 'signatures', items: ['tool:signature-field'], importance: 2 },\n style,\n history,\n ],\n },\n redact: {\n place: { with: 'main' },\n mode: 'redact',\n titleKey: 'commands.mode.redact',\n center: [\n { id: 'redact', items: ['tool:redact', 'panel:redaction'], importance: 4 },\n style,\n history,\n ],\n },\n measure: {\n place: { with: 'main' },\n mode: 'measure',\n titleKey: 'commands.mode.measure',\n center: [\n {\n id: 'measure',\n items: ['tool:distance', 'tool:perimeter', 'tool:area', 'measurement:calibrate'],\n importance: 5,\n },\n {\n id: 'scale',\n items: [\n { custom: 'measurement-scale', command: 'panel:measurement', variants: ['inline'] },\n ],\n importance: 4,\n },\n style,\n ],\n },\n\n // ── over the pages ────────────────────────────────────────────────────────\n pager: {\n place: { float: 'bottom' },\n center: [{ id: 'pages', items: [{ custom: 'page-number' }] }],\n },\n // Which actions show is each command's `visible` (group only when\n // groupable, style only when the kind has editable properties…), so one\n // bar serves a single and a multiple selection.\n selection: {\n place: { at: 'selection' },\n center: [\n {\n id: 'selection',\n items: [\n 'selection:copy',\n 'selection:highlight',\n 'selection:underline',\n 'selection:strikeout',\n ],\n importance: 4,\n },\n ],\n },\n annotation: {\n place: { at: 'annotation' },\n center: [\n {\n id: 'actions',\n items: [\n 'annotation:comment',\n 'annotation:style',\n 'annotation:stamp-from-selection',\n 'annotation:link',\n 'annotation:goto-link',\n 'annotation:remove-link',\n 'annotation:group',\n 'annotation:ungroup',\n ],\n importance: 4,\n },\n // Its own group, so a line sets delete apart.\n { id: 'danger', items: ['annotation:delete'], importance: 5 },\n ],\n },\n },\n\n menus: {\n document: [['document:open', 'document:download', 'document:print'], ['view:fullscreen']],\n view: [\n {\n titleKey: 'commands.spread.group',\n items: ['view:single-page', 'view:two-pages', 'view:cover-page'],\n },\n {\n titleKey: 'commands.scroll.group',\n items: ['view:scroll-vertical', 'view:scroll-horizontal'],\n },\n {\n titleKey: 'commands.rotate.group',\n items: ['view:rotate-clockwise', 'view:rotate-counterclockwise'],\n },\n ['view:fullscreen'],\n ],\n zoom: [\n {\n titleKey: 'commands.zoom.level',\n items: ['zoom:50', 'zoom:100', 'zoom:150', 'zoom:200', 'zoom:400'],\n },\n ['zoom:in', 'zoom:out'],\n ['zoom:fit-page', 'zoom:fit-width', 'zoom:automatic'],\n ],\n },\n\n // Each panel's button is its `panel:<id>` command, titled and drawn as the panel is\n // (config/panels.ts); the panels on one side take turns.\n panels: {\n thumbnails: { side: 'start', titleKey: 'panels.thumbnails', icon: 'sidebar' },\n outline: { side: 'start', titleKey: 'panels.outline', icon: 'listTree' },\n attachments: { side: 'start', titleKey: 'panels.attachments', icon: 'paperclip' },\n search: { side: 'end', titleKey: 'panels.search', icon: 'search' },\n comments: { side: 'end', titleKey: 'panels.comments', icon: 'comment' },\n style: { side: 'end', titleKey: 'panels.style', icon: 'palette' },\n stamps: { side: 'end', titleKey: 'panels.stamps', icon: 'rubberStamp' },\n signatures: { side: 'end', titleKey: 'panels.signatures', icon: 'signature' },\n redaction: { side: 'end', titleKey: 'panels.redaction', icon: 'redactionSidebar' },\n measurement: { side: 'end', titleKey: 'panels.measurement', icon: 'updateScale' },\n // The form designer's sidebar: the document's fields, and what the selected one is.\n 'form-design': { side: 'end', titleKey: 'panels.formDesign', icon: 'formDesign' },\n },\n};\n\n/** The default layout, which the `layout` function gets. */\nexport const defaultLayout = createLayout(DEFAULT_LAYOUT);\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAA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;EACjE,UAAU;GAAE,MAAM;GAAO,UAAU;GAAmB,MAAM;EAAU;EACtE,OAAO;GAAE,MAAM;GAAO,UAAU;GAAgB,MAAM;EAAU;EAChE,QAAQ;GAAE,MAAM;GAAO,UAAU;GAAiB,MAAM;EAAc;EACtE,YAAY;GAAE,MAAM;GAAO,UAAU;GAAqB,MAAM;EAAY;EAC5E,WAAW;GAAE,MAAM;GAAO,UAAU;GAAoB,MAAM;EAAmB;EACjF,aAAa;GAAE,MAAM;GAAO,UAAU;GAAsB,MAAM;EAAc;EAEhF,eAAe;GAAE,MAAM;GAAO,UAAU;GAAqB,MAAM;EAAa;CAClF;AACF;;AAGA,MAAa,iBAAA,GAAA,kBAAA,aAAA,CAA6B,cAAc"}
|
|
1
|
+
{"version":3,"file":"chrome.cjs","names":[],"sources":["../src/config/chrome.ts"],"sourcesContent":["/**\n * The default layout: every bar, menu and panel the viewer ships, as plain\n * data. Structure only: no breakpoints, no show/hide lists, no locale\n * overrides, no dividers or spacers, no hand-written overflow menus. What fits\n * is measured and solved at runtime (@embedpdf/core-ui); the \"More\" menu is\n * derived, and so are the mode tabs (the `modes` group lists one per bar with\n * a `mode`).\n *\n * `importance` (1 makes room first … 5 never leaves the bar) is the only\n * responsive knob. The bar, group and menu ids are API: they don't change\n * between minor versions.\n */\nimport { createLayout, type LayoutData, type LayoutGroupObject } from '@embedpdf/core-ui';\n\n// Shared by the mode bars: plain values, so composition is just a const. Both are dependent:\n// they show beside a mode's tools, and a bar left with only them shows nothing, nor its tab.\nconst style: LayoutGroupObject = {\n id: 'style',\n items: ['panel:style'],\n importance: 4,\n dependent: true,\n};\nconst history: LayoutGroupObject = {\n id: 'history',\n items: ['history:undo', 'history:redo'],\n importance: 3,\n dependent: true,\n};\n\nexport const DEFAULT_LAYOUT: LayoutData = {\n bars: {\n main: {\n place: 'top',\n // The start section sits left-aligned: document menu, view, the zoom\n // field, pan and pointer. Only the mode tabs are truly centered.\n start: [\n { id: 'document', items: ['menu:document'], importance: 5 },\n {\n id: 'view',\n items: [{ command: 'panel:thumbnails', importance: 5 }, 'menu:view'],\n importance: 4,\n },\n // The zoom field; when it can't fit it draws its 'button' variant,\n // and in the \"More\" menu it stands in as menu:zoom.\n {\n id: 'zoom',\n items: [{ custom: 'zoom', command: 'menu:zoom', variants: ['inline', 'button'] }],\n importance: 4,\n },\n { id: 'tools', items: ['tool:pan', 'tool:pointer'], importance: 2 },\n ],\n center: [\n {\n // The tabs: View, then one per mode bar. The group ladder: full strip\n // → trailing tabs shed behind a chevron → select → the \"More\" menu.\n // The tabs sit at importance 1 so the strip compacts first; the group\n // at 4 so its compact forms last.\n id: 'modes',\n items: [],\n shed: true,\n collapse: 'select',\n importance: 4,\n titleKey: 'commands.mode.group',\n },\n ],\n end: [\n {\n id: 'panels',\n items: [\n // The View only label: it shows only while nothing can change the document, and\n // draws its icon alone when there's no room.\n { custom: 'view-only', variants: ['label', 'icon'] },\n 'panel:search',\n 'panel:comments',\n ],\n importance: 5,\n },\n ],\n },\n\n // ── the mode bars: along main, one at a time ──────────────────────────────\n annotate: {\n place: { with: 'main' },\n mode: 'annotate',\n titleKey: 'commands.mode.annotate',\n center: [\n { id: 'comment', items: ['tool:note', 'tool:link'], importance: 4 },\n {\n id: 'markup',\n items: ['tool:highlight', 'tool:strikeout', 'tool:underline', 'tool:squiggly'],\n importance: 4,\n },\n { id: 'draw', items: ['tool:ink', 'tool:ink-highlight'], importance: 3 },\n {\n id: 'text',\n items: ['tool:free-text', 'tool:insert-text', 'tool:replace-text', 'tool:callout'],\n importance: 2,\n },\n style,\n history,\n ],\n },\n shapes: {\n place: { with: 'main' },\n mode: 'shapes',\n titleKey: 'commands.mode.shapes',\n center: [\n {\n id: 'shapes',\n items: ['tool:square', 'tool:circle', 'tool:line', 'tool:arrow'],\n importance: 4,\n },\n { id: 'polygons', items: ['tool:polygon', 'tool:polyline'], importance: 2 },\n style,\n history,\n ],\n },\n insert: {\n place: { with: 'main' },\n mode: 'insert',\n titleKey: 'commands.mode.insert',\n center: [\n {\n id: 'stamps',\n items: [\n 'tool:stamp',\n // Quick marks (`plugins.stamp.quick`): thumbnails that arm on click; in\n // a menu the stamps panel stands in for them.\n { custom: 'quick-stamps', command: 'tool:stamp', importance: 3 },\n 'tool:attachment',\n 'tool:signature',\n 'tool:image',\n ],\n importance: 4,\n },\n style,\n history,\n ],\n },\n form: {\n place: { with: 'main' },\n mode: 'form',\n titleKey: 'commands.mode.form',\n center: [\n // The design switch first: what a field is, in its sidebar; how it looks is Style's.\n { id: 'design', items: ['form:design'], importance: 5 },\n { id: 'fields', items: ['tool:text-field', 'tool:checkbox', 'tool:radio'], importance: 4 },\n { id: 'choices', items: ['tool:combo-box', 'tool:list-box'], importance: 2 },\n { id: 'buttons', items: ['tool:button'], importance: 2 },\n { id: 'signatures', items: ['tool:signature-field'], importance: 2 },\n style,\n history,\n ],\n },\n redact: {\n place: { with: 'main' },\n mode: 'redact',\n titleKey: 'commands.mode.redact',\n center: [\n { id: 'redact', items: ['tool:redact', 'panel:redaction'], importance: 4 },\n style,\n history,\n ],\n },\n measure: {\n place: { with: 'main' },\n mode: 'measure',\n titleKey: 'commands.mode.measure',\n center: [\n {\n id: 'measure',\n items: ['tool:distance', 'tool:perimeter', 'tool:area', 'measurement:calibrate'],\n importance: 5,\n },\n {\n id: 'scale',\n items: [\n { custom: 'measurement-scale', command: 'panel:measurement', variants: ['inline'] },\n ],\n importance: 4,\n },\n style,\n ],\n },\n // ── over the pages ────────────────────────────────────────────────────────\n pager: {\n place: { float: 'bottom' },\n center: [{ id: 'pages', items: [{ custom: 'page-number' }] }],\n },\n // Which actions show is each command's `visible` (group only when\n // groupable, style only when the kind has editable properties…), so one\n // bar serves a single and a multiple selection.\n selection: {\n place: { at: 'selection' },\n center: [\n {\n id: 'selection',\n items: [\n 'selection:copy',\n 'selection:highlight',\n 'selection:underline',\n 'selection:strikeout',\n ],\n importance: 4,\n },\n ],\n },\n annotation: {\n place: { at: 'annotation' },\n center: [\n {\n id: 'actions',\n items: [\n 'annotation:comment',\n 'annotation:style',\n 'annotation:stamp-from-selection',\n 'annotation:link',\n 'annotation:goto-link',\n 'annotation:save-file',\n 'annotation:remove-link',\n 'annotation:group',\n 'annotation:ungroup',\n ],\n importance: 4,\n },\n // Its own group, so a line sets delete apart.\n { id: 'danger', items: ['annotation:delete'], importance: 5 },\n ],\n },\n },\n\n menus: {\n document: [['document:open', 'document:download', 'document:print'], ['view:fullscreen']],\n view: [\n {\n titleKey: 'commands.spread.group',\n items: ['view:single-page', 'view:two-pages', 'view:cover-page'],\n },\n {\n titleKey: 'commands.scroll.group',\n items: ['view:scroll-vertical', 'view:scroll-horizontal'],\n },\n {\n titleKey: 'commands.rotate.group',\n items: ['view:rotate-clockwise', 'view:rotate-counterclockwise'],\n },\n ['view:fullscreen'],\n ],\n zoom: [\n {\n titleKey: 'commands.zoom.level',\n items: ['zoom:50', 'zoom:100', 'zoom:150', 'zoom:200', 'zoom:400'],\n },\n ['zoom:in', 'zoom:out'],\n ['zoom:fit-page', 'zoom:fit-width', 'zoom:automatic'],\n ],\n // A row of the outline panel: its menu button and a right-click on it open this.\n 'outline-item': [\n ['outline:add', 'outline:add-child'],\n ['outline:rename', 'outline:set-destination', 'outline:properties'],\n ['outline:delete'],\n ],\n // A file of the attachments panel: its menu button and a right-click on it open this.\n 'attachment-item': [['attachment:save', 'attachment:go-to'], ['attachment:delete']],\n // A page of the thumbnails panel: its menu button, a right-click and a long-press open this.\n page: [\n ['page:rotate-clockwise', 'page:rotate-counterclockwise'],\n ['page:insert-blank', 'page:insert-file', 'page:duplicate'],\n ['page:extract'],\n ['page:delete'],\n ],\n },\n\n // Each panel's button is its `panel:<id>` command, titled and drawn as the panel is\n // (config/panels.ts); the panels on one side take turns.\n panels: {\n thumbnails: { side: 'start', titleKey: 'panels.thumbnails', icon: 'sidebar' },\n outline: { side: 'start', titleKey: 'panels.outline', icon: 'listTree' },\n attachments: { side: 'start', titleKey: 'panels.attachments', icon: 'paperclip' },\n search: { side: 'end', titleKey: 'panels.search', icon: 'search' },\n comments: { side: 'end', titleKey: 'panels.comments', icon: 'comment' },\n style: { side: 'end', titleKey: 'panels.style', icon: 'palette' },\n stamps: { side: 'end', titleKey: 'panels.stamps', icon: 'rubberStamp' },\n signatures: { side: 'end', titleKey: 'panels.signatures', icon: 'signature' },\n redaction: { side: 'end', titleKey: 'panels.redaction', icon: 'redactionSidebar' },\n measurement: { side: 'end', titleKey: 'panels.measurement', icon: 'updateScale' },\n // The form designer's sidebar: the document's fields, and what the selected one is.\n 'form-design': { side: 'end', titleKey: 'panels.formDesign', icon: 'formDesign' },\n },\n};\n\n/** The default layout, which the `layout` function gets. */\nexport const defaultLayout = createLayout(DEFAULT_LAYOUT);\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAM,QAA2B;CAC/B,IAAI;CACJ,OAAO,CAAC,aAAa;CACrB,YAAY;CACZ,WAAW;AACb;AACA,MAAM,UAA6B;CACjC,IAAI;CACJ,OAAO,CAAC,gBAAgB,cAAc;CACtC,YAAY;CACZ,WAAW;AACb;AAEA,MAAa,iBAA6B;CACxC,MAAM;EACJ,MAAM;GACJ,OAAO;GAGP,OAAO;IACL;KAAE,IAAI;KAAY,OAAO,CAAC,eAAe;KAAG,YAAY;IAAE;IAC1D;KACE,IAAI;KACJ,OAAO,CAAC;MAAE,SAAS;MAAoB,YAAY;KAAE,GAAG,WAAW;KACnE,YAAY;IACd;IAGA;KACE,IAAI;KACJ,OAAO,CAAC;MAAE,QAAQ;MAAQ,SAAS;MAAa,UAAU,CAAC,UAAU,QAAQ;KAAE,CAAC;KAChF,YAAY;IACd;IACA;KAAE,IAAI;KAAS,OAAO,CAAC,YAAY,cAAc;KAAG,YAAY;IAAE;GACpE;GACA,QAAQ,CACN;IAKE,IAAI;IACJ,OAAO,CAAC;IACR,MAAM;IACN,UAAU;IACV,YAAY;IACZ,UAAU;GACZ,CACF;GACA,KAAK,CACH;IACE,IAAI;IACJ,OAAO;KAGL;MAAE,QA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6B,cAAc"}
|
package/dist/chrome.js
CHANGED
|
@@ -274,6 +274,7 @@ const DEFAULT_LAYOUT = {
|
|
|
274
274
|
"annotation:stamp-from-selection",
|
|
275
275
|
"annotation:link",
|
|
276
276
|
"annotation:goto-link",
|
|
277
|
+
"annotation:save-file",
|
|
277
278
|
"annotation:remove-link",
|
|
278
279
|
"annotation:group",
|
|
279
280
|
"annotation:ungroup"
|
|
@@ -328,6 +329,26 @@ const DEFAULT_LAYOUT = {
|
|
|
328
329
|
"zoom:fit-width",
|
|
329
330
|
"zoom:automatic"
|
|
330
331
|
]
|
|
332
|
+
],
|
|
333
|
+
"outline-item": [
|
|
334
|
+
["outline:add", "outline:add-child"],
|
|
335
|
+
[
|
|
336
|
+
"outline:rename",
|
|
337
|
+
"outline:set-destination",
|
|
338
|
+
"outline:properties"
|
|
339
|
+
],
|
|
340
|
+
["outline:delete"]
|
|
341
|
+
],
|
|
342
|
+
"attachment-item": [["attachment:save", "attachment:go-to"], ["attachment:delete"]],
|
|
343
|
+
page: [
|
|
344
|
+
["page:rotate-clockwise", "page:rotate-counterclockwise"],
|
|
345
|
+
[
|
|
346
|
+
"page:insert-blank",
|
|
347
|
+
"page:insert-file",
|
|
348
|
+
"page:duplicate"
|
|
349
|
+
],
|
|
350
|
+
["page:extract"],
|
|
351
|
+
["page:delete"]
|
|
331
352
|
]
|
|
332
353
|
},
|
|
333
354
|
panels: {
|
package/dist/chrome.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chrome.js","names":[],"sources":["../src/config/chrome.ts"],"sourcesContent":["/**\n * The default layout: every bar, menu and panel the viewer ships, as plain\n * data. Structure only: no breakpoints, no show/hide lists, no locale\n * overrides, no dividers or spacers, no hand-written overflow menus. What fits\n * is measured and solved at runtime (@embedpdf/core-ui); the \"More\" menu is\n * derived, and so are the mode tabs (the `modes` group lists one per bar with\n * a `mode`).\n *\n * `importance` (1 makes room first … 5 never leaves the bar) is the only\n * responsive knob. The bar, group and menu ids are API: they don't change\n * between minor versions.\n */\nimport { createLayout, type LayoutData, type LayoutGroupObject } from '@embedpdf/core-ui';\n\n// Shared by the mode bars: plain values, so composition is just a const. Both are dependent:\n// they show beside a mode's tools, and a bar left with only them shows nothing, nor its tab.\nconst style: LayoutGroupObject = {\n id: 'style',\n items: ['panel:style'],\n importance: 4,\n dependent: true,\n};\nconst history: LayoutGroupObject = {\n id: 'history',\n items: ['history:undo', 'history:redo'],\n importance: 3,\n dependent: true,\n};\n\nexport const DEFAULT_LAYOUT: LayoutData = {\n bars: {\n main: {\n place: 'top',\n // The start section sits left-aligned: document menu, view, the zoom\n // field, pan and pointer. Only the mode tabs are truly centered.\n start: [\n { id: 'document', items: ['menu:document'], importance: 5 },\n {\n id: 'view',\n items: [{ command: 'panel:thumbnails', importance: 5 }, 'menu:view'],\n importance: 4,\n },\n // The zoom field; when it can't fit it draws its 'button' variant,\n // and in the \"More\" menu it stands in as menu:zoom.\n {\n id: 'zoom',\n items: [{ custom: 'zoom', command: 'menu:zoom', variants: ['inline', 'button'] }],\n importance: 4,\n },\n { id: 'tools', items: ['tool:pan', 'tool:pointer'], importance: 2 },\n ],\n center: [\n {\n // The tabs: View, then one per mode bar. The group ladder: full strip\n // → trailing tabs shed behind a chevron → select → the \"More\" menu.\n // The tabs sit at importance 1 so the strip compacts first; the group\n // at 4 so its compact forms last.\n id: 'modes',\n items: [],\n shed: true,\n collapse: 'select',\n importance: 4,\n titleKey: 'commands.mode.group',\n },\n ],\n end: [\n {\n id: 'panels',\n items: [\n // The View only label: it shows only while nothing can change the document, and\n // draws its icon alone when there's no room.\n { custom: 'view-only', variants: ['label', 'icon'] },\n 'panel:search',\n 'panel:comments',\n ],\n importance: 5,\n },\n ],\n },\n\n // ── the mode bars: along main, one at a time ──────────────────────────────\n annotate: {\n place: { with: 'main' },\n mode: 'annotate',\n titleKey: 'commands.mode.annotate',\n center: [\n { id: 'comment', items: ['tool:note', 'tool:link'], importance: 4 },\n {\n id: 'markup',\n items: ['tool:highlight', 'tool:strikeout', 'tool:underline', 'tool:squiggly'],\n importance: 4,\n },\n { id: 'draw', items: ['tool:ink', 'tool:ink-highlight'], importance: 3 },\n {\n id: 'text',\n items: ['tool:free-text', 'tool:insert-text', 'tool:replace-text', 'tool:callout'],\n importance: 2,\n },\n style,\n history,\n ],\n },\n shapes: {\n place: { with: 'main' },\n mode: 'shapes',\n titleKey: 'commands.mode.shapes',\n center: [\n {\n id: 'shapes',\n items: ['tool:square', 'tool:circle', 'tool:line', 'tool:arrow'],\n importance: 4,\n },\n { id: 'polygons', items: ['tool:polygon', 'tool:polyline'], importance: 2 },\n style,\n history,\n ],\n },\n insert: {\n place: { with: 'main' },\n mode: 'insert',\n titleKey: 'commands.mode.insert',\n center: [\n {\n id: 'stamps',\n items: [\n 'tool:stamp',\n // Quick marks (`plugins.stamp.quick`): thumbnails that arm on click; in\n // a menu the stamps panel stands in for them.\n { custom: 'quick-stamps', command: 'tool:stamp', importance: 3 },\n 'tool:attachment',\n 'tool:signature',\n 'tool:image',\n ],\n importance: 4,\n },\n style,\n history,\n ],\n },\n form: {\n place: { with: 'main' },\n mode: 'form',\n titleKey: 'commands.mode.form',\n center: [\n // The design switch first: what a field is, in its sidebar; how it looks is Style's.\n { id: 'design', items: ['form:design'], importance: 5 },\n { id: 'fields', items: ['tool:text-field', 'tool:checkbox', 'tool:radio'], importance: 4 },\n { id: 'choices', items: ['tool:combo-box', 'tool:list-box'], importance: 2 },\n { id: 'buttons', items: ['tool:button'], importance: 2 },\n { id: 'signatures', items: ['tool:signature-field'], importance: 2 },\n style,\n history,\n ],\n },\n redact: {\n place: { with: 'main' },\n mode: 'redact',\n titleKey: 'commands.mode.redact',\n center: [\n { id: 'redact', items: ['tool:redact', 'panel:redaction'], importance: 4 },\n style,\n history,\n ],\n },\n measure: {\n place: { with: 'main' },\n mode: 'measure',\n titleKey: 'commands.mode.measure',\n center: [\n {\n id: 'measure',\n items: ['tool:distance', 'tool:perimeter', 'tool:area', 'measurement:calibrate'],\n importance: 5,\n },\n {\n id: 'scale',\n items: [\n { custom: 'measurement-scale', command: 'panel:measurement', variants: ['inline'] },\n ],\n importance: 4,\n },\n style,\n ],\n },\n\n // ── over the pages ────────────────────────────────────────────────────────\n pager: {\n place: { float: 'bottom' },\n center: [{ id: 'pages', items: [{ custom: 'page-number' }] }],\n },\n // Which actions show is each command's `visible` (group only when\n // groupable, style only when the kind has editable properties…), so one\n // bar serves a single and a multiple selection.\n selection: {\n place: { at: 'selection' },\n center: [\n {\n id: 'selection',\n items: [\n 'selection:copy',\n 'selection:highlight',\n 'selection:underline',\n 'selection:strikeout',\n ],\n importance: 4,\n },\n ],\n },\n annotation: {\n place: { at: 'annotation' },\n center: [\n {\n id: 'actions',\n items: [\n 'annotation:comment',\n 'annotation:style',\n 'annotation:stamp-from-selection',\n 'annotation:link',\n 'annotation:goto-link',\n 'annotation:remove-link',\n 'annotation:group',\n 'annotation:ungroup',\n ],\n importance: 4,\n },\n // Its own group, so a line sets delete apart.\n { id: 'danger', items: ['annotation:delete'], importance: 5 },\n ],\n },\n },\n\n menus: {\n document: [['document:open', 'document:download', 'document:print'], ['view:fullscreen']],\n view: [\n {\n titleKey: 'commands.spread.group',\n items: ['view:single-page', 'view:two-pages', 'view:cover-page'],\n },\n {\n titleKey: 'commands.scroll.group',\n items: ['view:scroll-vertical', 'view:scroll-horizontal'],\n },\n {\n titleKey: 'commands.rotate.group',\n items: ['view:rotate-clockwise', 'view:rotate-counterclockwise'],\n },\n ['view:fullscreen'],\n ],\n zoom: [\n {\n titleKey: 'commands.zoom.level',\n items: ['zoom:50', 'zoom:100', 'zoom:150', 'zoom:200', 'zoom:400'],\n },\n ['zoom:in', 'zoom:out'],\n ['zoom:fit-page', 'zoom:fit-width', 'zoom:automatic'],\n ],\n },\n\n // Each panel's button is its `panel:<id>` command, titled and drawn as the panel is\n // (config/panels.ts); the panels on one side take turns.\n panels: {\n thumbnails: { side: 'start', titleKey: 'panels.thumbnails', icon: 'sidebar' },\n outline: { side: 'start', titleKey: 'panels.outline', icon: 'listTree' },\n attachments: { side: 'start', titleKey: 'panels.attachments', icon: 'paperclip' },\n search: { side: 'end', titleKey: 'panels.search', icon: 'search' },\n comments: { side: 'end', titleKey: 'panels.comments', icon: 'comment' },\n style: { side: 'end', titleKey: 'panels.style', icon: 'palette' },\n stamps: { side: 'end', titleKey: 'panels.stamps', icon: 'rubberStamp' },\n signatures: { side: 'end', titleKey: 'panels.signatures', icon: 'signature' },\n redaction: { side: 'end', titleKey: 'panels.redaction', icon: 'redactionSidebar' },\n measurement: { side: 'end', titleKey: 'panels.measurement', icon: 'updateScale' },\n // The form designer's sidebar: the document's fields, and what the selected one is.\n 'form-design': { side: 'end', titleKey: 'panels.formDesign', icon: 'formDesign' },\n },\n};\n\n/** The default layout, which the `layout` function gets. */\nexport const defaultLayout = createLayout(DEFAULT_LAYOUT);\n"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAM,QAA2B;CAC/B,IAAI;CACJ,OAAO,CAAC,aAAa;CACrB,YAAY;CACZ,WAAW;AACb;AACA,MAAM,UAA6B;CACjC,IAAI;CACJ,OAAO,CAAC,gBAAgB,cAAc;CACtC,YAAY;CACZ,WAAW;AACb;AAEA,MAAa,iBAA6B;CACxC,MAAM;EACJ,MAAM;GACJ,OAAO;GAGP,OAAO;IACL;KAAE,IAAI;KAAY,OAAO,CAAC,eAAe;KAAG,YAAY;IAAE;IAC1D;KACE,IAAI;KACJ,OAAO,CAAC;MAAE,SAAS;MAAoB,YAAY;KAAE,GAAG,WAAW;KACnE,YAAY;IACd;IAGA;KACE,IAAI;KACJ,OAAO,CAAC;MAAE,QAAQ;MAAQ,SAAS;MAAa,UAAU,CAAC,UAAU,QAAQ;KAAE,CAAC;KAChF,YAAY;IACd;IACA;KAAE,IAAI;KAAS,OAAO,CAAC,YAAY,cAAc;KAAG,YAAY;IAAE;GACpE;GACA,QAAQ,CACN;IAKE,IAAI;IACJ,OAAO,CAAC;IACR,MAAM;IAC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,MAAM;GACJ;IACE,UAAU;IACV,OAAO;KAAC;KAAoB;KAAkB;IAAiB;GACjE;GACA;IACE,UAAU;IACV,OAAO,CAAC,wBAAwB,wBAAwB;GAC1D;GACA;IACE,UAAU;IACV,OAAO,CAAC,yBAAyB,8BAA8B;GACjE;GACA,CAAC,iBAAiB;EACpB;EACA,MAAM;GACJ;IACE,UAAU;IACV,OAAO;KAAC;KAAW;KAAY;KAAY;KAAY;IAAU;GACnE;GACA,CAAC,WAAW,UAAU;GACtB;IAAC;IAAiB;IAAkB;GAAgB;EACtD;CACF;CAIA,QAAQ;EACN,YAAY;GAAE,MAAM;GAAS,UAAU;GAAqB,MAAM;EAAU;EAC5E,SAAS;GAAE,MAAM;GAAS,UAAU;GAAkB,MAAM;EAAW;EACvE,aAAa;GAAE,MAAM;GAAS,UAAU;GAAsB,MAAM;EAAY;EAChF,QAAQ;GAAE,MAAM;GAAO,UAAU;GAAiB,MAAM;EAAS;EACjE,UAAU;GAAE,MAAM;GAAO,UAAU;GAAmB,MAAM;EAAU;EACtE,OAAO;GAAE,MAAM;GAAO,UAAU;GAAgB,MAAM;EAAU;EAChE,QAAQ;GAAE,MAAM;GAAO,UAAU;GAAiB,MAAM;EAAc;EACtE,YAAY;GAAE,MAAM;GAAO,UAAU;GAAqB,MAAM;EAAY;EAC5E,WAAW;GAAE,MAAM;GAAO,UAAU;GAAoB,MAAM;EAAmB;EACjF,aAAa;GAAE,MAAM;GAAO,UAAU;GAAsB,MAAM;EAAc;EAEhF,eAAe;GAAE,MAAM;GAAO,UAAU;GAAqB,MAAM;EAAa;CAClF;AACF;;AAGA,MAAa,gBAAgB,aAAa,cAAc"}
|
|
1
|
+
{"version":3,"file":"chrome.js","names":[],"sources":["../src/config/chrome.ts"],"sourcesContent":["/**\n * The default layout: every bar, menu and panel the viewer ships, as plain\n * data. Structure only: no breakpoints, no show/hide lists, no locale\n * overrides, no dividers or spacers, no hand-written overflow menus. What fits\n * is measured and solved at runtime (@embedpdf/core-ui); the \"More\" menu is\n * derived, and so are the mode tabs (the `modes` group lists one per bar with\n * a `mode`).\n *\n * `importance` (1 makes room first … 5 never leaves the bar) is the only\n * responsive knob. The bar, group and menu ids are API: they don't change\n * between minor versions.\n */\nimport { createLayout, type LayoutData, type LayoutGroupObject } from '@embedpdf/core-ui';\n\n// Shared by the mode bars: plain values, so composition is just a const. Both are dependent:\n// they show beside a mode's tools, and a bar left with only them shows nothing, nor its tab.\nconst style: LayoutGroupObject = {\n id: 'style',\n items: ['panel:style'],\n importance: 4,\n dependent: true,\n};\nconst history: LayoutGroupObject = {\n id: 'history',\n items: ['history:undo', 'history:redo'],\n importance: 3,\n dependent: true,\n};\n\nexport const DEFAULT_LAYOUT: LayoutData = {\n bars: {\n main: {\n place: 'top',\n // The start section sits left-aligned: document menu, view, the zoom\n // field, pan and pointer. Only the mode tabs are truly centered.\n start: [\n { id: 'document', items: ['menu:document'], importance: 5 },\n {\n id: 'view',\n items: [{ command: 'panel:thumbnails', importance: 5 }, 'menu:view'],\n importance: 4,\n },\n // The zoom field; when it can't fit it draws its 'button' variant,\n // and in the \"More\" menu it stands in as menu:zoom.\n {\n id: 'zoom',\n items: [{ custom: 'zoom', command: 'menu:zoom', variants: ['inline', 'button'] }],\n importance: 4,\n },\n { id: 'tools', items: ['tool:pan', 'tool:pointer'], importance: 2 },\n ],\n center: [\n {\n // The tabs: View, then one per mode bar. The group ladder: full strip\n // → trailing tabs shed behind a chevron → select → the \"More\" menu.\n // The tabs sit at importance 1 so the strip compacts first; the group\n // at 4 so its compact forms last.\n id: 'modes',\n items: [],\n shed: true,\n collapse: 'select',\n importance: 4,\n titleKey: 'commands.mode.group',\n },\n ],\n end: [\n {\n id: 'panels',\n items: [\n // The View only label: it shows only while nothing can change the document, and\n // draws its icon alone when there's no room.\n { custom: 'view-only', variants: ['label', 'icon'] },\n 'panel:search',\n 'panel:comments',\n ],\n importance: 5,\n },\n ],\n },\n\n // ── the mode bars: along main, one at a time ──────────────────────────────\n annotate: {\n place: { with: 'main' },\n mode: 'annotate',\n titleKey: 'commands.mode.annotate',\n center: [\n { id: 'comment', items: ['tool:note', 'tool:link'], importance: 4 },\n {\n id: 'markup',\n items: ['tool:highlight', 'tool:strikeout', 'tool:underline', 'tool:squiggly'],\n importance: 4,\n },\n { id: 'draw', items: ['tool:ink', 'tool:ink-highlight'], importance: 3 },\n {\n id: 'text',\n items: ['tool:free-text', 'tool:insert-text', 'tool:replace-text', 'tool:callout'],\n importance: 2,\n },\n style,\n history,\n ],\n },\n shapes: {\n place: { with: 'main' },\n mode: 'shapes',\n titleKey: 'commands.mode.shapes',\n center: [\n {\n id: 'shapes',\n items: ['tool:square', 'tool:circle', 'tool:line', 'tool:arrow'],\n importance: 4,\n },\n { id: 'polygons', items: ['tool:polygon', 'tool:polyline'], importance: 2 },\n style,\n history,\n ],\n },\n insert: {\n place: { with: 'main' },\n mode: 'insert',\n titleKey: 'commands.mode.insert',\n center: [\n {\n id: 'stamps',\n items: [\n 'tool:stamp',\n // Quick marks (`plugins.stamp.quick`): thumbnails that arm on click; in\n // a menu the stamps panel stands in for them.\n { custom: 'quick-stamps', command: 'tool:stamp', importance: 3 },\n 'tool:attachment',\n 'tool:signature',\n 'tool:image',\n ],\n importance: 4,\n },\n style,\n history,\n ],\n },\n form: {\n place: { with: 'main' },\n mode: 'form',\n titleKey: 'commands.mode.form',\n center: [\n // The design switch first: what a field is, in its sidebar; how it looks is Style's.\n { id: 'design', items: ['form:design'], importance: 5 },\n { id: 'fields', items: ['tool:text-field', 'tool:checkbox', 'tool:radio'], importance: 4 },\n { id: 'choices', items: ['tool:combo-box', 'tool:list-box'], importance: 2 },\n { id: 'buttons', items: ['tool:button'], importance: 2 },\n { id: 'signatures', items: ['tool:signature-field'], importance: 2 },\n style,\n history,\n ],\n },\n redact: {\n place: { with: 'main' },\n mode: 'redact',\n titleKey: 'commands.mode.redact',\n center: [\n { id: 'redact', items: ['tool:redact', 'panel:redaction'], importance: 4 },\n style,\n history,\n ],\n },\n measure: {\n place: { with: 'main' },\n mode: 'measure',\n titleKey: 'commands.mode.measure',\n center: [\n {\n id: 'measure',\n items: ['tool:distance', 'tool:perimeter', 'tool:area', 'measurement:calibrate'],\n importance: 5,\n },\n {\n id: 'scale',\n items: [\n { custom: 'measurement-scale', command: 'panel:measurement', variants: ['inline'] },\n ],\n importance: 4,\n },\n style,\n ],\n },\n // ── over the pages ────────────────────────────────────────────────────────\n pager: {\n place: { float: 'bottom' },\n center: [{ id: 'pages', items: [{ custom: 'page-number' }] }],\n },\n // Which actions show is each command's `visible` (group only when\n // groupable, style only when the kind has editable properties…), so one\n // bar serves a single and a multiple selection.\n selection: {\n place: { at: 'selection' },\n center: [\n {\n id: 'selection',\n items: [\n 'selection:copy',\n 'selection:highlight',\n 'selection:underline',\n 'selection:strikeout',\n ],\n importance: 4,\n },\n ],\n },\n annotation: {\n place: { at: 'annotation' },\n center: [\n {\n id: 'actions',\n items: [\n 'annotation:comment',\n 'annotation:style',\n 'annotation:stamp-from-selection',\n 'annotation:link',\n 'annotation:goto-link',\n 'annotation:save-file',\n 'annotation:remove-link',\n 'annotation:group',\n 'annotation:ungroup',\n ],\n importance: 4,\n },\n // Its own group, so a line sets delete apart.\n { id: 'danger', items: ['annotation:delete'], importance: 5 },\n ],\n },\n },\n\n menus: {\n document: [['document:open', 'document:download', 'document:print'], ['view:fullscreen']],\n view: [\n {\n titleKey: 'commands.spread.group',\n items: ['view:single-page', 'view:two-pages', 'view:cover-page'],\n },\n {\n titleKey: 'commands.scroll.group',\n items: ['view:scroll-vertical', 'view:scroll-horizontal'],\n },\n {\n titleKey: 'commands.rotate.group',\n items: ['view:rotate-clockwise', 'view:rotate-counterclockwise'],\n },\n ['view:fullscreen'],\n ],\n zoom: [\n {\n titleKey: 'commands.zoom.level',\n items: ['zoom:50', 'zoom:100', 'zoom:150', 'zoom:200', 'zoom:400'],\n },\n ['zoom:in', 'zoom:out'],\n ['zoom:fit-page', 'zoom:fit-width', 'zoom:automatic'],\n ],\n // A row of the outline panel: its menu button and a right-click on it open this.\n 'outline-item': [\n ['outline:add', 'outline:add-child'],\n ['outline:rename', 'outline:set-destination', 'outline:properties'],\n ['outline:delete'],\n ],\n // A file of the attachments panel: its menu button and a right-click on it open this.\n 'attachment-item': [['attachment:save', 'attachment:go-to'], ['attachment:delete']],\n // A page of the thumbnails panel: its menu button, a right-click and a long-press open this.\n page: [\n ['page:rotate-clockwise', 'page:rotate-counterclockwise'],\n ['page:insert-blank', 'page:insert-file', 'page:duplicate'],\n ['page:extract'],\n ['page:delete'],\n ],\n },\n\n // Each panel's button is its `panel:<id>` command, titled and drawn as the panel is\n // (config/panels.ts); the panels on one side take turns.\n panels: {\n thumbnails: { side: 'start', titleKey: 'panels.thumbnails', icon: 'sidebar' },\n outline: { side: 'start', titleKey: 'panels.outline', icon: 'listTree' },\n attachments: { side: 'start', titleKey: 'panels.attachments', icon: 'paperclip' },\n search: { side: 'end', titleKey: 'panels.search', icon: 'search' },\n comments: { side: 'end', titleKey: 'panels.comments', icon: 'comment' },\n style: { side: 'end', titleKey: 'panels.style', icon: 'palette' },\n stamps: { side: 'end', titleKey: 'panels.stamps', icon: 'rubberStamp' },\n signatures: { side: 'end', titleKey: 'panels.signatures', icon: 'signature' },\n redaction: { side: 'end', titleKey: 'panels.redaction', icon: 'redactionSidebar' },\n measurement: { side: 'end', titleKey: 'panels.measurement', icon: 'updateScale' },\n // The form designer's sidebar: the document's fields, and what the selected one is.\n 'form-design': { side: 'end', titleKey: 'panels.formDesign', icon: 'formDesign' },\n },\n};\n\n/** The default layout, which the `layout` function gets. */\nexport const defaultLayout = createLayout(DEFAULT_LAYOUT);\n"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAM,QAA2B;CAC/B,IAAI;CACJ,OAAO,CAAC,aAAa;CACrB,YAAY;CACZ,WAAW;AACb;AACA,MAAM,UAA6B;CACjC,IAAI;CACJ,OAAO,CAAC,gBAAgB,cAAc;CACtC,YAAY;CACZ,WAAW;AACb;AAEA,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