@pristy/pristy-libvue 2.21.2 → 3.0.0
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/{ActivityHistory-CYTsXlFs.js → ActivityHistory-CSXt9uFw.js} +2 -2
- package/dist/{ActivityHistory-CYTsXlFs.js.map → ActivityHistory-CSXt9uFw.js.map} +1 -1
- package/dist/{BookmarksComponent-BQRGDBtk.js → BookmarksComponent-DqfEIox4.js} +2 -2
- package/dist/{BookmarksComponent-BQRGDBtk.js.map → BookmarksComponent-DqfEIox4.js.map} +1 -1
- package/dist/{ChartWrapper-NLlDKzgW.js → ChartWrapper-B7VmrsEX.js} +2 -2
- package/dist/{ChartWrapper-NLlDKzgW.js.map → ChartWrapper-B7VmrsEX.js.map} +1 -1
- package/dist/{DisplayFileInDashboardComponent-Ba8OoyfR.js → DisplayFileInDashboardComponent-BAdDKnJN.js} +3 -3
- package/dist/{DisplayFileInDashboardComponent-Ba8OoyfR.js.map → DisplayFileInDashboardComponent-BAdDKnJN.js.map} +1 -1
- package/dist/{ExternalApps-cKv9ZUlp.js → ExternalApps-CQZwIifu.js} +2 -2
- package/dist/{ExternalApps-cKv9ZUlp.js.map → ExternalApps-CQZwIifu.js.map} +1 -1
- package/dist/{FavoriteList-NsYCMz7n.js → FavoriteList-CTY_2bWP.js} +2 -2
- package/dist/{FavoriteList-NsYCMz7n.js.map → FavoriteList-CTY_2bWP.js.map} +1 -1
- package/dist/{MarkdownComponent-q21Q073I.js → MarkdownComponent-DWluCXX2.js} +2 -2
- package/dist/{MarkdownComponent-q21Q073I.js.map → MarkdownComponent-DWluCXX2.js.map} +1 -1
- package/dist/{PDFComponent-CUgH5A5P.js → PDFComponent-DhmdtX95.js} +3 -3
- package/dist/{PDFComponent-CUgH5A5P.js.map → PDFComponent-DhmdtX95.js.map} +1 -1
- package/dist/{PdfConfigService-DZN8iTaP.js → PdfConfigService-huVsU23i.js} +2 -2
- package/dist/{PdfConfigService-DZN8iTaP.js.map → PdfConfigService-huVsU23i.js.map} +1 -1
- package/dist/{PdfToolsComponent-CynQg24K.js → PdfToolsComponent-CXuz7xuL.js} +736 -731
- package/dist/PdfToolsComponent-CXuz7xuL.js.map +1 -0
- package/dist/PlanTreePdfService-Ck4hUN2b.js +76 -0
- package/dist/PlanTreePdfService-Ck4hUN2b.js.map +1 -0
- package/dist/{SearchInput-CbErAaEm.js → SearchInput-57Z8q77p.js} +2 -2
- package/dist/{SearchInput-CbErAaEm.js.map → SearchInput-57Z8q77p.js.map} +1 -1
- package/dist/{UnknownBlockType-BhseESPx.js → UnknownBlockType-BtnOApwP.js} +2 -2
- package/dist/{UnknownBlockType-BhseESPx.js.map → UnknownBlockType-BtnOApwP.js.map} +1 -1
- package/dist/{index-DyssYdtW.js → index-Coh4LtRJ.js} +14496 -11282
- package/dist/index-Coh4LtRJ.js.map +1 -0
- package/dist/pristy-libvue.css +1 -1
- package/dist/pristy-libvue.es.js +204 -185
- package/dist/pristy-libvue.umd.js +24 -23
- package/dist/pristy-libvue.umd.js.map +1 -1
- package/dist/src/AlfrescoApi.d.ts +2 -1
- package/dist/src/AlfrescoApi.d.ts.map +1 -1
- package/dist/src/components/FolderUpload.vue.d.ts +34 -1
- package/dist/src/components/FolderUpload.vue.d.ts.map +1 -1
- package/dist/src/components/IconPickerDialog.vue.d.ts +1 -1
- package/dist/src/components/IndexAwaitOverlay.vue.d.ts +12 -0
- package/dist/src/components/IndexAwaitOverlay.vue.d.ts.map +1 -0
- package/dist/src/components/TreeExplorer.vue.d.ts +6 -1
- package/dist/src/components/TreeExplorer.vue.d.ts.map +1 -1
- package/dist/src/components/UploadStatus.vue.d.ts +34 -1
- package/dist/src/components/UploadStatus.vue.d.ts.map +1 -1
- package/dist/src/components/classification/AdminClassificationPage.vue.d.ts +126 -1
- package/dist/src/components/classification/AdminClassificationPage.vue.d.ts.map +1 -1
- package/dist/src/components/classification/AiSuggestionsPanel.vue.d.ts +12 -0
- package/dist/src/components/classification/AiSuggestionsPanel.vue.d.ts.map +1 -0
- package/dist/src/components/classification/FieldForm.vue.d.ts +1 -0
- package/dist/src/components/classification/FieldForm.vue.d.ts.map +1 -1
- package/dist/src/components/classification/MetadataFormFields.vue.d.ts +42 -1
- package/dist/src/components/classification/MetadataFormFields.vue.d.ts.map +1 -1
- package/dist/src/components/classification/NatureForm.vue.d.ts +2 -0
- package/dist/src/components/classification/NatureForm.vue.d.ts.map +1 -1
- package/dist/src/components/classification/NatureSelector.vue.d.ts +11 -0
- package/dist/src/components/classification/NatureSelector.vue.d.ts.map +1 -1
- package/dist/src/components/classification/PlanInformationPanel.vue.d.ts +58 -0
- package/dist/src/components/classification/PlanInformationPanel.vue.d.ts.map +1 -0
- package/dist/src/components/classification/PlanSuggestInput.vue.d.ts +22 -0
- package/dist/src/components/classification/PlanSuggestInput.vue.d.ts.map +1 -0
- package/dist/src/components/classification/PlanTreePanel.vue.d.ts +47 -0
- package/dist/src/components/classification/PlanTreePanel.vue.d.ts.map +1 -0
- package/dist/src/components/classification/UploadPlanPopup.vue.d.ts +5 -1
- package/dist/src/components/classification/UploadPlanPopup.vue.d.ts.map +1 -1
- package/dist/src/components/dashboard/DashboardAdminPage.vue.d.ts +13 -8
- package/dist/src/components/dashboard/DashboardAdminPage.vue.d.ts.map +1 -1
- package/dist/src/components/dashboard/editor/BlockConfigEditor.vue.d.ts +7 -2
- package/dist/src/components/dashboard/editor/BlockConfigEditor.vue.d.ts.map +1 -1
- package/dist/src/components/dashboard/editor/DashboardEditor.vue.d.ts +13 -8
- package/dist/src/components/dashboard/editor/DashboardEditor.vue.d.ts.map +1 -1
- package/dist/src/components/dashboard/editor/block-configs/ExternalAppsConfig.vue.d.ts +1 -1
- package/dist/src/components/dashboard/editor/grid/BlockTypeSelector.vue.d.ts +1 -1
- package/dist/src/components/dashboard/editor/grid/GridBlock.vue.d.ts +2 -2
- package/dist/src/components/dashboard/editor/grid/GridEditor.vue.d.ts +5 -5
- package/dist/src/components/layouts/AppLayout.vue.d.ts +2 -0
- package/dist/src/components/layouts/AppMobileLayout.vue.d.ts +1 -0
- package/dist/src/components/layouts/AppSidebar.vue.d.ts +1 -0
- package/dist/src/components/layouts/AppSubmenu.vue.d.ts +11 -0
- package/dist/src/components/layouts/AppSubmenu.vue.d.ts.map +1 -1
- package/dist/src/components/layouts/SidebarProfileSection.vue.d.ts.map +1 -1
- package/dist/src/components/navigation/ContentCompactTableView.vue.d.ts +20 -5
- package/dist/src/components/navigation/ContentGridView.vue.d.ts +13 -1
- package/dist/src/components/navigation/ContentGridView.vue.d.ts.map +1 -1
- package/dist/src/components/navigation/ContentTableView.vue.d.ts +20 -5
- package/dist/src/components/navigation/DynamicContentView.vue.d.ts +82 -15
- package/dist/src/components/navigation/DynamicContentView.vue.d.ts.map +1 -1
- package/dist/src/components/navigation/PreviewPanel.vue.d.ts +2 -2
- package/dist/src/components/pdfTools/PdfToolsComponent.vue.d.ts +2 -0
- package/dist/src/components/pdfTools/PdfToolsComponent.vue.d.ts.map +1 -1
- package/dist/src/components/pdfTools/PdfToolsLoading.vue.d.ts +4 -0
- package/dist/src/components/pdfTools/PdfToolsLoading.vue.d.ts.map +1 -0
- package/dist/src/components/popup/CopyOrMovePopup.vue.d.ts +18 -3
- package/dist/src/components/popup/CopyOrMovePopup.vue.d.ts.map +1 -1
- package/dist/src/components/popup/ImportPopupWithWorker.vue.d.ts +69 -3
- package/dist/src/components/popup/ImportPopupWithWorker.vue.d.ts.map +1 -1
- package/dist/src/components/search/AdvancedSearchPanel.vue.d.ts +14 -5
- package/dist/src/components/search/AdvancedSearchPanel.vue.d.ts.map +1 -1
- package/dist/src/components/search/AdvancedViewPanel.vue.d.ts +14 -5
- package/dist/src/components/search/AdvancedViewPanel.vue.d.ts.map +1 -1
- package/dist/src/components/search/SaveViewPopup.vue.d.ts +4 -2
- package/dist/src/components/search/SaveViewPopup.vue.d.ts.map +1 -1
- package/dist/src/components/viewer/AudioPlayer.vue.d.ts +2 -2
- package/dist/src/components/viewer/lazyPdfComponents.d.ts +2 -0
- package/dist/src/components/viewer/lazyPdfComponents.d.ts.map +1 -1
- package/dist/src/components/views/PredefinedViewsPanel.vue.d.ts +1 -1
- package/dist/src/components/views/PredefinedViewsPanel.vue.d.ts.map +1 -1
- package/dist/src/components/workspace/WorkspaceCard.vue.d.ts +148 -1
- package/dist/src/components/workspace/WorkspaceCard.vue.d.ts.map +1 -1
- package/dist/src/components/workspace/WorkspaceList.vue.d.ts +94 -1
- package/dist/src/composables/useClassificationPlan.d.ts.map +1 -1
- package/dist/src/i18n/index.d.ts +252 -4
- package/dist/src/i18n/index.d.ts.map +1 -1
- package/dist/src/index.d.ts +8 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/services/AiImportService.d.ts +125 -0
- package/dist/src/services/AiImportService.d.ts.map +1 -0
- package/dist/src/services/AiMetadataService.d.ts +81 -0
- package/dist/src/services/AiMetadataService.d.ts.map +1 -0
- package/dist/src/services/ClassificationFileService.d.ts +17 -2
- package/dist/src/services/ClassificationFileService.d.ts.map +1 -1
- package/dist/src/services/ClassificationService.d.ts +5 -0
- package/dist/src/services/ClassificationService.d.ts.map +1 -1
- package/dist/src/services/ErrorService.d.ts.map +1 -1
- package/dist/src/services/IndexAwaitService.d.ts +61 -0
- package/dist/src/services/IndexAwaitService.d.ts.map +1 -0
- package/dist/src/services/NodeDragService.d.ts +93 -0
- package/dist/src/services/NodeDragService.d.ts.map +1 -0
- package/dist/src/services/PdfInsertService.d.ts +2 -0
- package/dist/src/services/PdfInsertService.d.ts.map +1 -0
- package/dist/src/services/PlanSuggestService.d.ts +29 -0
- package/dist/src/services/PlanSuggestService.d.ts.map +1 -0
- package/dist/src/services/PlanTreePdfService.d.ts +26 -0
- package/dist/src/services/PlanTreePdfService.d.ts.map +1 -0
- package/dist/src/services/WorkspaceService.d.ts +42 -0
- package/dist/src/services/WorkspaceService.d.ts.map +1 -1
- package/dist/src/stores/aiImport.d.ts +43 -0
- package/dist/src/stores/aiImport.d.ts.map +1 -0
- package/dist/src/stores/indexAwait.d.ts +83 -0
- package/dist/src/stores/indexAwait.d.ts.map +1 -0
- package/dist/src/stores/navigation.d.ts +12 -1
- package/dist/src/stores/navigation.d.ts.map +1 -1
- package/dist/src/stores/upload.d.ts +86 -4
- package/dist/src/stores/upload.d.ts.map +1 -1
- package/dist/src/stores/user.d.ts +23 -5
- package/dist/src/stores/user.d.ts.map +1 -1
- package/dist/src/utils/classificationPlanUtils.d.ts +44 -1
- package/dist/src/utils/classificationPlanUtils.d.ts.map +1 -1
- package/dist/src/utils/indexAwaitReducer.d.ts +56 -0
- package/dist/src/utils/indexAwaitReducer.d.ts.map +1 -0
- package/dist/src/utils/planTree.d.ts +35 -0
- package/dist/src/utils/planTree.d.ts.map +1 -0
- package/dist/src/utils/treeA11y.d.ts +17 -0
- package/dist/src/utils/treeA11y.d.ts.map +1 -0
- package/dist/src/utils/workspaceAppearance.d.ts +16 -0
- package/dist/src/utils/workspaceAppearance.d.ts.map +1 -0
- package/package.json +7 -7
- package/dist/PdfToolsComponent-CynQg24K.js.map +0 -1
- package/dist/index-DyssYdtW.js.map +0 -1
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { ref as v, openBlock as g, createBlock as
|
|
2
|
-
import { PDFName as Pe, PDFHexString as
|
|
3
|
-
import { usePDF as
|
|
4
|
-
import { a as
|
|
1
|
+
import { ref as v, openBlock as g, createBlock as He, unref as r, withCtx as A, createElementVNode as s, toDisplayString as f, createVNode as c, createElementBlock as b, createCommentVNode as D, computed as Te, onMounted as xo, watch as xe, onUnmounted as Eo, resolveDirective as Po, createTextVNode as le, Fragment as Ze, renderList as Qe, withModifiers as ue, normalizeClass as q, normalizeStyle as nt, withDirectives as De, vModelText as rt, withKeys as it, nextTick as ct } from "vue";
|
|
2
|
+
import { PDFName as Pe, PDFHexString as dt, PDFDocument as z, degrees as Co, rgb as xl, RotationTypes as ko, StandardFonts as El } from "pdf-lib";
|
|
3
|
+
import { usePDF as ut, VuePDF as el } from "@tato30/vue-pdf";
|
|
4
|
+
import { a as vt } from "./PdfConfigService-huVsU23i.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { VueDraggableNext as
|
|
7
|
-
import { useI18n as
|
|
6
|
+
import { VueDraggableNext as Io } from "vue-draggable-next";
|
|
7
|
+
import { useI18n as ht } from "vue-i18n";
|
|
8
8
|
import Ue from "primevue/progressspinner";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
9
|
+
import So from "primevue/message";
|
|
10
|
+
import w from "primevue/button";
|
|
11
|
+
import $o from "primevue/checkbox";
|
|
12
|
+
import Be from "primevue/inputtext";
|
|
13
|
+
import ft from "primevue/inputnumber";
|
|
14
|
+
import Ao from "primevue/slider";
|
|
15
|
+
import pt from "primevue/fileupload";
|
|
16
|
+
import mt from "primevue/divider";
|
|
17
|
+
import _o from "primevue/select";
|
|
18
18
|
import ol from "primevue/dialog";
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import { _ as
|
|
25
|
-
const
|
|
19
|
+
import Mo from "primevue/tabs";
|
|
20
|
+
import Fo from "primevue/tablist";
|
|
21
|
+
import ll from "primevue/tab";
|
|
22
|
+
import No from "primevue/tabpanels";
|
|
23
|
+
import tl from "primevue/tabpanel";
|
|
24
|
+
import { _ as bt, T as wt, a as Ee, b as Pl, c as Ro, d as Lo } from "./index-Coh4LtRJ.js";
|
|
25
|
+
const Do = { class: "save-as-form" }, Uo = { class: "form-field" }, Ho = { for: "filename" }, Bo = { class: "form-field" }, Oo = { for: "location" }, Vo = { class: "input-group" }, zo = {
|
|
26
26
|
key: 0,
|
|
27
27
|
class: "explorer-container"
|
|
28
|
-
},
|
|
28
|
+
}, Wo = {
|
|
29
29
|
__name: "SaveAsPopup",
|
|
30
30
|
props: {
|
|
31
31
|
visible: Boolean,
|
|
@@ -39,13 +39,13 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
emits: ["close", "save"],
|
|
42
|
-
setup(P, { emit:
|
|
43
|
-
const { t:
|
|
44
|
-
|
|
45
|
-
},
|
|
42
|
+
setup(P, { emit: T }) {
|
|
43
|
+
const { t: i } = ht(), y = P, U = T, I = v(""), Y = v(null), R = v(!1), h = v(null), F = v(""), x = () => {
|
|
44
|
+
I.value = y.defaultFilename || i("pdfTools.saveAs.defaultFilename"), Y.value = y.parentFolderNode, h.value = y.parentFolderNode?.id, F.value = y.parentFolderNode?.name, R.value = !1;
|
|
45
|
+
}, S = async (m) => {
|
|
46
46
|
if (!(!m || !m.isFolder)) {
|
|
47
47
|
if (m.name === "documentLibrary")
|
|
48
|
-
if (
|
|
48
|
+
if (h.value = m.id, m.parentId)
|
|
49
49
|
try {
|
|
50
50
|
const N = await Ee.getNode(m.parentId);
|
|
51
51
|
F.value = N.properties["cm:title"] || N.name;
|
|
@@ -55,234 +55,256 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
55
55
|
else
|
|
56
56
|
F.value = m.name;
|
|
57
57
|
else
|
|
58
|
-
|
|
58
|
+
h.value = m.id, F.value = m.name;
|
|
59
59
|
R.value = !1;
|
|
60
60
|
}
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
filename:
|
|
64
|
-
folderId:
|
|
61
|
+
}, O = () => {
|
|
62
|
+
h.value && U("save", {
|
|
63
|
+
filename: I.value,
|
|
64
|
+
folderId: h.value
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
|
-
return (m, N) => (g(),
|
|
67
|
+
return (m, N) => (g(), He(r(ol), {
|
|
68
68
|
visible: P.visible,
|
|
69
69
|
modal: "",
|
|
70
70
|
header: m.$t("pdfTools.saveAs.title"),
|
|
71
71
|
class: "dialog-save-as",
|
|
72
72
|
"onUpdate:visible": N[3] || (N[3] = (H) => m.$emit("close")),
|
|
73
|
-
onShow:
|
|
73
|
+
onShow: x
|
|
74
74
|
}, {
|
|
75
|
-
footer:
|
|
76
|
-
|
|
75
|
+
footer: A(() => [
|
|
76
|
+
c(r(w), {
|
|
77
77
|
label: m.$t("pdfTools.common.cancel"),
|
|
78
78
|
icon: "ri-close-line",
|
|
79
79
|
text: "",
|
|
80
80
|
onClick: N[2] || (N[2] = (H) => m.$emit("close"))
|
|
81
81
|
}, null, 8, ["label"]),
|
|
82
|
-
|
|
82
|
+
c(r(w), {
|
|
83
83
|
label: m.$t("pdfTools.common.save"),
|
|
84
84
|
icon: "ri-check-line",
|
|
85
|
-
onClick:
|
|
86
|
-
disabled: !
|
|
85
|
+
onClick: O,
|
|
86
|
+
disabled: !I.value || !h.value
|
|
87
87
|
}, null, 8, ["label", "disabled"])
|
|
88
88
|
]),
|
|
89
|
-
default:
|
|
90
|
-
s("div",
|
|
91
|
-
s("div",
|
|
92
|
-
s("label",
|
|
93
|
-
|
|
89
|
+
default: A(() => [
|
|
90
|
+
s("div", Do, [
|
|
91
|
+
s("div", Uo, [
|
|
92
|
+
s("label", Ho, f(m.$t("pdfTools.saveAs.filenameLabel")), 1),
|
|
93
|
+
c(r(Be), {
|
|
94
94
|
id: "filename",
|
|
95
|
-
modelValue:
|
|
96
|
-
"onUpdate:modelValue": N[0] || (N[0] = (H) =>
|
|
95
|
+
modelValue: I.value,
|
|
96
|
+
"onUpdate:modelValue": N[0] || (N[0] = (H) => I.value = H)
|
|
97
97
|
}, null, 8, ["modelValue"])
|
|
98
98
|
]),
|
|
99
|
-
s("div",
|
|
100
|
-
s("label",
|
|
101
|
-
s("div",
|
|
102
|
-
|
|
99
|
+
s("div", Bo, [
|
|
100
|
+
s("label", Oo, f(m.$t("pdfTools.saveAs.folderLabel")), 1),
|
|
101
|
+
s("div", Vo, [
|
|
102
|
+
c(r(Be), {
|
|
103
103
|
id: "location",
|
|
104
104
|
readonly: "",
|
|
105
105
|
value: F.value
|
|
106
106
|
}, null, 8, ["value"]),
|
|
107
|
-
|
|
107
|
+
c(r(w), {
|
|
108
108
|
icon: R.value ? "ri-arrow-up-s-line" : "ri-arrow-down-s-line",
|
|
109
109
|
label: m.$t("pdfTools.saveAs.browse"),
|
|
110
110
|
onClick: N[1] || (N[1] = (H) => R.value = !R.value)
|
|
111
111
|
}, null, 8, ["icon", "label"])
|
|
112
112
|
])
|
|
113
113
|
]),
|
|
114
|
-
R.value ? (g(),
|
|
115
|
-
|
|
114
|
+
R.value ? (g(), b("div", zo, [
|
|
115
|
+
c(wt, {
|
|
116
116
|
"current-node": Y.value,
|
|
117
117
|
"show-user-home": "",
|
|
118
118
|
"show-files": !1,
|
|
119
|
-
onSelectNode:
|
|
119
|
+
onSelectNode: S
|
|
120
120
|
}, null, 8, ["current-node"])
|
|
121
|
-
])) :
|
|
121
|
+
])) : D("", !0)
|
|
122
122
|
])
|
|
123
123
|
]),
|
|
124
124
|
_: 1
|
|
125
125
|
}, 8, ["visible", "header"]));
|
|
126
126
|
}
|
|
127
|
-
},
|
|
128
|
-
const
|
|
129
|
-
if (!
|
|
127
|
+
}, Go = /* @__PURE__ */ bt(Wo, [["__scopeId", "data-v-c9e02fa9"]]), Xo = [1, 0.92, 0.23], Yo = 4, jo = ({ doc: P, page: T, rect: i, text: y, title: U }) => {
|
|
128
|
+
const I = String(y ?? "");
|
|
129
|
+
if (!I.trim())
|
|
130
130
|
return;
|
|
131
131
|
const Y = P.context.obj({
|
|
132
132
|
Type: "Annot",
|
|
133
133
|
Subtype: "Text",
|
|
134
134
|
// Icon used by the viewer for this note
|
|
135
135
|
Name: "Comment",
|
|
136
|
-
Rect: [
|
|
136
|
+
Rect: [i.x, i.y, i.x + i.size, i.y + i.size],
|
|
137
137
|
// fromText encodes as UTF-16BE: a plain string would break accents
|
|
138
|
-
Contents:
|
|
139
|
-
T:
|
|
140
|
-
C:
|
|
141
|
-
F:
|
|
138
|
+
Contents: dt.fromText(I),
|
|
139
|
+
T: dt.fromText(String(U ?? "")),
|
|
140
|
+
C: Xo,
|
|
141
|
+
F: Yo
|
|
142
142
|
});
|
|
143
|
-
|
|
144
|
-
},
|
|
145
|
-
const
|
|
146
|
-
if (!
|
|
143
|
+
T.node.addAnnot(P.context.register(Y));
|
|
144
|
+
}, Ko = (P) => {
|
|
145
|
+
const T = P.node.Annots();
|
|
146
|
+
if (!T)
|
|
147
147
|
return [];
|
|
148
|
-
const
|
|
149
|
-
for (let
|
|
150
|
-
const
|
|
151
|
-
if (
|
|
148
|
+
const i = [];
|
|
149
|
+
for (let y = 0; y < T.size(); y++) {
|
|
150
|
+
const U = T.lookup(y);
|
|
151
|
+
if (U?.get(Pe.of("Subtype")) !== Pe.of("Text"))
|
|
152
152
|
continue;
|
|
153
|
-
const
|
|
154
|
-
if (!
|
|
153
|
+
const I = U.get(Pe.of("Rect"))?.asRectangle();
|
|
154
|
+
if (!I)
|
|
155
155
|
continue;
|
|
156
|
-
const Y =
|
|
157
|
-
|
|
158
|
-
x:
|
|
159
|
-
y:
|
|
160
|
-
size: Math.max(
|
|
156
|
+
const Y = U.get(Pe.of("Contents"));
|
|
157
|
+
i.push({
|
|
158
|
+
x: I.x,
|
|
159
|
+
y: I.y,
|
|
160
|
+
size: Math.max(I.width, I.height),
|
|
161
161
|
text: typeof Y?.decodeText == "function" ? Y.decodeText() : ""
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
|
-
return
|
|
165
|
-
},
|
|
166
|
-
const
|
|
167
|
-
if (
|
|
168
|
-
for (let
|
|
169
|
-
|
|
170
|
-
},
|
|
164
|
+
return i;
|
|
165
|
+
}, qo = (P) => {
|
|
166
|
+
const T = P.node.Annots();
|
|
167
|
+
if (T)
|
|
168
|
+
for (let i = T.size() - 1; i >= 0; i--)
|
|
169
|
+
T.lookup(i)?.get(Pe.of("Subtype")) === Pe.of("Text") && T.remove(i);
|
|
170
|
+
}, gt = (P) => {
|
|
171
|
+
if (!P)
|
|
172
|
+
return null;
|
|
173
|
+
const T = P.trim();
|
|
174
|
+
if (/^[0-9a-fA-F-]{20,}$/.test(T))
|
|
175
|
+
return T;
|
|
176
|
+
const i = T.match(/workspace:\/\/SpacesStore\/([0-9a-fA-F-]{20,})/);
|
|
177
|
+
if (i && i[1])
|
|
178
|
+
return i[1];
|
|
179
|
+
const y = T.match(
|
|
180
|
+
/\b(nodes|preview|renditions|content)\/?([0-9a-fA-F-]{20,})\b/
|
|
181
|
+
);
|
|
182
|
+
if (y && y[2])
|
|
183
|
+
return y[2];
|
|
184
|
+
const U = T.match(
|
|
185
|
+
/#\/(?:pdf-tools|consultation-pdf|edit-collabora)\/([0-9a-fA-F-]{20,})/
|
|
186
|
+
);
|
|
187
|
+
if (U && U[1])
|
|
188
|
+
return U[1];
|
|
189
|
+
const I = T.match(/([0-9a-fA-F]{20,})/);
|
|
190
|
+
return I && I[1] ? I[1] : null;
|
|
191
|
+
}, Jo = 72, Zo = 200, Qo = 16e6, ea = async ({
|
|
171
192
|
pdfPage: P,
|
|
172
|
-
redactions:
|
|
173
|
-
dpi:
|
|
174
|
-
quality:
|
|
175
|
-
mimeType:
|
|
176
|
-
maxPixels:
|
|
193
|
+
redactions: T = [],
|
|
194
|
+
dpi: i = Zo,
|
|
195
|
+
quality: y = 0.85,
|
|
196
|
+
mimeType: U = "image/jpeg",
|
|
197
|
+
maxPixels: I = Qo,
|
|
177
198
|
createCanvas: Y = () => document.createElement("canvas")
|
|
178
199
|
}) => {
|
|
179
|
-
let R =
|
|
180
|
-
const
|
|
181
|
-
F >
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
const
|
|
185
|
-
if (await P.render({ canvasContext:
|
|
186
|
-
|
|
187
|
-
for (const m of
|
|
188
|
-
|
|
189
|
-
m.x *
|
|
190
|
-
m.y *
|
|
191
|
-
m.w *
|
|
192
|
-
m.h *
|
|
200
|
+
let R = i / Jo;
|
|
201
|
+
const h = P.getViewport({ scale: R }), F = h.width * h.height;
|
|
202
|
+
F > I && (R = Math.floor(R * Math.sqrt(I / F) * 1e4) / 1e4);
|
|
203
|
+
const x = P.getViewport({ scale: R }), S = Y();
|
|
204
|
+
S.width = Math.floor(x.width), S.height = Math.floor(x.height);
|
|
205
|
+
const O = S.getContext("2d");
|
|
206
|
+
if (await P.render({ canvasContext: O, viewport: x }).promise, T.length > 0) {
|
|
207
|
+
O.fillStyle = "#000000";
|
|
208
|
+
for (const m of T)
|
|
209
|
+
O.fillRect(
|
|
210
|
+
m.x * S.width,
|
|
211
|
+
m.y * S.height,
|
|
212
|
+
m.w * S.width,
|
|
213
|
+
m.h * S.height
|
|
193
214
|
);
|
|
194
215
|
}
|
|
195
|
-
return
|
|
196
|
-
}, al = 1.2,
|
|
197
|
-
const
|
|
216
|
+
return S.toDataURL(U, y);
|
|
217
|
+
}, al = 1.2, la = 8, ta = ({ overlayWidth: P, pageWidthPt: T }) => !T || !P ? 1 : P / T, Cl = (P) => String(P ?? "").split(/\r?\n/), oa = ({ lines: P, fontSize: T, measureLine: i }) => {
|
|
218
|
+
const y = P.map((U) => i(U));
|
|
198
219
|
return {
|
|
199
|
-
w: Math.max(
|
|
200
|
-
h: P.length *
|
|
220
|
+
w: Math.max(la, ...y),
|
|
221
|
+
h: P.length * T * al
|
|
201
222
|
};
|
|
202
|
-
},
|
|
223
|
+
}, aa = ({ topY: P, lineIndex: T, fontSize: i, ascentPt: y }) => P - T * i * al - y, sa = { class: "pdf-tools-page" }, na = { class: "pdf-tools-header" }, ra = { key: 0 }, ia = {
|
|
203
224
|
key: 0,
|
|
204
225
|
class: "loading-container"
|
|
205
|
-
},
|
|
226
|
+
}, ca = {
|
|
206
227
|
key: 1,
|
|
207
228
|
class: "error-container"
|
|
208
|
-
},
|
|
229
|
+
}, da = {
|
|
209
230
|
key: 2,
|
|
210
231
|
class: "pdf-editor-layout"
|
|
211
|
-
},
|
|
232
|
+
}, ua = { class: "pdf-tools-sidebar" }, va = { class: "card" }, fa = { class: "sidebar-form" }, pa = { class: "form-field" }, ma = { class: "form-field form-field--spaced" }, ga = { class: "form-field form-field--spaced" }, ya = { class: "insert-buttons" }, ha = { class: "form-field form-field--spaced" }, ba = { class: "watermark-grid" }, wa = { class: "pdf-preview-container" }, Ta = ["onClick", "onDblclick"], xa = { class: "page-selection" }, Ea = { class: "page-actions" }, Pa = { class: "thumbnail-content" }, Ca = { class: "page-number" }, ka = { class: "dialog-header" }, Ia = { class: "page-editor-toolbar" }, Sa = { class: "zoom-indicator" }, $a = { class: "editor-layout" }, Aa = { class: "tool-group" }, _a = {
|
|
212
233
|
key: 0,
|
|
213
234
|
class: "text-settings"
|
|
214
|
-
},
|
|
235
|
+
}, Ma = { class: "form-field" }, Fa = { class: "form-label" }, Na = { class: "form-field" }, Ra = {
|
|
215
236
|
class: "form-label",
|
|
216
237
|
for: "text-size-slider"
|
|
217
|
-
},
|
|
238
|
+
}, La = { class: "form-field" }, Da = {
|
|
218
239
|
class: "form-label",
|
|
219
240
|
id: "text-color-label"
|
|
220
|
-
},
|
|
241
|
+
}, Ua = {
|
|
221
242
|
class: "color-swatches",
|
|
222
243
|
role: "group",
|
|
223
244
|
"aria-labelledby": "text-color-label"
|
|
224
|
-
},
|
|
245
|
+
}, Ha = ["aria-label", "aria-pressed", "onClick"], Ba = { class: "color-custom" }, Oa = ["aria-label", "placeholder", "onKeydown"], Va = { class: "editor-footer" }, za = { class: "dialog-header" }, Wa = { class: "signature-pad" }, Ga = { class: "dialog-footer-buttons" }, Xa = { class: "search-input-group" }, Ya = {
|
|
225
246
|
key: 0,
|
|
226
247
|
class: "inline-status"
|
|
227
|
-
},
|
|
248
|
+
}, ja = {
|
|
228
249
|
key: 1,
|
|
229
250
|
class: "text-muted"
|
|
230
|
-
},
|
|
251
|
+
}, Ka = {
|
|
231
252
|
key: 2,
|
|
232
253
|
class: "favorites-layout"
|
|
233
|
-
},
|
|
254
|
+
}, qa = { class: "favorites-list" }, Ja = ["onClick"], Za = { class: "item-content" }, Qa = { class: "text-ellipsis" }, es = { class: "favorites-preview" }, ls = {
|
|
234
255
|
key: 0,
|
|
235
256
|
class: "preview-placeholder"
|
|
236
|
-
},
|
|
257
|
+
}, ts = { class: "text-muted" }, os = {
|
|
237
258
|
key: 1,
|
|
238
259
|
class: "preview-placeholder"
|
|
239
|
-
},
|
|
260
|
+
}, as = { class: "text-muted" }, ss = {
|
|
240
261
|
key: 2,
|
|
241
262
|
class: "preview-wrapper"
|
|
242
|
-
},
|
|
263
|
+
}, ns = {
|
|
243
264
|
key: 0,
|
|
244
265
|
class: "preview-controls"
|
|
245
|
-
},
|
|
266
|
+
}, rs = { class: "page-info" }, is = { class: "preview-content" }, cs = {
|
|
246
267
|
key: 0,
|
|
247
268
|
class: "inline-status"
|
|
248
|
-
},
|
|
269
|
+
}, ds = {
|
|
249
270
|
key: 1,
|
|
250
271
|
class: "text-muted"
|
|
251
|
-
},
|
|
272
|
+
}, us = {
|
|
252
273
|
key: 2,
|
|
253
274
|
class: "favorites-layout"
|
|
254
|
-
},
|
|
275
|
+
}, vs = { class: "favorites-list" }, fs = ["onClick"], ps = { class: "item-content" }, ms = { class: "text-ellipsis" }, gs = { class: "favorites-preview" }, ys = {
|
|
255
276
|
key: 0,
|
|
256
277
|
class: "preview-placeholder"
|
|
257
|
-
},
|
|
278
|
+
}, hs = { class: "text-muted" }, bs = {
|
|
258
279
|
key: 1,
|
|
259
280
|
class: "preview-placeholder"
|
|
260
|
-
},
|
|
281
|
+
}, ws = { class: "text-muted" }, Ts = {
|
|
261
282
|
key: 2,
|
|
262
283
|
class: "preview-wrapper"
|
|
263
|
-
},
|
|
284
|
+
}, xs = {
|
|
264
285
|
key: 0,
|
|
265
286
|
class: "preview-controls"
|
|
266
|
-
},
|
|
287
|
+
}, Es = { class: "page-info" }, Ps = { class: "preview-content" }, Cs = { class: "sidebar-form" }, ks = { class: "form-field" }, Is = { for: "alfrescoNodeId" }, Ss = { class: "form-hint" }, $s = { class: "insert-footer" }, As = { class: "insert-footer-info" }, _s = {
|
|
267
288
|
key: 0,
|
|
268
289
|
class: "selected-info"
|
|
269
|
-
},
|
|
290
|
+
}, Ms = { class: "selected-label" }, Fs = { class: "selected-name" }, Ns = {
|
|
270
291
|
key: 1,
|
|
271
292
|
class: "error-msg"
|
|
272
|
-
},
|
|
293
|
+
}, Rs = { class: "insert-footer-actions" }, yt = 24, Ls = {
|
|
273
294
|
__name: "PdfToolsComponent",
|
|
274
295
|
props: {
|
|
275
296
|
toast: { type: Object, required: !0 },
|
|
276
297
|
id: { type: String, required: !0 },
|
|
277
298
|
// The host application decides where closing leads, so the button is only
|
|
278
299
|
// offered when it opts in and handles the event
|
|
279
|
-
closable: { type: Boolean, default: !1 }
|
|
300
|
+
closable: { type: Boolean, default: !1 },
|
|
301
|
+
insertIds: { type: Array, default: () => [] }
|
|
280
302
|
},
|
|
281
303
|
emits: ["close"],
|
|
282
|
-
setup(P, { emit:
|
|
283
|
-
const { t:
|
|
284
|
-
|
|
285
|
-
}, R = v(null),
|
|
304
|
+
setup(P, { emit: T }) {
|
|
305
|
+
const { t: i } = ht(), y = P, U = T, I = v(!1), Y = () => {
|
|
306
|
+
I.value && !window.confirm(i("pdfTools.closeUnsaved")) || U("close");
|
|
307
|
+
}, R = v(null), h = v(null), F = v([]), x = v(!0), S = v(null), O = v(null), m = v([]), N = v(!1), H = v(null), Q = v(1), d = {
|
|
286
308
|
SELECT: "select",
|
|
287
309
|
REDACT: "redact",
|
|
288
310
|
HIGHLIGHT: "highlight",
|
|
@@ -290,7 +312,7 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
290
312
|
IMAGE: "image",
|
|
291
313
|
SIGNATURE: "signature",
|
|
292
314
|
TEXT: "text"
|
|
293
|
-
},
|
|
315
|
+
}, k = v(d.SELECT), p = v([]), Ce = v(null), ke = v(null), kl = v(null), B = v(null), Il = v(null), $ = v({
|
|
294
316
|
visible: !1,
|
|
295
317
|
tool: null,
|
|
296
318
|
x: 0,
|
|
@@ -298,12 +320,12 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
298
320
|
value: "",
|
|
299
321
|
index: -1
|
|
300
322
|
}), ve = v(!1), fe = v(null);
|
|
301
|
-
let sl = !1,
|
|
302
|
-
const Ie = v(""), nl = v(-45), Se = v(5),
|
|
323
|
+
let sl = !1, Oe = null, pe = !1, te = null;
|
|
324
|
+
const Ie = v(""), nl = v(-45), Se = v(5), Tt = [
|
|
303
325
|
{ label: "Helvetica", value: "Helvetica" },
|
|
304
326
|
{ label: "Times New Roman", value: "TimesRoman" },
|
|
305
327
|
{ label: "Courier", value: "Courier" }
|
|
306
|
-
],
|
|
328
|
+
], xt = [
|
|
307
329
|
{ name: "black", value: "#000000" },
|
|
308
330
|
{ name: "white", value: "#ffffff" },
|
|
309
331
|
{ name: "red", value: "#e53935" },
|
|
@@ -312,36 +334,36 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
312
334
|
{ name: "green", value: "#43a047" },
|
|
313
335
|
{ name: "blue", value: "#1e88e5" },
|
|
314
336
|
{ name: "purple", value: "#8e24aa" }
|
|
315
|
-
], ae = v("Helvetica"), oe = v(18), J = v("#000000"),
|
|
316
|
-
|
|
317
|
-
const e =
|
|
318
|
-
e ?
|
|
337
|
+
], ae = v("Helvetica"), oe = v(18), J = v("#000000"), Et = v(null), Ve = v(!1), Sl = v(null), $l = v(""), ze = v(""), We = v(null), Ge = v(null), $e = v(!1), se = v(""), ne = v(""), V = v(null), Pt = Te(() => se.value && gt(se.value) ? !0 : !!(V.value && V.value.id)), Ae = v(""), me = v([]), rl = v(!1), Al = v(!1), _e = v([]), Xe = v(!1), Ye = v(!1), ge = v(null), { pdf: Me } = ut(vt(ge)), X = v(1), j = v(0), ye = v(null), { pdf: je, pages: _l } = ut(vt(ye));
|
|
338
|
+
xo(() => {
|
|
339
|
+
const e = y.id;
|
|
340
|
+
e ? kt(e).then(Lt) : (S.value = i("pdfTools.loadError"), x.value = !1);
|
|
319
341
|
});
|
|
320
|
-
const
|
|
321
|
-
|
|
342
|
+
const Ml = (e) => m.value.some((l) => l.pageIndex === e.pageIndex), Ct = (e) => {
|
|
343
|
+
O.value = e;
|
|
322
344
|
const l = m.value.findIndex(
|
|
323
345
|
(o) => o.pageIndex === e.pageIndex
|
|
324
346
|
);
|
|
325
347
|
l > -1 ? m.value.splice(l, 1) : m.value.push(e);
|
|
326
|
-
},
|
|
327
|
-
|
|
348
|
+
}, kt = async (e) => {
|
|
349
|
+
x.value = !0, S.value = null;
|
|
328
350
|
try {
|
|
329
351
|
const l = await Ee.getNode(e);
|
|
330
|
-
|
|
352
|
+
We.value = l, Et.value = l.parentId, ze.value = l && (l.name || l.properties && l.properties["cm:name"]) || "";
|
|
331
353
|
const o = Pl.getContentUrl(e);
|
|
332
354
|
ye.value = o;
|
|
333
355
|
const t = await fetch(o);
|
|
334
356
|
if (!t.ok)
|
|
335
357
|
throw new Error(`HTTP error! status: ${t.status}`);
|
|
336
358
|
const n = await t.arrayBuffer();
|
|
337
|
-
|
|
359
|
+
h.value = new Uint8Array(n), await Fl(h.value), F.value.length > 0 && (O.value = F.value[0]);
|
|
338
360
|
} catch (l) {
|
|
339
|
-
console.error("Error loading PDF from Alfresco:", l),
|
|
361
|
+
console.error("Error loading PDF from Alfresco:", l), S.value = i("pdfTools.loadError");
|
|
340
362
|
} finally {
|
|
341
|
-
|
|
363
|
+
x.value = !1;
|
|
342
364
|
}
|
|
343
|
-
},
|
|
344
|
-
R.value = await
|
|
365
|
+
}, Fl = async (e) => {
|
|
366
|
+
R.value = await z.load(e);
|
|
345
367
|
const l = R.value.getPageCount();
|
|
346
368
|
F.value = Array.from({ length: l }, (o, t) => ({
|
|
347
369
|
pageIndex: t,
|
|
@@ -349,127 +371,106 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
349
371
|
}));
|
|
350
372
|
}, re = async (e, { updatePages: l = !0 } = {}) => {
|
|
351
373
|
const o = await e.save();
|
|
352
|
-
|
|
374
|
+
h.value = o, I.value = !0;
|
|
353
375
|
const t = new Blob([o], { type: "application/pdf" });
|
|
354
|
-
ye.value && ye.value.startsWith("blob:") && URL.revokeObjectURL(ye.value), ye.value = URL.createObjectURL(t), l && await
|
|
355
|
-
},
|
|
356
|
-
if (
|
|
357
|
-
|
|
376
|
+
ye.value && ye.value.startsWith("blob:") && URL.revokeObjectURL(ye.value), ye.value = URL.createObjectURL(t), l && await Fl(o);
|
|
377
|
+
}, It = async () => {
|
|
378
|
+
if (h.value) {
|
|
379
|
+
x.value = !0;
|
|
358
380
|
try {
|
|
359
|
-
const e = await
|
|
381
|
+
const e = await z.create(), l = F.value.map((n) => n.pageIndex), o = await z.load(h.value);
|
|
360
382
|
(await e.copyPages(o, l)).forEach((n) => e.addPage(n)), await re(e);
|
|
361
383
|
} catch (e) {
|
|
362
|
-
console.error("Error reordering pages:", e),
|
|
384
|
+
console.error("Error reordering pages:", e), S.value = i("pdfTools.reorderError");
|
|
363
385
|
} finally {
|
|
364
|
-
|
|
386
|
+
x.value = !1;
|
|
365
387
|
}
|
|
366
388
|
}
|
|
367
|
-
},
|
|
368
|
-
if (
|
|
369
|
-
|
|
389
|
+
}, St = async (e) => {
|
|
390
|
+
if (h.value) {
|
|
391
|
+
x.value = !0;
|
|
370
392
|
try {
|
|
371
|
-
const l = await
|
|
393
|
+
const l = await z.load(h.value), o = l.getPage(e.pageIndex), t = o.getRotation().angle;
|
|
372
394
|
o.setRotation({
|
|
373
|
-
type:
|
|
395
|
+
type: ko.Degrees,
|
|
374
396
|
angle: (t + 90) % 360
|
|
375
397
|
}), await re(l, { updatePages: !1 });
|
|
376
398
|
} catch (l) {
|
|
377
|
-
console.error("Error rotating page:", l),
|
|
399
|
+
console.error("Error rotating page:", l), S.value = i("pdfTools.rotateError");
|
|
378
400
|
} finally {
|
|
379
|
-
|
|
401
|
+
x.value = !1;
|
|
380
402
|
}
|
|
381
403
|
}
|
|
382
|
-
},
|
|
383
|
-
if (m.value.length === 0 || !
|
|
404
|
+
}, $t = async () => {
|
|
405
|
+
if (m.value.length === 0 || !h.value)
|
|
384
406
|
return null;
|
|
385
|
-
const e = await
|
|
407
|
+
const e = await z.create(), l = await z.load(h.value), o = m.value.map((n) => n.pageIndex).sort((n, a) => n - a);
|
|
386
408
|
return (await e.copyPages(l, o)).forEach((n) => e.addPage(n)), await e.save();
|
|
387
|
-
},
|
|
388
|
-
if (!(!
|
|
409
|
+
}, At = async () => {
|
|
410
|
+
if (!(!h.value || m.value.length === 0)) {
|
|
389
411
|
if (m.value.length === F.value.length) {
|
|
390
|
-
|
|
412
|
+
y.toast.add({
|
|
391
413
|
severity: "warn",
|
|
392
|
-
summary:
|
|
393
|
-
detail:
|
|
414
|
+
summary: i("pdfTools.common.warning"),
|
|
415
|
+
detail: i("pdfTools.deleteAllPagesWarning"),
|
|
394
416
|
life: 3e3
|
|
395
417
|
});
|
|
396
418
|
return;
|
|
397
419
|
}
|
|
398
|
-
|
|
420
|
+
x.value = !0;
|
|
399
421
|
try {
|
|
400
|
-
const e = await
|
|
422
|
+
const e = await z.load(h.value), l = e.getPageCount(), o = new Set(m.value.map((u) => u.pageIndex)), t = [];
|
|
401
423
|
for (let u = 0; u < l; u++)
|
|
402
424
|
o.has(u) || t.push(u);
|
|
403
|
-
const n = await
|
|
404
|
-
(await n.copyPages(e, t)).forEach((u) => n.addPage(u)), await re(n), m.value = [],
|
|
425
|
+
const n = await z.create();
|
|
426
|
+
(await n.copyPages(e, t)).forEach((u) => n.addPage(u)), await re(n), m.value = [], y.toast.add({
|
|
405
427
|
severity: "success",
|
|
406
|
-
summary:
|
|
407
|
-
detail:
|
|
428
|
+
summary: i("pdfTools.common.deleted"),
|
|
429
|
+
detail: i("pdfTools.pagesDeletedSuccess"),
|
|
408
430
|
life: 3e3
|
|
409
431
|
});
|
|
410
432
|
} catch (e) {
|
|
411
|
-
console.error("Error deleting pages:", e),
|
|
433
|
+
console.error("Error deleting pages:", e), S.value = i("pdfTools.deletePagesError");
|
|
412
434
|
} finally {
|
|
413
|
-
|
|
435
|
+
x.value = !1;
|
|
414
436
|
}
|
|
415
437
|
}
|
|
416
|
-
}, $t = async () => {
|
|
417
|
-
se.value = "", B.value = null, ne.value = "", $e.value = !0;
|
|
418
|
-
}, At = (e) => {
|
|
419
|
-
e === 2 && _e.value.length === 0 && !Ge.value && Ft();
|
|
420
438
|
}, _t = async () => {
|
|
439
|
+
se.value = "", V.value = null, ne.value = "", $e.value = !0;
|
|
440
|
+
}, Mt = (e) => {
|
|
441
|
+
e === 2 && _e.value.length === 0 && !Xe.value && Rt();
|
|
442
|
+
}, Ft = async () => {
|
|
421
443
|
let e = null;
|
|
422
|
-
if (
|
|
423
|
-
|
|
444
|
+
if (V.value?.id ? e = V.value.id : se.value && (e = gt(se.value)), !e) {
|
|
445
|
+
y.toast.add({
|
|
424
446
|
severity: "warn",
|
|
425
|
-
summary:
|
|
426
|
-
detail:
|
|
447
|
+
summary: i("pdfTools.common.warning"),
|
|
448
|
+
detail: i("pdfTools.insertFromAlfresco.invalidInput"),
|
|
427
449
|
life: 3e3
|
|
428
450
|
});
|
|
429
451
|
return;
|
|
430
452
|
}
|
|
431
|
-
await
|
|
432
|
-
}, Fl = (e) => {
|
|
433
|
-
if (!e)
|
|
434
|
-
return null;
|
|
435
|
-
const l = e.trim();
|
|
436
|
-
if (/^[0-9a-fA-F-]{20,}$/.test(l))
|
|
437
|
-
return l;
|
|
438
|
-
const o = l.match(/workspace:\/\/SpacesStore\/([0-9a-fA-F-]{20,})/);
|
|
439
|
-
if (o && o[1])
|
|
440
|
-
return o[1];
|
|
441
|
-
const t = l.match(
|
|
442
|
-
/\b(nodes|preview|renditions|content)\/?([0-9a-fA-F-]{20,})\b/
|
|
443
|
-
);
|
|
444
|
-
if (t && t[2])
|
|
445
|
-
return t[2];
|
|
446
|
-
const n = l.match(
|
|
447
|
-
/#\/(?:pdf-tools|consultation-pdf|edit-collabora)\/([0-9a-fA-F-]{20,})/
|
|
448
|
-
);
|
|
449
|
-
if (n && n[1])
|
|
450
|
-
return n[1];
|
|
451
|
-
const a = l.match(/([0-9a-fA-F]{20,})/);
|
|
452
|
-
return a && a[1] ? a[1] : null;
|
|
453
|
+
await Dl(e), $e.value = !1;
|
|
453
454
|
}, il = async (e) => {
|
|
454
|
-
if (e?.content?.mimeType === "application/pdf" && (
|
|
455
|
-
|
|
455
|
+
if (e?.content?.mimeType === "application/pdf" && (V.value = e, ne.value = "", e?.id)) {
|
|
456
|
+
Ye.value = !0, X.value = 1, j.value = 0;
|
|
456
457
|
try {
|
|
457
458
|
const l = Pl.getContentUrl(e.id);
|
|
458
459
|
ge.value && ge.value.startsWith("blob:") && URL.revokeObjectURL(ge.value), ge.value = l;
|
|
459
460
|
} catch (l) {
|
|
460
461
|
console.error("Error loading PDF preview:", l), ge.value = null;
|
|
461
462
|
} finally {
|
|
462
|
-
|
|
463
|
+
Ye.value = !1;
|
|
463
464
|
}
|
|
464
465
|
}
|
|
465
466
|
}, Nl = () => {
|
|
466
467
|
X.value < j.value && X.value++;
|
|
467
468
|
}, Rl = () => {
|
|
468
469
|
X.value > 1 && X.value--;
|
|
469
|
-
},
|
|
470
|
-
ne.value = "", e.isFolder ? (
|
|
470
|
+
}, Nt = (e) => {
|
|
471
|
+
ne.value = "", e.isFolder ? (V.value = null, ne.value = i(
|
|
471
472
|
"pdfTools.insertFromAlfresco.folderSelectError"
|
|
472
|
-
)) : e.content?.mimeType !== "application/pdf" ? (
|
|
473
|
+
)) : e.content?.mimeType !== "application/pdf" ? (V.value = null, ne.value = i(
|
|
473
474
|
"pdfTools.insertFromAlfresco.fileTypeNotAllowedError"
|
|
474
475
|
)) : il(e);
|
|
475
476
|
}, Ll = async () => {
|
|
@@ -479,7 +480,7 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
479
480
|
}
|
|
480
481
|
rl.value = !0;
|
|
481
482
|
try {
|
|
482
|
-
const e =
|
|
483
|
+
const e = Ro();
|
|
483
484
|
await e.queryStore(Ae.value);
|
|
484
485
|
const l = e.entries.map((o) => o.entry || o);
|
|
485
486
|
me.value = l.filter(
|
|
@@ -490,67 +491,70 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
490
491
|
} finally {
|
|
491
492
|
rl.value = !1;
|
|
492
493
|
}
|
|
493
|
-
},
|
|
494
|
-
|
|
494
|
+
}, Rt = async () => {
|
|
495
|
+
Xe.value = !0;
|
|
495
496
|
try {
|
|
496
|
-
const e =
|
|
497
|
+
const e = Lo();
|
|
497
498
|
await e.loadFavorites(), _e.value = e.fileFavorites.filter(
|
|
498
499
|
(l) => l?.target?.file?.content?.mimeType === "application/pdf"
|
|
499
500
|
).map((l) => l.target.file);
|
|
500
501
|
} catch (e) {
|
|
501
502
|
console.error("loadFavorites error:", e), _e.value = [];
|
|
502
503
|
} finally {
|
|
503
|
-
|
|
504
|
+
Xe.value = !1;
|
|
504
505
|
}
|
|
505
|
-
},
|
|
506
|
-
if (
|
|
507
|
-
|
|
506
|
+
}, Dl = async (e) => {
|
|
507
|
+
if (h.value) {
|
|
508
|
+
x.value = !0;
|
|
508
509
|
try {
|
|
509
510
|
if ((await Ee.getNode(e)).content?.mimeType !== "application/pdf")
|
|
510
|
-
throw new Error(
|
|
511
|
-
const t = await (await Ee.getNodeContent(e)).arrayBuffer(), n = new Uint8Array(t), a = await
|
|
512
|
-
(await a.copyPages(u,
|
|
511
|
+
throw new Error(i("pdfTools.invalidNodeForInsert"));
|
|
512
|
+
const t = await (await Ee.getNodeContent(e)).arrayBuffer(), n = new Uint8Array(t), a = await z.load(h.value), u = await z.load(n), E = u.getPageCount(), C = Array.from({ length: E }, (L, be) => be);
|
|
513
|
+
(await a.copyPages(u, C)).forEach((L) => a.addPage(L)), await re(a), m.value = [], y.toast.add({
|
|
513
514
|
severity: "success",
|
|
514
|
-
summary:
|
|
515
|
-
detail:
|
|
515
|
+
summary: i("pdfTools.common.success"),
|
|
516
|
+
detail: i("pdfTools.insertFromPristySuccess", { count: E }),
|
|
516
517
|
life: 3e3
|
|
517
518
|
});
|
|
518
519
|
} catch (l) {
|
|
519
|
-
console.error("Error inserting from Alfresco:", l),
|
|
520
|
+
console.error("Error inserting from Alfresco:", l), S.value = l?.message || i("pdfTools.insertFromPristyError"), y.toast.add({
|
|
520
521
|
severity: "error",
|
|
521
|
-
summary:
|
|
522
|
-
detail:
|
|
522
|
+
summary: i("pdfTools.common.error"),
|
|
523
|
+
detail: S.value,
|
|
523
524
|
life: 4e3
|
|
524
525
|
});
|
|
525
526
|
} finally {
|
|
526
|
-
|
|
527
|
+
x.value = !1;
|
|
527
528
|
}
|
|
528
529
|
}
|
|
529
|
-
},
|
|
530
|
+
}, Lt = async () => {
|
|
531
|
+
for (const e of y.insertIds)
|
|
532
|
+
await Dl(e);
|
|
533
|
+
}, Dt = async (e) => {
|
|
530
534
|
const l = e.files?.[0];
|
|
531
|
-
l && await
|
|
532
|
-
},
|
|
533
|
-
if (
|
|
534
|
-
|
|
535
|
+
l && await Ut(l);
|
|
536
|
+
}, Ut = async (e) => {
|
|
537
|
+
if (h.value) {
|
|
538
|
+
x.value = !0;
|
|
535
539
|
try {
|
|
536
|
-
const l = await
|
|
537
|
-
(await l.copyPages(t, a)).forEach((
|
|
540
|
+
const l = await z.load(h.value), o = new Uint8Array(await e.arrayBuffer()), t = await z.load(o), n = t.getPageCount(), a = Array.from({ length: n }, (E, C) => C);
|
|
541
|
+
(await l.copyPages(t, a)).forEach((E) => l.addPage(E)), await re(l), m.value = [], y.toast.add({
|
|
538
542
|
severity: "success",
|
|
539
|
-
summary:
|
|
540
|
-
detail:
|
|
543
|
+
summary: i("pdfTools.common.success"),
|
|
544
|
+
detail: i("pdfTools.insertFromFileSuccess", { count: n }),
|
|
541
545
|
life: 3e3
|
|
542
546
|
});
|
|
543
547
|
} catch (l) {
|
|
544
|
-
console.error("Error inserting PDF:", l),
|
|
548
|
+
console.error("Error inserting PDF:", l), S.value = i("pdfTools.insertError");
|
|
545
549
|
} finally {
|
|
546
|
-
|
|
550
|
+
x.value = !1;
|
|
547
551
|
}
|
|
548
552
|
}
|
|
549
|
-
},
|
|
550
|
-
if (!(!Ie.value || m.value.length === 0 || !
|
|
551
|
-
|
|
553
|
+
}, Ht = async () => {
|
|
554
|
+
if (!(!Ie.value || m.value.length === 0 || !h.value)) {
|
|
555
|
+
x.value = !0;
|
|
552
556
|
try {
|
|
553
|
-
const e = await
|
|
557
|
+
const e = await z.load(h.value), l = m.value.map((o) => o.pageIndex);
|
|
554
558
|
for (const o of l) {
|
|
555
559
|
const t = e.getPage(o), { width: n, height: a } = t.getSize();
|
|
556
560
|
for (let u = 0; u < Se.value; u++)
|
|
@@ -560,93 +564,93 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
560
564
|
size: 50,
|
|
561
565
|
color: xl(0.95, 0.1, 0.1),
|
|
562
566
|
opacity: 0.5,
|
|
563
|
-
rotate:
|
|
567
|
+
rotate: Co(nl.value)
|
|
564
568
|
});
|
|
565
569
|
}
|
|
566
570
|
await re(e, { updatePages: !1 });
|
|
567
571
|
} catch (e) {
|
|
568
|
-
console.error("Error adding watermark:", e),
|
|
572
|
+
console.error("Error adding watermark:", e), S.value = i("pdfTools.watermarkError");
|
|
569
573
|
} finally {
|
|
570
|
-
|
|
574
|
+
x.value = !1;
|
|
571
575
|
}
|
|
572
576
|
}
|
|
573
|
-
},
|
|
574
|
-
if (
|
|
575
|
-
|
|
577
|
+
}, Bt = async () => {
|
|
578
|
+
if (h.value) {
|
|
579
|
+
x.value = !0;
|
|
576
580
|
try {
|
|
577
|
-
const e = new Blob([
|
|
581
|
+
const e = new Blob([h.value], {
|
|
578
582
|
type: "application/pdf"
|
|
579
583
|
}), l = new File([e], "modified.pdf", { type: "application/pdf" }), o = {
|
|
580
584
|
majorVersion: !0,
|
|
581
585
|
comment: "File modified via Pristy Espaces PDF tools"
|
|
582
586
|
};
|
|
583
|
-
await Ee.updateContentNode(
|
|
587
|
+
await Ee.updateContentNode(y.id, l, o), I.value = !1, y.toast.add({
|
|
584
588
|
severity: "success",
|
|
585
|
-
summary:
|
|
586
|
-
detail:
|
|
589
|
+
summary: i("pdfTools.common.success"),
|
|
590
|
+
detail: i("pdfTools.saveSuccess"),
|
|
587
591
|
life: 3e3
|
|
588
592
|
});
|
|
589
593
|
} catch (e) {
|
|
590
|
-
console.error("Error saving changes:", e),
|
|
594
|
+
console.error("Error saving changes:", e), y.toast.add({
|
|
591
595
|
severity: "error",
|
|
592
|
-
summary:
|
|
593
|
-
detail:
|
|
596
|
+
summary: i("pdfTools.common.error"),
|
|
597
|
+
detail: i("pdfTools.saveError"),
|
|
594
598
|
life: 3e3
|
|
595
599
|
});
|
|
596
600
|
} finally {
|
|
597
|
-
|
|
601
|
+
x.value = !1;
|
|
598
602
|
}
|
|
599
603
|
}
|
|
600
|
-
},
|
|
601
|
-
if (Sl.value = e, $l.value =
|
|
604
|
+
}, Ul = async (e) => {
|
|
605
|
+
if (Sl.value = e, $l.value = i("pdfTools.saveAs.defaultFilename"), We.value && We.value.parentId)
|
|
602
606
|
try {
|
|
603
|
-
|
|
604
|
-
|
|
607
|
+
Ge.value = await Ee.getNode(
|
|
608
|
+
We.value.parentId
|
|
605
609
|
);
|
|
606
610
|
} catch (l) {
|
|
607
|
-
console.error("Could not fetch parent node for Save As dialog", l),
|
|
611
|
+
console.error("Could not fetch parent node for Save As dialog", l), Ge.value = null;
|
|
608
612
|
}
|
|
609
613
|
else
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
},
|
|
613
|
-
|
|
614
|
+
Ge.value = null;
|
|
615
|
+
Ve.value = !0;
|
|
616
|
+
}, Ot = async ({ filename: e, folderId: l }) => {
|
|
617
|
+
Ve.value = !1, x.value = !0;
|
|
614
618
|
try {
|
|
615
619
|
let o;
|
|
616
|
-
if (Sl.value === "extract" ? o = await
|
|
617
|
-
throw new Error(
|
|
620
|
+
if (Sl.value === "extract" ? o = await $t() : o = h.value, !o)
|
|
621
|
+
throw new Error(i("pdfTools.noContentToSave"));
|
|
618
622
|
const t = new Blob([o], { type: "application/pdf" }), n = new File([t], e, { type: "application/pdf" });
|
|
619
623
|
if (!l)
|
|
620
624
|
throw new Error("No destination folder selected.");
|
|
621
|
-
await Pl.uploadFile(l, {}, n),
|
|
625
|
+
await Pl.uploadFile(l, {}, n), y.toast.add({
|
|
622
626
|
severity: "success",
|
|
623
|
-
summary:
|
|
624
|
-
detail:
|
|
627
|
+
summary: i("pdfTools.common.success"),
|
|
628
|
+
detail: i("pdfTools.fileCreatedSuccess", { filename: e }),
|
|
625
629
|
life: 3e3
|
|
626
630
|
});
|
|
627
631
|
} catch (o) {
|
|
628
632
|
console.error('Error during "Save As":', o);
|
|
629
|
-
const t = o.status === 409 ?
|
|
630
|
-
|
|
633
|
+
const t = o.status === 409 ? i("pdfTools.saveAs.conflictError") : i("pdfTools.saveAsError");
|
|
634
|
+
y.toast.add({
|
|
631
635
|
severity: "error",
|
|
632
|
-
summary:
|
|
636
|
+
summary: i("pdfTools.common.error"),
|
|
633
637
|
detail: t,
|
|
634
638
|
life: 4e3
|
|
635
639
|
});
|
|
636
640
|
} finally {
|
|
637
|
-
|
|
641
|
+
x.value = !1;
|
|
638
642
|
}
|
|
639
|
-
},
|
|
643
|
+
}, Hl = async () => {
|
|
640
644
|
const e = H.value;
|
|
641
645
|
if (p.value = p.value.filter(
|
|
642
646
|
(l) => l.type !== d.COMMENT
|
|
643
|
-
), !
|
|
647
|
+
), !h.value || !e) {
|
|
644
648
|
_();
|
|
645
649
|
return;
|
|
646
650
|
}
|
|
647
651
|
try {
|
|
648
|
-
const l = await
|
|
649
|
-
for (const n of
|
|
652
|
+
const l = await z.load(h.value), o = Wl(), t = jt.value;
|
|
653
|
+
for (const n of Ko(l.getPage(e.pageIndex)))
|
|
650
654
|
p.value.push({
|
|
651
655
|
type: d.COMMENT,
|
|
652
656
|
rect: {
|
|
@@ -662,25 +666,25 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
662
666
|
console.error("Error reading existing comments:", l);
|
|
663
667
|
}
|
|
664
668
|
_();
|
|
665
|
-
},
|
|
666
|
-
H.value = e ||
|
|
667
|
-
ie(),
|
|
669
|
+
}, Bl = (e) => {
|
|
670
|
+
H.value = e || O.value, N.value = !0, Q.value = 1, p.value = [], W.value = -1, setTimeout(() => {
|
|
671
|
+
ie(), Hl();
|
|
668
672
|
}, 200);
|
|
669
|
-
},
|
|
673
|
+
}, Ol = () => {
|
|
670
674
|
N.value = !1, H.value = null;
|
|
671
|
-
},
|
|
675
|
+
}, Vt = () => {
|
|
672
676
|
Q.value = Math.min(4, Q.value + 0.1);
|
|
673
|
-
},
|
|
677
|
+
}, zt = () => {
|
|
674
678
|
Q.value = Math.max(0.2, Q.value - 0.1);
|
|
675
679
|
}, Fe = (e) => {
|
|
676
|
-
e === d.REDACT ? window.confirm(
|
|
677
|
-
},
|
|
678
|
-
Ce.value = e.files?.[0] || null, Ce.value && (ke.value = null,
|
|
679
|
-
},
|
|
680
|
+
e === d.REDACT ? window.confirm(i("pdfTools.redactWarning")) && (k.value = e) : k.value = e;
|
|
681
|
+
}, Wt = (e) => {
|
|
682
|
+
Ce.value = e.files?.[0] || null, Ce.value && (ke.value = null, k.value = d.IMAGE);
|
|
683
|
+
}, Gt = () => {
|
|
680
684
|
ve.value = !0;
|
|
681
|
-
},
|
|
682
|
-
p.value.pop(),
|
|
683
|
-
},
|
|
685
|
+
}, Xt = () => {
|
|
686
|
+
p.value.pop(), W.value = -1, _();
|
|
687
|
+
}, Vl = async (e) => {
|
|
684
688
|
if (!(!e || e.type !== d.IMAGE || e._loading || e._bitmap)) {
|
|
685
689
|
e._loading = !0;
|
|
686
690
|
try {
|
|
@@ -689,12 +693,12 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
689
693
|
type: "image/png"
|
|
690
694
|
})), l && (e._bitmap = await createImageBitmap(l), _());
|
|
691
695
|
} catch (l) {
|
|
692
|
-
console.warn(
|
|
696
|
+
console.warn(i("pdfTools.imagePreviewUnavailable"), l);
|
|
693
697
|
} finally {
|
|
694
698
|
e._loading = !1;
|
|
695
699
|
}
|
|
696
700
|
}
|
|
697
|
-
},
|
|
701
|
+
}, zl = () => {
|
|
698
702
|
const e = kl.value;
|
|
699
703
|
if (!e)
|
|
700
704
|
return null;
|
|
@@ -706,18 +710,18 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
706
710
|
), t = o.length ? o : l;
|
|
707
711
|
let n = t[0], a = 0;
|
|
708
712
|
for (const u of t) {
|
|
709
|
-
const
|
|
710
|
-
|
|
713
|
+
const E = u.getBoundingClientRect(), C = Math.max(0, E.width) * Math.max(0, E.height);
|
|
714
|
+
C > a && (n = u, a = C);
|
|
711
715
|
}
|
|
712
716
|
return n;
|
|
713
717
|
}, ie = () => {
|
|
714
|
-
const e =
|
|
715
|
-
if (!e || !
|
|
718
|
+
const e = zl();
|
|
719
|
+
if (!e || !B.value)
|
|
716
720
|
return;
|
|
717
721
|
const l = e.getBoundingClientRect(), o = window.devicePixelRatio || 1;
|
|
718
|
-
|
|
722
|
+
B.value.style.width = l.width + "px", B.value.style.height = l.height + "px", B.value.width = Math.round(l.width * o), B.value.height = Math.round(l.height * o), _();
|
|
719
723
|
}, he = (e) => {
|
|
720
|
-
const l =
|
|
724
|
+
const l = B.value;
|
|
721
725
|
if (!l)
|
|
722
726
|
return { x: 0, y: 0 };
|
|
723
727
|
const o = l.getBoundingClientRect(), t = window.devicePixelRatio || 1;
|
|
@@ -727,8 +731,8 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
727
731
|
};
|
|
728
732
|
};
|
|
729
733
|
let Ne = null, Z = null, Re = null, ce = null;
|
|
730
|
-
const
|
|
731
|
-
const e = H.value ||
|
|
734
|
+
const Yt = Te(() => {
|
|
735
|
+
const e = H.value || O.value;
|
|
732
736
|
if (!R.value || !e)
|
|
733
737
|
return 0;
|
|
734
738
|
try {
|
|
@@ -736,8 +740,8 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
736
740
|
} catch {
|
|
737
741
|
return 0;
|
|
738
742
|
}
|
|
739
|
-
}),
|
|
740
|
-
const e = H.value ||
|
|
743
|
+
}), jt = Te(() => {
|
|
744
|
+
const e = H.value || O.value;
|
|
741
745
|
if (!R.value || !e)
|
|
742
746
|
return 0;
|
|
743
747
|
try {
|
|
@@ -745,48 +749,48 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
745
749
|
} catch {
|
|
746
750
|
return 0;
|
|
747
751
|
}
|
|
748
|
-
}),
|
|
749
|
-
overlayWidth:
|
|
750
|
-
pageWidthPt:
|
|
751
|
-
}), cl = (e) => Math.max(1, (Number(e?.size) || 18) *
|
|
752
|
-
const o =
|
|
752
|
+
}), Wl = () => ta({
|
|
753
|
+
overlayWidth: B.value?.width || 0,
|
|
754
|
+
pageWidthPt: Yt.value
|
|
755
|
+
}), cl = (e) => Math.max(1, (Number(e?.size) || 18) * Wl()), Gl = (e, l) => {
|
|
756
|
+
const o = B.value.getContext("2d"), t = cl(l);
|
|
753
757
|
o.save(), o.font = `${t}px ${l.font || "Helvetica"}`;
|
|
754
|
-
const n =
|
|
758
|
+
const n = oa({
|
|
755
759
|
lines: Cl(e),
|
|
756
760
|
fontSize: t,
|
|
757
761
|
measureLine: (a) => o.measureText(a).width
|
|
758
762
|
});
|
|
759
763
|
return o.restore(), n;
|
|
760
|
-
},
|
|
764
|
+
}, Kt = Te(() => {
|
|
761
765
|
const e = window.devicePixelRatio || 1;
|
|
762
|
-
if (
|
|
766
|
+
if ($.value.tool === d.COMMENT)
|
|
763
767
|
return {
|
|
764
|
-
left: `${
|
|
765
|
-
top: `${
|
|
768
|
+
left: `${$.value.x / e}px`,
|
|
769
|
+
top: `${$.value.y / e}px`
|
|
766
770
|
};
|
|
767
|
-
const l =
|
|
771
|
+
const l = $.value.index >= 0 ? p.value[$.value.index]?.payload : { size: oe.value, font: ae.value, color: J.value }, o = cl(l) / e;
|
|
768
772
|
return {
|
|
769
|
-
left: `${
|
|
770
|
-
top: `${
|
|
773
|
+
left: `${$.value.x / e}px`,
|
|
774
|
+
top: `${$.value.y / e}px`,
|
|
771
775
|
font: `${o}px ${l?.font || "Helvetica"}`,
|
|
772
776
|
lineHeight: al,
|
|
773
777
|
color: l?.color || "#000000"
|
|
774
778
|
};
|
|
775
|
-
}),
|
|
779
|
+
}), W = v(-1);
|
|
776
780
|
let dl = !1;
|
|
777
|
-
const
|
|
778
|
-
() =>
|
|
779
|
-
),
|
|
780
|
-
|
|
781
|
+
const qt = Te(
|
|
782
|
+
() => k.value === d.TEXT || p.value[W.value]?.type === d.TEXT
|
|
783
|
+
), Jt = (e) => {
|
|
784
|
+
W.value = e;
|
|
781
785
|
const l = p.value[e];
|
|
782
|
-
l?.type === d.TEXT && (dl = !0, ae.value = l.payload?.font || "Helvetica", oe.value = Number(l.payload?.size) || 18, J.value = l.payload?.color || "#000000",
|
|
786
|
+
l?.type === d.TEXT && (dl = !0, ae.value = l.payload?.font || "Helvetica", oe.value = Number(l.payload?.size) || 18, J.value = l.payload?.color || "#000000", ct(() => {
|
|
783
787
|
dl = !1;
|
|
784
788
|
})), _();
|
|
785
789
|
};
|
|
786
790
|
xe([ae, oe, J], () => {
|
|
787
791
|
if (dl)
|
|
788
792
|
return;
|
|
789
|
-
const e =
|
|
793
|
+
const e = W.value, l = p.value[e];
|
|
790
794
|
if (!l || l.type !== d.TEXT)
|
|
791
795
|
return;
|
|
792
796
|
const o = {
|
|
@@ -801,62 +805,62 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
801
805
|
rect: {
|
|
802
806
|
x: l.rect.x,
|
|
803
807
|
y: l.rect.y,
|
|
804
|
-
...
|
|
808
|
+
...Gl(o.text, o)
|
|
805
809
|
}
|
|
806
810
|
}, _();
|
|
807
811
|
});
|
|
808
|
-
const
|
|
809
|
-
const e =
|
|
810
|
-
e < 0 || !p.value[e] || (p.value.splice(e, 1),
|
|
812
|
+
const Xl = () => {
|
|
813
|
+
const e = W.value;
|
|
814
|
+
e < 0 || !p.value[e] || (p.value.splice(e, 1), W.value = -1, _());
|
|
811
815
|
}, ul = (e) => {
|
|
812
816
|
if (e.key === "Escape") {
|
|
813
|
-
|
|
817
|
+
$.value.visible && Zt(), W.value = -1, k.value = d.SELECT, _();
|
|
814
818
|
return;
|
|
815
819
|
}
|
|
816
|
-
const l =
|
|
817
|
-
e.key === "Delete" && !l &&
|
|
820
|
+
const l = $.value.visible || ["INPUT", "TEXTAREA", "SELECT"].includes(e.target?.tagName);
|
|
821
|
+
e.key === "Delete" && !l && Xl();
|
|
818
822
|
};
|
|
819
823
|
xe(N, (e) => {
|
|
820
824
|
e ? document.addEventListener("keydown", ul) : document.removeEventListener("keydown", ul);
|
|
821
|
-
}),
|
|
822
|
-
const
|
|
823
|
-
() =>
|
|
824
|
-
label:
|
|
825
|
-
placeholder:
|
|
825
|
+
}), Eo(() => document.removeEventListener("keydown", ul));
|
|
826
|
+
const Yl = Te(
|
|
827
|
+
() => $.value.tool === d.COMMENT ? {
|
|
828
|
+
label: i("pdfTools.pageEditor.tools.comment"),
|
|
829
|
+
placeholder: i("pdfTools.pageEditor.commentPlaceholder")
|
|
826
830
|
} : {
|
|
827
|
-
label:
|
|
828
|
-
placeholder:
|
|
831
|
+
label: i("pdfTools.pageEditor.textInputLabel"),
|
|
832
|
+
placeholder: i("pdfTools.pageEditor.textInputPlaceholder")
|
|
829
833
|
}
|
|
830
|
-
),
|
|
834
|
+
), jl = (e, l, o = -1) => {
|
|
831
835
|
const t = o >= 0 ? p.value[o] : null;
|
|
832
|
-
|
|
836
|
+
$.value = {
|
|
833
837
|
visible: !0,
|
|
834
838
|
tool: l,
|
|
835
839
|
x: t ? t.rect.x : e.x,
|
|
836
840
|
y: t ? t.rect.y : e.y,
|
|
837
841
|
value: t ? String(t.payload?.text || "") : "",
|
|
838
842
|
index: o
|
|
839
|
-
}, _(),
|
|
840
|
-
},
|
|
841
|
-
|
|
843
|
+
}, _(), ct(() => Il.value?.focus());
|
|
844
|
+
}, Zt = () => {
|
|
845
|
+
$.value = { ...$.value, visible: !1, index: -1 }, _();
|
|
842
846
|
}, vl = () => {
|
|
843
|
-
if (
|
|
847
|
+
if (!$.value.visible)
|
|
844
848
|
return;
|
|
845
|
-
const { value: e, index: l, x: o, y: t, tool: n } =
|
|
846
|
-
if (
|
|
849
|
+
const { value: e, index: l, x: o, y: t, tool: n } = $.value;
|
|
850
|
+
if ($.value = { ...$.value, visible: !1, index: -1 }, !e.trim()) {
|
|
847
851
|
l >= 0 && p.value.splice(l, 1), _();
|
|
848
852
|
return;
|
|
849
853
|
}
|
|
850
854
|
if (n === d.COMMENT) {
|
|
851
|
-
const
|
|
855
|
+
const E = {
|
|
852
856
|
type: d.COMMENT,
|
|
853
|
-
rect: { x: o, y: t, w:
|
|
857
|
+
rect: { x: o, y: t, w: yt, h: yt },
|
|
854
858
|
payload: { text: e }
|
|
855
859
|
};
|
|
856
860
|
l >= 0 ? p.value[l] = {
|
|
857
861
|
...p.value[l],
|
|
858
862
|
payload: { text: e }
|
|
859
|
-
} : p.value.push(
|
|
863
|
+
} : p.value.push(E), W.value = l >= 0 ? l : p.value.length - 1, _();
|
|
860
864
|
return;
|
|
861
865
|
}
|
|
862
866
|
const a = l >= 0 ? { ...p.value[l].payload, text: e } : {
|
|
@@ -864,58 +868,58 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
864
868
|
font: ae.value,
|
|
865
869
|
size: oe.value,
|
|
866
870
|
color: J.value
|
|
867
|
-
}, u = { x: o, y: t, ...
|
|
871
|
+
}, u = { x: o, y: t, ...Gl(e, a) };
|
|
868
872
|
l >= 0 ? p.value[l] = {
|
|
869
873
|
...p.value[l],
|
|
870
874
|
rect: u,
|
|
871
875
|
payload: a
|
|
872
|
-
} : p.value.push({ type: d.TEXT, rect: u, payload: a }),
|
|
873
|
-
},
|
|
874
|
-
const l = he(e), o =
|
|
875
|
-
(t === d.TEXT || t === d.COMMENT) &&
|
|
876
|
-
},
|
|
876
|
+
} : p.value.push({ type: d.TEXT, rect: u, payload: a }), W.value = l >= 0 ? l : p.value.length - 1, _();
|
|
877
|
+
}, Qt = (e) => {
|
|
878
|
+
const l = he(e), o = Kl(l), t = o !== -1 ? p.value[o].type : null;
|
|
879
|
+
(t === d.TEXT || t === d.COMMENT) && jl(l, t, o);
|
|
880
|
+
}, Kl = (e) => {
|
|
877
881
|
for (let l = p.value.length - 1; l >= 0; l--) {
|
|
878
882
|
const o = p.value[l].rect;
|
|
879
883
|
if (e.x >= o.x && e.x <= o.x + o.w && e.y >= o.y && e.y <= o.y + o.h)
|
|
880
884
|
return l;
|
|
881
885
|
}
|
|
882
886
|
return -1;
|
|
883
|
-
},
|
|
887
|
+
}, eo = (e) => {
|
|
884
888
|
const t = 6 * (window.devicePixelRatio || 1) / 2;
|
|
885
889
|
for (let n = p.value.length - 1; n >= 0; n--) {
|
|
886
890
|
const a = p.value[n];
|
|
887
891
|
if (a.type !== d.IMAGE)
|
|
888
892
|
continue;
|
|
889
|
-
const u = a.rect,
|
|
893
|
+
const u = a.rect, E = [
|
|
890
894
|
{ key: "tl", x: u.x, y: u.y },
|
|
891
895
|
{ key: "tr", x: u.x + u.w, y: u.y },
|
|
892
896
|
{ key: "bl", x: u.x, y: u.y + u.h },
|
|
893
897
|
{ key: "br", x: u.x + u.w, y: u.y + u.h }
|
|
894
898
|
];
|
|
895
|
-
for (const
|
|
896
|
-
if (e.x >=
|
|
897
|
-
return { idx: n, corner:
|
|
899
|
+
for (const C of E)
|
|
900
|
+
if (e.x >= C.x - t && e.x <= C.x + t && e.y >= C.y - t && e.y <= C.y + t)
|
|
901
|
+
return { idx: n, corner: C.key };
|
|
898
902
|
}
|
|
899
903
|
return null;
|
|
900
|
-
},
|
|
901
|
-
if (
|
|
904
|
+
}, lo = (e) => {
|
|
905
|
+
if ($.value.visible && vl(), k.value === d.REDACT || k.value === d.HIGHLIGHT)
|
|
902
906
|
pe = !0, te = he(e);
|
|
903
|
-
else if (
|
|
904
|
-
const l = he(e), o =
|
|
907
|
+
else if (k.value === d.IMAGE || k.value === d.SELECT || k.value === d.TEXT || k.value === d.COMMENT) {
|
|
908
|
+
const l = he(e), o = eo(l);
|
|
905
909
|
if (o) {
|
|
906
|
-
Re = o.idx, ce = o.corner, Z = { p: l, rect: { ...p.value[o.idx].rect } },
|
|
910
|
+
Re = o.idx, ce = o.corner, Z = { p: l, rect: { ...p.value[o.idx].rect } }, B.value && (B.value.style.cursor = "nwse-resize");
|
|
907
911
|
return;
|
|
908
912
|
}
|
|
909
|
-
const t =
|
|
913
|
+
const t = Kl(l);
|
|
910
914
|
if (t !== -1 && (p.value[t].type === d.IMAGE || p.value[t].type === d.TEXT || p.value[t].type === d.COMMENT)) {
|
|
911
|
-
|
|
915
|
+
Jt(t), Ne = t, Z = { p: l, rect: { ...p.value[t].rect } }, B.value && (B.value.style.cursor = "move");
|
|
912
916
|
return;
|
|
913
917
|
}
|
|
914
|
-
if (
|
|
915
|
-
e.preventDefault(),
|
|
918
|
+
if (W.value = -1, k.value === d.TEXT || k.value === d.COMMENT) {
|
|
919
|
+
e.preventDefault(), jl(l, k.value);
|
|
916
920
|
return;
|
|
917
921
|
}
|
|
918
|
-
if (
|
|
922
|
+
if (k.value === d.IMAGE) {
|
|
919
923
|
if (!Ce.value && !ke.value)
|
|
920
924
|
return;
|
|
921
925
|
const n = {
|
|
@@ -926,17 +930,17 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
926
930
|
signature: ke.value
|
|
927
931
|
}
|
|
928
932
|
};
|
|
929
|
-
p.value.push(n),
|
|
933
|
+
p.value.push(n), Vl(n), _(), k.value = d.SELECT, Ce.value = null, ke.value = null;
|
|
930
934
|
}
|
|
931
935
|
}
|
|
932
|
-
},
|
|
936
|
+
}, to = (e) => {
|
|
933
937
|
if (Re !== null && ce) {
|
|
934
938
|
const o = he(e), t = p.value[Re];
|
|
935
939
|
if (t) {
|
|
936
940
|
const n = Z.rect;
|
|
937
|
-
let a = n.x, u = n.y,
|
|
938
|
-
const
|
|
939
|
-
ce === "br" ? (
|
|
941
|
+
let a = n.x, u = n.y, E = n.w, C = n.h;
|
|
942
|
+
const G = o.x - Z.p.x, L = o.y - Z.p.y;
|
|
943
|
+
ce === "br" ? (E = Math.max(10, n.w + G), C = Math.max(10, n.h + L)) : ce === "tr" ? (E = Math.max(10, n.w + G), C = Math.max(10, n.h - L), u = n.y + L) : ce === "bl" ? (E = Math.max(10, n.w - G), a = n.x + G, C = Math.max(10, n.h + L)) : ce === "tl" && (E = Math.max(10, n.w - G), a = n.x + G, C = Math.max(10, n.h - L), u = n.y + L), t.rect.x = a, t.rect.y = u, t.rect.w = E, t.rect.h = C, _();
|
|
940
944
|
}
|
|
941
945
|
return;
|
|
942
946
|
}
|
|
@@ -957,33 +961,33 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
957
961
|
w: Math.abs(l.x - te.x),
|
|
958
962
|
h: Math.abs(l.y - te.y)
|
|
959
963
|
}, _();
|
|
960
|
-
},
|
|
964
|
+
}, oo = () => {
|
|
961
965
|
if (Ne !== null || Re !== null) {
|
|
962
|
-
Ne = null, Re = null, ce = null, Z = null,
|
|
966
|
+
Ne = null, Re = null, ce = null, Z = null, B.value && (B.value.style.cursor = "crosshair"), _();
|
|
963
967
|
return;
|
|
964
968
|
}
|
|
965
969
|
pe && de.value && p.value.push({
|
|
966
|
-
type:
|
|
970
|
+
type: k.value,
|
|
967
971
|
rect: { ...de.value }
|
|
968
972
|
}), pe = !1, te = null, de.value = null, _();
|
|
969
|
-
},
|
|
973
|
+
}, ao = () => {
|
|
970
974
|
pe && (pe = !1, te = null, de.value = null, _());
|
|
971
975
|
}, de = v(null), _ = () => {
|
|
972
|
-
const e =
|
|
976
|
+
const e = W.value, l = B.value;
|
|
973
977
|
if (!l)
|
|
974
978
|
return;
|
|
975
979
|
const o = l.getContext("2d"), t = window.devicePixelRatio || 1;
|
|
976
980
|
o.clearRect(0, 0, l.width, l.height);
|
|
977
981
|
const n = (a, u) => {
|
|
978
|
-
if (!(
|
|
982
|
+
if (!($.value.visible && u === $.value.index)) {
|
|
979
983
|
if (a.type === d.REDACT)
|
|
980
984
|
o.fillStyle = "rgba(0,0,0,1)", o.fillRect(a.rect.x, a.rect.y, a.rect.w, a.rect.h), o.strokeStyle = "rgba(0,0,0,1)", o.strokeRect(a.rect.x, a.rect.y, a.rect.w, a.rect.h);
|
|
981
985
|
else if (a.type === d.HIGHLIGHT)
|
|
982
986
|
o.fillStyle = "rgba(255, 235, 59, 0.4)", o.fillRect(a.rect.x, a.rect.y, a.rect.w, a.rect.h), o.strokeStyle = "rgba(255, 193, 7, 0.8)", o.strokeRect(a.rect.x, a.rect.y, a.rect.w, a.rect.h);
|
|
983
987
|
else if (a.type === d.COMMENT)
|
|
984
|
-
|
|
988
|
+
no(o, a.rect.x, a.rect.y, 20 * t), u === e && (o.save(), o.strokeStyle = "#0ea5e9", o.lineWidth = 2 * t, o.setLineDash([4 * t, 4 * t]), o.strokeRect(a.rect.x, a.rect.y, a.rect.w, a.rect.h), o.restore());
|
|
985
989
|
else if (a.type === d.IMAGE) {
|
|
986
|
-
if (
|
|
990
|
+
if (Vl(a), a._bitmap && o.drawImage(
|
|
987
991
|
a._bitmap,
|
|
988
992
|
a.rect.x,
|
|
989
993
|
a.rect.y,
|
|
@@ -991,54 +995,54 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
991
995
|
a.rect.h
|
|
992
996
|
), o.strokeStyle = u === e ? "#0ea5e9" : "rgba(33,150,243,0.9)", o.lineWidth = u === e ? 2 * t : 1 * t, o.strokeRect(a.rect.x, a.rect.y, a.rect.w, a.rect.h), u === e) {
|
|
993
997
|
o.fillStyle = "#0ea5e9";
|
|
994
|
-
const
|
|
998
|
+
const E = 6 * t, C = E / 2;
|
|
995
999
|
[
|
|
996
1000
|
[a.rect.x, a.rect.y],
|
|
997
1001
|
[a.rect.x + a.rect.w, a.rect.y],
|
|
998
1002
|
[a.rect.x, a.rect.y + a.rect.h],
|
|
999
1003
|
[a.rect.x + a.rect.w, a.rect.y + a.rect.h]
|
|
1000
1004
|
].forEach(([L, be]) => {
|
|
1001
|
-
o.fillRect(L -
|
|
1005
|
+
o.fillRect(L - C, be - C, E, E);
|
|
1002
1006
|
});
|
|
1003
1007
|
}
|
|
1004
1008
|
} else if (a.type === d.TEXT) {
|
|
1005
|
-
const
|
|
1006
|
-
o.save(), o.fillStyle =
|
|
1007
|
-
let
|
|
1008
|
-
for (const L of Cl(
|
|
1009
|
-
o.fillText(L, a.rect.x,
|
|
1009
|
+
const E = a.payload || {}, C = cl(E);
|
|
1010
|
+
o.save(), o.fillStyle = E.color || "#000", o.font = `${C}px ${E.font || "Helvetica"}`, o.textBaseline = "top";
|
|
1011
|
+
let G = a.rect.y;
|
|
1012
|
+
for (const L of Cl(E.text))
|
|
1013
|
+
o.fillText(L, a.rect.x, G), G += C * al;
|
|
1010
1014
|
o.restore(), o.save(), o.strokeStyle = u === e ? "#0ea5e9" : "rgba(33,150,243,0.5)", o.lineWidth = u === e ? 2 * t : 1 * t, o.setLineDash([4 * t, 4 * t]), o.strokeRect(a.rect.x, a.rect.y, a.rect.w, a.rect.h), o.restore();
|
|
1011
1015
|
}
|
|
1012
1016
|
}
|
|
1013
1017
|
};
|
|
1014
1018
|
if (p.value.forEach(n), de.value) {
|
|
1015
1019
|
const a = de.value;
|
|
1016
|
-
o.setLineDash([6 * t, 4 * t]), o.strokeStyle =
|
|
1020
|
+
o.setLineDash([6 * t, 4 * t]), o.strokeStyle = k.value === d.REDACT ? "black" : "goldenrod", o.strokeRect(a.x, a.y, a.w, a.h), o.setLineDash([]);
|
|
1017
1021
|
}
|
|
1018
|
-
},
|
|
1022
|
+
}, so = (e) => {
|
|
1019
1023
|
let l = e.toString().trim();
|
|
1020
1024
|
l.startsWith("#") && (l = l.slice(1)), l.length === 3 && (l = l.split("").map((u) => u + u).join(""));
|
|
1021
1025
|
const o = parseInt(l || "000000", 16), t = (o >> 16 & 255) / 255, n = (o >> 8 & 255) / 255, a = (o & 255) / 255;
|
|
1022
1026
|
return { r: t, g: n, b: a };
|
|
1023
|
-
},
|
|
1027
|
+
}, no = (e, l, o, t) => {
|
|
1024
1028
|
e.save(), e.translate(l, o), e.fillStyle = "#FFEB3B", e.strokeStyle = "#FBC02D", e.lineWidth = 2, e.beginPath(), e.rect(0, 0, t, t), e.fill(), e.stroke(), e.beginPath(), e.moveTo(t * 0.6, 0), e.lineTo(t, t * 0.4), e.lineTo(t * 0.6, t * 0.4), e.closePath(), e.fillStyle = "#FDD835", e.fill(), e.restore();
|
|
1025
|
-
},
|
|
1026
|
-
if (!(!
|
|
1027
|
-
|
|
1029
|
+
}, ro = async () => {
|
|
1030
|
+
if (!(!h.value || !H.value)) {
|
|
1031
|
+
x.value = !0;
|
|
1028
1032
|
try {
|
|
1029
|
-
const e = await
|
|
1033
|
+
const e = await z.load(h.value), l = H.value.pageIndex;
|
|
1030
1034
|
let o = e.getPage(l);
|
|
1031
|
-
const { width: t, height: n } = o.getSize(), a =
|
|
1035
|
+
const { width: t, height: n } = o.getSize(), a = zl();
|
|
1032
1036
|
if (!a)
|
|
1033
|
-
throw new Error(
|
|
1037
|
+
throw new Error(i("pdfTools.pdfRenderCanvasNotFound"));
|
|
1034
1038
|
if (p.value.some(
|
|
1035
1039
|
(M) => M.type === d.REDACT
|
|
1036
1040
|
)) {
|
|
1037
|
-
if (!window.confirm(
|
|
1038
|
-
|
|
1041
|
+
if (!window.confirm(i("pdfTools.redactFlattenConfirm"))) {
|
|
1042
|
+
x.value = !1;
|
|
1039
1043
|
return;
|
|
1040
1044
|
}
|
|
1041
|
-
const pl = await (await
|
|
1045
|
+
const pl = await (await je.value.promise).getPage(l + 1), we = B.value, ml = await ea({
|
|
1042
1046
|
pdfPage: pl,
|
|
1043
1047
|
// Masks are converted to page fractions so they no longer depend on
|
|
1044
1048
|
// the screen resolution nor on the current zoom level.
|
|
@@ -1048,30 +1052,30 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1048
1052
|
w: ee.rect.w / we.width,
|
|
1049
1053
|
h: ee.rect.h / we.height
|
|
1050
1054
|
}))
|
|
1051
|
-
}), gl = await (await fetch(ml)).arrayBuffer(), yl = await e.embedJpg(gl),
|
|
1052
|
-
|
|
1055
|
+
}), gl = await (await fetch(ml)).arrayBuffer(), yl = await e.embedJpg(gl), Ke = e.insertPage(l + 1, [t, n]);
|
|
1056
|
+
Ke.drawImage(yl, { x: 0, y: 0, width: t, height: n }), o = Ke;
|
|
1053
1057
|
}
|
|
1054
|
-
const
|
|
1055
|
-
|
|
1058
|
+
const E = a.getBoundingClientRect(), C = a.width, G = a.height, L = window.devicePixelRatio || 1, be = C / E.width, et = G / E.height, lt = t / C, tt = n / G;
|
|
1059
|
+
qo(o);
|
|
1056
1060
|
for (const M of p.value) {
|
|
1057
|
-
const
|
|
1061
|
+
const at = M.rect.x / L, pl = M.rect.y / L, we = M.rect.w / L, ml = M.rect.h / L, gl = at * be, yl = pl * et, Ke = we * be, ee = ml * et, hl = Ke * lt, bl = ee * tt, qe = gl * lt, Je = n - (yl + ee) * tt;
|
|
1058
1062
|
if (M.type !== d.REDACT) {
|
|
1059
1063
|
if (M.type === d.HIGHLIGHT)
|
|
1060
1064
|
o.drawRectangle({
|
|
1061
|
-
x:
|
|
1062
|
-
y:
|
|
1065
|
+
x: qe,
|
|
1066
|
+
y: Je,
|
|
1063
1067
|
width: hl,
|
|
1064
1068
|
height: bl,
|
|
1065
1069
|
color: xl(1, 0.92, 0.23),
|
|
1066
1070
|
opacity: 0.4
|
|
1067
1071
|
});
|
|
1068
1072
|
else if (M.type === d.COMMENT)
|
|
1069
|
-
|
|
1073
|
+
jo({
|
|
1070
1074
|
doc: e,
|
|
1071
1075
|
page: o,
|
|
1072
|
-
rect: { x:
|
|
1076
|
+
rect: { x: qe, y: Je, size: Math.max(14, hl) },
|
|
1073
1077
|
text: M.payload?.text,
|
|
1074
|
-
title:
|
|
1078
|
+
title: i("pdfTools.pageEditor.tools.comment")
|
|
1075
1079
|
});
|
|
1076
1080
|
else if (M.type === d.IMAGE) {
|
|
1077
1081
|
let K = null;
|
|
@@ -1082,56 +1086,56 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1082
1086
|
} catch {
|
|
1083
1087
|
Le = await e.embedJpg(K);
|
|
1084
1088
|
}
|
|
1085
|
-
o.drawImage(Le, { x:
|
|
1089
|
+
o.drawImage(Le, { x: qe, y: Je, width: hl, height: bl, opacity: 0.98 });
|
|
1086
1090
|
}
|
|
1087
1091
|
} else if (M.type === d.TEXT) {
|
|
1088
1092
|
const K = M.payload || {}, Le = K.font === "TimesRoman" ? El.TimesRoman : K.font === "Courier" ? El.Courier : El.Helvetica, wl = await e.embedFont(Le), Tl = Math.max(6, Number(K.size) || 18), {
|
|
1089
|
-
r:
|
|
1090
|
-
g:
|
|
1091
|
-
b:
|
|
1092
|
-
} =
|
|
1093
|
-
Cl(K.text).forEach((
|
|
1094
|
-
|
|
1095
|
-
x:
|
|
1096
|
-
y:
|
|
1097
|
-
topY:
|
|
1098
|
-
lineIndex:
|
|
1093
|
+
r: go,
|
|
1094
|
+
g: yo,
|
|
1095
|
+
b: ho
|
|
1096
|
+
} = so(K.color || "#000000"), bo = Je + bl, wo = wl.heightAtSize(Tl, { descender: !1 });
|
|
1097
|
+
Cl(K.text).forEach((st, To) => {
|
|
1098
|
+
st && o.drawText(st, {
|
|
1099
|
+
x: qe,
|
|
1100
|
+
y: aa({
|
|
1101
|
+
topY: bo,
|
|
1102
|
+
lineIndex: To,
|
|
1099
1103
|
fontSize: Tl,
|
|
1100
|
-
ascentPt:
|
|
1104
|
+
ascentPt: wo
|
|
1101
1105
|
}),
|
|
1102
1106
|
size: Tl,
|
|
1103
1107
|
font: wl,
|
|
1104
|
-
color: xl(
|
|
1108
|
+
color: xl(go, yo, ho)
|
|
1105
1109
|
});
|
|
1106
1110
|
});
|
|
1107
1111
|
}
|
|
1108
1112
|
}
|
|
1109
1113
|
}
|
|
1110
|
-
const
|
|
1114
|
+
const ot = p.value.some(
|
|
1111
1115
|
(M) => M.type === d.REDACT
|
|
1112
1116
|
);
|
|
1113
|
-
|
|
1117
|
+
ot && e.removePage(l), await re(e, { updatePages: ot }), p.value = [], W.value = -1, await Hl(), y.toast.add({
|
|
1114
1118
|
severity: "success",
|
|
1115
|
-
summary:
|
|
1116
|
-
detail:
|
|
1119
|
+
summary: i("pdfTools.common.success"),
|
|
1120
|
+
detail: i("pdfTools.pageEditor.applySuccess"),
|
|
1117
1121
|
life: 2e3
|
|
1118
1122
|
});
|
|
1119
1123
|
} catch (e) {
|
|
1120
|
-
console.error("Error applying overlay edits:", e),
|
|
1124
|
+
console.error("Error applying overlay edits:", e), y.toast.add({
|
|
1121
1125
|
severity: "error",
|
|
1122
|
-
summary:
|
|
1123
|
-
detail:
|
|
1126
|
+
summary: i("pdfTools.common.error"),
|
|
1127
|
+
detail: i("pdfTools.pageEditor.applyError"),
|
|
1124
1128
|
life: 3e3
|
|
1125
1129
|
});
|
|
1126
1130
|
} finally {
|
|
1127
|
-
|
|
1131
|
+
x.value = !1;
|
|
1128
1132
|
}
|
|
1129
1133
|
}
|
|
1130
1134
|
};
|
|
1131
1135
|
xe(Q, () => setTimeout(ie, 0)), xe(H, () => setTimeout(ie, 0)), typeof window < "u" && window.addEventListener("resize", () => setTimeout(ie, 0));
|
|
1132
|
-
const
|
|
1136
|
+
const io = () => {
|
|
1133
1137
|
Q.value = 1, setTimeout(ie, 0);
|
|
1134
|
-
},
|
|
1138
|
+
}, co = () => {
|
|
1135
1139
|
const e = fe.value;
|
|
1136
1140
|
if (!e)
|
|
1137
1141
|
return;
|
|
@@ -1139,37 +1143,37 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1139
1143
|
e.style.width = o + "px", e.style.height = t + "px", e.width = Math.round(o * l), e.height = Math.round(t * l);
|
|
1140
1144
|
const n = e.getContext("2d");
|
|
1141
1145
|
n.fillStyle = "#fff", n.fillRect(0, 0, e.width, e.height);
|
|
1142
|
-
},
|
|
1143
|
-
|
|
1144
|
-
}, Kl = (e) => {
|
|
1145
|
-
sl = !0, Be = Jl(e);
|
|
1146
|
+
}, uo = () => {
|
|
1147
|
+
Ql(), ve.value = !1;
|
|
1146
1148
|
}, ql = (e) => {
|
|
1149
|
+
sl = !0, Oe = Zl(e);
|
|
1150
|
+
}, Jl = (e) => {
|
|
1147
1151
|
if (!sl)
|
|
1148
1152
|
return;
|
|
1149
|
-
const l =
|
|
1150
|
-
|
|
1151
|
-
},
|
|
1152
|
-
sl = !1,
|
|
1153
|
-
},
|
|
1153
|
+
const l = Zl(e);
|
|
1154
|
+
po(Oe, l), Oe = l;
|
|
1155
|
+
}, vo = (e) => ql(e.touches[0]), fo = (e) => Jl(e.touches[0]), fl = () => {
|
|
1156
|
+
sl = !1, Oe = null;
|
|
1157
|
+
}, Zl = (e) => {
|
|
1154
1158
|
const o = fe.value.getBoundingClientRect(), t = window.devicePixelRatio || 1, n = e.clientX ?? e.pageX, a = e.clientY ?? e.pageY;
|
|
1155
1159
|
return { x: (n - o.left) * t, y: (a - o.top) * t };
|
|
1156
|
-
},
|
|
1160
|
+
}, po = (e, l) => {
|
|
1157
1161
|
const t = fe.value.getContext("2d");
|
|
1158
1162
|
t.strokeStyle = "#111827", t.lineWidth = 3 * (window.devicePixelRatio || 1), t.lineCap = "round", t.beginPath(), t.moveTo(e.x, e.y), t.lineTo(l.x, l.y), t.stroke();
|
|
1159
|
-
},
|
|
1163
|
+
}, Ql = () => {
|
|
1160
1164
|
const e = fe.value;
|
|
1161
1165
|
if (!e)
|
|
1162
1166
|
return;
|
|
1163
1167
|
const l = e.getContext("2d");
|
|
1164
1168
|
l.fillStyle = "#fff", l.fillRect(0, 0, e.width, e.height);
|
|
1165
|
-
},
|
|
1169
|
+
}, mo = () => {
|
|
1166
1170
|
const e = fe.value;
|
|
1167
1171
|
e && e.toBlob(async (l) => {
|
|
1168
|
-
ke.value = await l.arrayBuffer(),
|
|
1172
|
+
ke.value = await l.arrayBuffer(), k.value = d.IMAGE, ve.value = !1;
|
|
1169
1173
|
});
|
|
1170
1174
|
};
|
|
1171
1175
|
return xe(ve, (e) => {
|
|
1172
|
-
e && setTimeout(
|
|
1176
|
+
e && setTimeout(co, 0);
|
|
1173
1177
|
}), xe(Me, async (e) => {
|
|
1174
1178
|
if (!e) {
|
|
1175
1179
|
j.value = 0;
|
|
@@ -1182,75 +1186,75 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1182
1186
|
console.error("Error loading preview PDF:", l), j.value = 0;
|
|
1183
1187
|
}
|
|
1184
1188
|
}), (e, l) => {
|
|
1185
|
-
const o =
|
|
1186
|
-
return g(),
|
|
1187
|
-
s("div",
|
|
1189
|
+
const o = Po("tooltip");
|
|
1190
|
+
return g(), b("div", sa, [
|
|
1191
|
+
s("div", na, [
|
|
1188
1192
|
s("h1", null, [
|
|
1189
1193
|
le(f(e.$t("pdfTools.title")) + " ", 1),
|
|
1190
|
-
|
|
1194
|
+
ze.value ? (g(), b("span", ra, "— " + f(ze.value), 1)) : D("", !0)
|
|
1191
1195
|
]),
|
|
1192
|
-
P.closable ? (g(),
|
|
1196
|
+
P.closable ? (g(), He(r(w), {
|
|
1193
1197
|
key: 0,
|
|
1194
1198
|
severity: "secondary",
|
|
1195
1199
|
class: "flex-shrink-0",
|
|
1196
1200
|
icon: "ri-close-line",
|
|
1197
1201
|
label: e.$t("pdfTools.closeEditor"),
|
|
1198
1202
|
onClick: Y
|
|
1199
|
-
}, null, 8, ["label"])) :
|
|
1203
|
+
}, null, 8, ["label"])) : D("", !0)
|
|
1200
1204
|
]),
|
|
1201
|
-
|
|
1202
|
-
|
|
1205
|
+
x.value ? (g(), b("div", ia, [
|
|
1206
|
+
c(r(Ue)),
|
|
1203
1207
|
s("p", null, f(e.$t("pdfTools.loading")), 1)
|
|
1204
|
-
])) :
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
default:
|
|
1208
|
-
le(f(
|
|
1208
|
+
])) : D("", !0),
|
|
1209
|
+
S.value ? (g(), b("div", ca, [
|
|
1210
|
+
c(r(So), { severity: "error" }, {
|
|
1211
|
+
default: A(() => [
|
|
1212
|
+
le(f(S.value), 1)
|
|
1209
1213
|
]),
|
|
1210
1214
|
_: 1
|
|
1211
1215
|
})
|
|
1212
|
-
])) :
|
|
1213
|
-
!
|
|
1214
|
-
s("div",
|
|
1215
|
-
s("div",
|
|
1216
|
+
])) : D("", !0),
|
|
1217
|
+
!x.value && !S.value ? (g(), b("div", da, [
|
|
1218
|
+
s("div", ua, [
|
|
1219
|
+
s("div", va, [
|
|
1216
1220
|
s("h2", null, f(e.$t("pdfTools.sidebar.actions")), 1),
|
|
1217
|
-
s("div",
|
|
1218
|
-
|
|
1221
|
+
s("div", fa, [
|
|
1222
|
+
c(r(w), {
|
|
1219
1223
|
icon: "ri-save-2-line",
|
|
1220
1224
|
label: e.$t("pdfTools.sidebar.saveNewVersion"),
|
|
1221
|
-
onClick:
|
|
1225
|
+
onClick: Bt
|
|
1222
1226
|
}, null, 8, ["label"]),
|
|
1223
|
-
|
|
1227
|
+
c(r(w), {
|
|
1224
1228
|
severity: "secondary",
|
|
1225
1229
|
class: "btn-mt",
|
|
1226
1230
|
icon: "ri-file-copy-2-line",
|
|
1227
1231
|
label: e.$t("pdfTools.sidebar.saveAs"),
|
|
1228
|
-
onClick: l[0] || (l[0] = (t) =>
|
|
1232
|
+
onClick: l[0] || (l[0] = (t) => Ul("saveAs"))
|
|
1229
1233
|
}, null, 8, ["label"]),
|
|
1230
|
-
|
|
1231
|
-
s("div",
|
|
1234
|
+
c(r(mt)),
|
|
1235
|
+
s("div", pa, [
|
|
1232
1236
|
s("h3", null, f(e.$t("pdfTools.sidebar.extractPages")), 1),
|
|
1233
|
-
|
|
1237
|
+
c(r(w), {
|
|
1234
1238
|
disabled: m.value.length === 0,
|
|
1235
1239
|
icon: "ri-file-transfer-line",
|
|
1236
1240
|
label: e.$t("pdfTools.sidebar.extractAndSave"),
|
|
1237
|
-
onClick: l[1] || (l[1] = (t) =>
|
|
1241
|
+
onClick: l[1] || (l[1] = (t) => Ul("extract"))
|
|
1238
1242
|
}, null, 8, ["disabled", "label"])
|
|
1239
1243
|
]),
|
|
1240
|
-
s("div",
|
|
1244
|
+
s("div", ma, [
|
|
1241
1245
|
s("h3", null, f(e.$t("pdfTools.sidebar.deletePages")), 1),
|
|
1242
|
-
|
|
1246
|
+
c(r(w), {
|
|
1243
1247
|
disabled: m.value.length === 0 || F.value.length === m.value.length,
|
|
1244
1248
|
severity: "danger",
|
|
1245
1249
|
icon: "ri-delete-bin-line",
|
|
1246
1250
|
label: e.$t("pdfTools.sidebar.deleteSelectedPages"),
|
|
1247
|
-
onClick:
|
|
1251
|
+
onClick: At
|
|
1248
1252
|
}, null, 8, ["disabled", "label"])
|
|
1249
1253
|
]),
|
|
1250
|
-
s("div",
|
|
1254
|
+
s("div", ga, [
|
|
1251
1255
|
s("h3", null, f(e.$t("pdfTools.sidebar.insertPdf")), 1),
|
|
1252
|
-
s("div",
|
|
1253
|
-
|
|
1256
|
+
s("div", ya, [
|
|
1257
|
+
c(r(pt), {
|
|
1254
1258
|
auto: !1,
|
|
1255
1259
|
customUpload: !1,
|
|
1256
1260
|
showCancelButton: !1,
|
|
@@ -1261,27 +1265,27 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1261
1265
|
class: "btn-full",
|
|
1262
1266
|
mode: "basic",
|
|
1263
1267
|
name: "pdfToInsert",
|
|
1264
|
-
onSelect:
|
|
1268
|
+
onSelect: Dt
|
|
1265
1269
|
}, null, 8, ["choose-label"]),
|
|
1266
|
-
|
|
1270
|
+
c(r(w), {
|
|
1267
1271
|
severity: "secondary",
|
|
1268
1272
|
icon: "ri-cloud-line",
|
|
1269
1273
|
label: e.$t("pdfTools.sidebar.fromPristy"),
|
|
1270
|
-
onClick:
|
|
1274
|
+
onClick: _t
|
|
1271
1275
|
}, null, 8, ["label"])
|
|
1272
1276
|
])
|
|
1273
1277
|
]),
|
|
1274
|
-
s("div",
|
|
1278
|
+
s("div", ha, [
|
|
1275
1279
|
s("h3", null, f(e.$t("pdfTools.sidebar.addWatermark")), 1),
|
|
1276
|
-
|
|
1280
|
+
c(r(Be), {
|
|
1277
1281
|
modelValue: Ie.value,
|
|
1278
1282
|
"onUpdate:modelValue": l[2] || (l[2] = (t) => Ie.value = t),
|
|
1279
1283
|
placeholder: e.$t("pdfTools.sidebar.watermarkTextPlaceholder"),
|
|
1280
1284
|
type: "text"
|
|
1281
1285
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
1282
|
-
s("div",
|
|
1286
|
+
s("div", ba, [
|
|
1283
1287
|
s("div", null, [
|
|
1284
|
-
|
|
1288
|
+
c(r(ft), {
|
|
1285
1289
|
modelValue: nl.value,
|
|
1286
1290
|
"onUpdate:modelValue": l[3] || (l[3] = (t) => nl.value = t),
|
|
1287
1291
|
max: 360,
|
|
@@ -1291,7 +1295,7 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1291
1295
|
}, null, 8, ["modelValue", "placeholder"])
|
|
1292
1296
|
]),
|
|
1293
1297
|
s("div", null, [
|
|
1294
|
-
|
|
1298
|
+
c(r(ft), {
|
|
1295
1299
|
modelValue: Se.value,
|
|
1296
1300
|
"onUpdate:modelValue": l[4] || (l[4] = (t) => Se.value = t),
|
|
1297
1301
|
max: 10,
|
|
@@ -1300,80 +1304,81 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1300
1304
|
}, null, 8, ["modelValue", "placeholder"])
|
|
1301
1305
|
])
|
|
1302
1306
|
]),
|
|
1303
|
-
|
|
1307
|
+
c(r(w), {
|
|
1304
1308
|
disabled: !Ie.value || m.value.length === 0,
|
|
1305
1309
|
severity: "secondary",
|
|
1306
1310
|
class: "btn-mt",
|
|
1307
1311
|
icon: "ri-paint-brush-line",
|
|
1308
1312
|
label: e.$t("pdfTools.sidebar.addWatermarkButton"),
|
|
1309
|
-
onClick:
|
|
1313
|
+
onClick: Ht
|
|
1310
1314
|
}, null, 8, ["disabled", "label"])
|
|
1311
1315
|
])
|
|
1312
1316
|
])
|
|
1313
1317
|
])
|
|
1314
1318
|
]),
|
|
1315
|
-
s("div",
|
|
1319
|
+
s("div", wa, [
|
|
1316
1320
|
s("h2", null, f(e.$t("pdfTools.pagePreview.title")), 1),
|
|
1317
|
-
|
|
1321
|
+
c(r(Io), {
|
|
1318
1322
|
modelValue: F.value,
|
|
1319
1323
|
"onUpdate:modelValue": l[5] || (l[5] = (t) => F.value = t),
|
|
1320
1324
|
class: "page-grid",
|
|
1321
1325
|
"ghost-class": "ghost",
|
|
1322
1326
|
"item-key": "pageIndex",
|
|
1323
|
-
onEnd:
|
|
1327
|
+
onEnd: It
|
|
1324
1328
|
}, {
|
|
1325
|
-
default:
|
|
1326
|
-
(g(!0),
|
|
1329
|
+
default: A(() => [
|
|
1330
|
+
(g(!0), b(Ze, null, Qe(F.value, (t) => (g(), b("div", {
|
|
1327
1331
|
key: t.pageIndex,
|
|
1328
1332
|
class: "page-grid-item"
|
|
1329
1333
|
}, [
|
|
1330
1334
|
s("div", {
|
|
1331
|
-
class: q([{ selected:
|
|
1332
|
-
onClick: (n) =>
|
|
1333
|
-
onDblclick: ue((n) =>
|
|
1335
|
+
class: q([{ selected: Ml(t) }, "page-thumbnail"]),
|
|
1336
|
+
onClick: (n) => Ct(t),
|
|
1337
|
+
onDblclick: ue((n) => Bl(t), ["stop"])
|
|
1334
1338
|
}, [
|
|
1335
|
-
s("div",
|
|
1336
|
-
|
|
1339
|
+
s("div", xa, [
|
|
1340
|
+
c(r($o), {
|
|
1337
1341
|
binary: "",
|
|
1338
|
-
"model-value":
|
|
1342
|
+
"model-value": Ml(t)
|
|
1339
1343
|
}, null, 8, ["model-value"])
|
|
1340
1344
|
]),
|
|
1341
|
-
s("div",
|
|
1342
|
-
|
|
1345
|
+
s("div", Ea, [
|
|
1346
|
+
c(r(w), {
|
|
1343
1347
|
text: "",
|
|
1344
1348
|
rounded: "",
|
|
1345
1349
|
icon: "ri-clockwise-line",
|
|
1346
1350
|
"aria-label": e.$t("pdf.rotationRigth"),
|
|
1347
|
-
onClick: ue((n) =>
|
|
1351
|
+
onClick: ue((n) => St(t), ["stop"])
|
|
1348
1352
|
}, null, 8, ["aria-label", "onClick"]),
|
|
1349
|
-
|
|
1353
|
+
c(r(w), {
|
|
1350
1354
|
"aria-label": e.$t("pdfTools.pagePreview.openPagePreview", {
|
|
1351
1355
|
pageNumber: t.pageNumber
|
|
1352
1356
|
}),
|
|
1353
1357
|
text: "",
|
|
1354
1358
|
rounded: "",
|
|
1355
1359
|
icon: "ri-edit-box-line",
|
|
1356
|
-
onClick: ue((n) =>
|
|
1360
|
+
onClick: ue((n) => Bl(t), ["stop"])
|
|
1357
1361
|
}, null, 8, ["aria-label", "onClick"])
|
|
1358
1362
|
]),
|
|
1359
|
-
s("div",
|
|
1360
|
-
|
|
1363
|
+
s("div", Pa, [
|
|
1364
|
+
t.pageNumber <= r(_l) ? (g(), He(r(el), {
|
|
1365
|
+
key: 0,
|
|
1361
1366
|
annotations: !1,
|
|
1362
1367
|
page: t.pageNumber,
|
|
1363
|
-
pdf: r(
|
|
1368
|
+
pdf: r(je),
|
|
1364
1369
|
scale: 0.25,
|
|
1365
1370
|
text: !1
|
|
1366
|
-
}, null, 8, ["page", "pdf"])
|
|
1371
|
+
}, null, 8, ["page", "pdf"])) : D("", !0)
|
|
1367
1372
|
]),
|
|
1368
|
-
s("div",
|
|
1369
|
-
], 42,
|
|
1373
|
+
s("div", Ca, f(t.pageNumber), 1)
|
|
1374
|
+
], 42, Ta)
|
|
1370
1375
|
]))), 128))
|
|
1371
1376
|
]),
|
|
1372
1377
|
_: 1
|
|
1373
1378
|
}, 8, ["modelValue"])
|
|
1374
1379
|
])
|
|
1375
|
-
])) :
|
|
1376
|
-
|
|
1380
|
+
])) : D("", !0),
|
|
1381
|
+
c(r(ol), {
|
|
1377
1382
|
visible: N.value,
|
|
1378
1383
|
"onUpdate:visible": l[15] || (l[15] = (t) => N.value = t),
|
|
1379
1384
|
breakpoints: { "960px": "95vw", "640px": "100vw" },
|
|
@@ -1383,128 +1388,128 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1383
1388
|
modal: "",
|
|
1384
1389
|
class: "dialog-page-editor",
|
|
1385
1390
|
"content-class": "page-editor-dialog",
|
|
1386
|
-
onHide:
|
|
1391
|
+
onHide: Ol
|
|
1387
1392
|
}, {
|
|
1388
|
-
header:
|
|
1389
|
-
s("div",
|
|
1393
|
+
header: A(() => [
|
|
1394
|
+
s("div", ka, [
|
|
1390
1395
|
l[22] || (l[22] = s("i", {
|
|
1391
1396
|
class: "ri-file-fill",
|
|
1392
1397
|
"aria-hidden": "true"
|
|
1393
1398
|
}, null, -1)),
|
|
1394
1399
|
s("span", null, f(e.$t("pdfTools.pageEditor.title", {
|
|
1395
|
-
pageNumber: (H.value ||
|
|
1396
|
-
filename:
|
|
1400
|
+
pageNumber: (H.value || O.value)?.pageNumber || "",
|
|
1401
|
+
filename: ze.value
|
|
1397
1402
|
})), 1)
|
|
1398
1403
|
])
|
|
1399
1404
|
]),
|
|
1400
|
-
footer:
|
|
1401
|
-
s("div",
|
|
1405
|
+
footer: A(() => [
|
|
1406
|
+
s("div", Va, [
|
|
1402
1407
|
s("small", null, f(e.$t("pdfTools.pageEditor.footerHint")), 1)
|
|
1403
1408
|
])
|
|
1404
1409
|
]),
|
|
1405
|
-
default:
|
|
1406
|
-
s("div",
|
|
1407
|
-
|
|
1410
|
+
default: A(() => [
|
|
1411
|
+
s("div", Ia, [
|
|
1412
|
+
c(r(w), {
|
|
1408
1413
|
text: "",
|
|
1409
1414
|
icon: "ri-zoom-out-line",
|
|
1410
1415
|
"aria-label": e.$t("pdf.dezoom"),
|
|
1411
|
-
onClick:
|
|
1416
|
+
onClick: zt
|
|
1412
1417
|
}, null, 8, ["aria-label"]),
|
|
1413
|
-
|
|
1418
|
+
c(r(w), {
|
|
1414
1419
|
text: "",
|
|
1415
1420
|
icon: "ri-zoom-in-line",
|
|
1416
1421
|
"aria-label": e.$t("pdf.zoom"),
|
|
1417
|
-
onClick:
|
|
1422
|
+
onClick: Vt
|
|
1418
1423
|
}, null, 8, ["aria-label"]),
|
|
1419
|
-
|
|
1424
|
+
c(r(w), {
|
|
1420
1425
|
text: "",
|
|
1421
1426
|
label: e.$t("pdfTools.pageEditor.fit"),
|
|
1422
|
-
onClick:
|
|
1427
|
+
onClick: io
|
|
1423
1428
|
}, null, 8, ["label"]),
|
|
1424
|
-
s("span",
|
|
1429
|
+
s("span", Sa, f(Math.round(Q.value * 100)) + "%", 1),
|
|
1425
1430
|
l[23] || (l[23] = s("span", { class: "spacer" }, null, -1)),
|
|
1426
|
-
|
|
1431
|
+
c(r(w), {
|
|
1427
1432
|
text: "",
|
|
1428
1433
|
icon: "ri-close-line",
|
|
1429
1434
|
label: e.$t("pdfTools.pageEditor.close"),
|
|
1430
|
-
onClick:
|
|
1435
|
+
onClick: Ol
|
|
1431
1436
|
}, null, 8, ["label"])
|
|
1432
1437
|
]),
|
|
1433
|
-
s("div",
|
|
1434
|
-
s("div",
|
|
1438
|
+
s("div", $a, [
|
|
1439
|
+
s("div", Aa, [
|
|
1435
1440
|
s("h4", null, f(e.$t("pdfTools.pageEditor.tools.actions")), 1),
|
|
1436
|
-
|
|
1441
|
+
c(r(w), {
|
|
1437
1442
|
text: "",
|
|
1438
1443
|
severity: "secondary",
|
|
1439
|
-
class: q({ active:
|
|
1444
|
+
class: q({ active: k.value === d.SELECT }),
|
|
1440
1445
|
icon: "ri-cursor-line",
|
|
1441
1446
|
label: e.$t("pdfTools.pageEditor.tools.select"),
|
|
1442
1447
|
onClick: l[6] || (l[6] = (t) => Fe(d.SELECT))
|
|
1443
1448
|
}, null, 8, ["class", "label"]),
|
|
1444
|
-
|
|
1449
|
+
c(r(w), {
|
|
1445
1450
|
text: "",
|
|
1446
1451
|
severity: "secondary",
|
|
1447
|
-
class: q({ active:
|
|
1452
|
+
class: q({ active: k.value === d.REDACT }),
|
|
1448
1453
|
icon: "ri-eraser-fill",
|
|
1449
1454
|
label: e.$t("pdfTools.pageEditor.tools.redact"),
|
|
1450
1455
|
onClick: l[7] || (l[7] = (t) => Fe(d.REDACT))
|
|
1451
1456
|
}, null, 8, ["class", "label"]),
|
|
1452
|
-
|
|
1457
|
+
c(r(w), {
|
|
1453
1458
|
text: "",
|
|
1454
1459
|
severity: "secondary",
|
|
1455
|
-
class: q({ active:
|
|
1460
|
+
class: q({ active: k.value === d.HIGHLIGHT }),
|
|
1456
1461
|
icon: "ri-mark-pen-line",
|
|
1457
1462
|
label: e.$t("pdfTools.pageEditor.tools.highlight"),
|
|
1458
1463
|
onClick: l[8] || (l[8] = (t) => Fe(d.HIGHLIGHT))
|
|
1459
1464
|
}, null, 8, ["class", "label"]),
|
|
1460
|
-
|
|
1465
|
+
c(r(w), {
|
|
1461
1466
|
text: "",
|
|
1462
1467
|
severity: "secondary",
|
|
1463
|
-
class: q({ active:
|
|
1468
|
+
class: q({ active: k.value === d.COMMENT }),
|
|
1464
1469
|
icon: "ri-sticky-note-line",
|
|
1465
1470
|
label: e.$t("pdfTools.pageEditor.tools.comment"),
|
|
1466
1471
|
onClick: l[9] || (l[9] = (t) => Fe(d.COMMENT))
|
|
1467
1472
|
}, null, 8, ["class", "label"]),
|
|
1468
|
-
|
|
1473
|
+
c(r(pt), {
|
|
1469
1474
|
severity: "secondary",
|
|
1470
|
-
class: q({ active:
|
|
1475
|
+
class: q({ active: k.value === d.IMAGE }),
|
|
1471
1476
|
accept: "image/*",
|
|
1472
1477
|
"choose-label": e.$t("pdfTools.pageEditor.tools.image"),
|
|
1473
1478
|
mode: "basic",
|
|
1474
1479
|
name: "image",
|
|
1475
|
-
onSelect:
|
|
1480
|
+
onSelect: Wt
|
|
1476
1481
|
}, null, 8, ["class", "choose-label"]),
|
|
1477
|
-
|
|
1482
|
+
c(r(w), {
|
|
1478
1483
|
text: "",
|
|
1479
1484
|
severity: "secondary",
|
|
1480
|
-
class: q({ active:
|
|
1485
|
+
class: q({ active: k.value === d.SIGNATURE }),
|
|
1481
1486
|
icon: "ri-ball-pen-line",
|
|
1482
1487
|
label: e.$t("pdfTools.pageEditor.tools.signature"),
|
|
1483
|
-
onClick:
|
|
1488
|
+
onClick: Gt
|
|
1484
1489
|
}, null, 8, ["class", "label"]),
|
|
1485
|
-
|
|
1490
|
+
c(r(w), {
|
|
1486
1491
|
text: "",
|
|
1487
1492
|
severity: "secondary",
|
|
1488
|
-
class: q({ active:
|
|
1493
|
+
class: q({ active: k.value === d.TEXT }),
|
|
1489
1494
|
icon: "ri-font-size",
|
|
1490
1495
|
label: e.$t("pdfTools.pageEditor.tools.text"),
|
|
1491
1496
|
onClick: l[10] || (l[10] = (t) => Fe(d.TEXT))
|
|
1492
1497
|
}, null, 8, ["class", "label"]),
|
|
1493
|
-
|
|
1494
|
-
s("div",
|
|
1495
|
-
s("label",
|
|
1496
|
-
|
|
1498
|
+
qt.value ? (g(), b("div", _a, [
|
|
1499
|
+
s("div", Ma, [
|
|
1500
|
+
s("label", Fa, f(e.$t("pdfTools.pageEditor.tools.font")), 1),
|
|
1501
|
+
c(r(_o), {
|
|
1497
1502
|
modelValue: ae.value,
|
|
1498
1503
|
"onUpdate:modelValue": l[11] || (l[11] = (t) => ae.value = t),
|
|
1499
|
-
options:
|
|
1504
|
+
options: Tt,
|
|
1500
1505
|
class: "input-full",
|
|
1501
1506
|
optionLabel: "label",
|
|
1502
1507
|
optionValue: "value"
|
|
1503
1508
|
}, null, 8, ["modelValue"])
|
|
1504
1509
|
]),
|
|
1505
|
-
s("div",
|
|
1506
|
-
s("label",
|
|
1507
|
-
|
|
1510
|
+
s("div", Na, [
|
|
1511
|
+
s("label", Ra, f(e.$t("pdfTools.pageEditor.tools.size")) + " : " + f(oe.value), 1),
|
|
1512
|
+
c(r(Ao), {
|
|
1508
1513
|
id: "text-size-slider",
|
|
1509
1514
|
modelValue: oe.value,
|
|
1510
1515
|
"onUpdate:modelValue": l[12] || (l[12] = (t) => oe.value = t),
|
|
@@ -1513,56 +1518,56 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1513
1518
|
class: "input-full"
|
|
1514
1519
|
}, null, 8, ["modelValue"])
|
|
1515
1520
|
]),
|
|
1516
|
-
s("div",
|
|
1517
|
-
s("label",
|
|
1518
|
-
s("div",
|
|
1519
|
-
(g(),
|
|
1521
|
+
s("div", La, [
|
|
1522
|
+
s("label", Da, f(e.$t("pdfTools.pageEditor.tools.color")), 1),
|
|
1523
|
+
s("div", Ua, [
|
|
1524
|
+
(g(), b(Ze, null, Qe(xt, (t) => s("button", {
|
|
1520
1525
|
key: t.value,
|
|
1521
1526
|
type: "button",
|
|
1522
1527
|
class: q(["color-swatch", { selected: J.value === t.value }]),
|
|
1523
|
-
style:
|
|
1528
|
+
style: nt({ backgroundColor: t.value }),
|
|
1524
1529
|
"aria-label": e.$t(`pdfTools.pageEditor.colors.${t.name}`),
|
|
1525
1530
|
"aria-pressed": J.value === t.value,
|
|
1526
1531
|
onClick: (n) => J.value = t.value
|
|
1527
|
-
}, null, 14,
|
|
1532
|
+
}, null, 14, Ha)), 64))
|
|
1528
1533
|
]),
|
|
1529
|
-
s("label",
|
|
1534
|
+
s("label", Ba, [
|
|
1530
1535
|
De(s("input", {
|
|
1531
1536
|
"onUpdate:modelValue": l[13] || (l[13] = (t) => J.value = t),
|
|
1532
1537
|
type: "color",
|
|
1533
1538
|
class: "color-custom-input"
|
|
1534
1539
|
}, null, 512), [
|
|
1535
|
-
[
|
|
1540
|
+
[rt, J.value]
|
|
1536
1541
|
]),
|
|
1537
1542
|
s("span", null, f(e.$t("pdfTools.pageEditor.colors.custom")), 1)
|
|
1538
1543
|
])
|
|
1539
1544
|
])
|
|
1540
|
-
])) :
|
|
1541
|
-
|
|
1542
|
-
|
|
1545
|
+
])) : D("", !0),
|
|
1546
|
+
c(r(mt)),
|
|
1547
|
+
c(r(w), {
|
|
1543
1548
|
disabled: p.value.length === 0,
|
|
1544
1549
|
severity: "info",
|
|
1545
1550
|
class: "btn-full btn-mt-auto",
|
|
1546
1551
|
icon: "ri-check-line",
|
|
1547
1552
|
label: e.$t("pdfTools.pageEditor.apply"),
|
|
1548
|
-
onClick:
|
|
1553
|
+
onClick: ro
|
|
1549
1554
|
}, null, 8, ["disabled", "label"]),
|
|
1550
|
-
|
|
1555
|
+
c(r(w), {
|
|
1551
1556
|
disabled: p.value.length === 0,
|
|
1552
1557
|
severity: "warn",
|
|
1553
1558
|
class: "btn-full btn-mt-sm",
|
|
1554
1559
|
icon: "ri-arrow-go-back-line",
|
|
1555
1560
|
label: e.$t("pdfTools.pageEditor.cancel"),
|
|
1556
|
-
onClick:
|
|
1561
|
+
onClick: Xt
|
|
1557
1562
|
}, null, 8, ["disabled", "label"]),
|
|
1558
|
-
|
|
1563
|
+
W.value >= 0 ? (g(), He(r(w), {
|
|
1559
1564
|
key: 1,
|
|
1560
1565
|
severity: "danger",
|
|
1561
1566
|
class: "btn-full btn-mt-sm",
|
|
1562
1567
|
icon: "ri-delete-bin-line",
|
|
1563
1568
|
label: e.$t("pdfTools.pageEditor.deleteSelected"),
|
|
1564
|
-
onClick:
|
|
1565
|
-
}, null, 8, ["label"])) :
|
|
1569
|
+
onClick: Xl
|
|
1570
|
+
}, null, 8, ["label"])) : D("", !0)
|
|
1566
1571
|
]),
|
|
1567
1572
|
s("div", {
|
|
1568
1573
|
class: "page-editor-canvas",
|
|
@@ -1574,54 +1579,54 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1574
1579
|
ref: kl,
|
|
1575
1580
|
class: "pdf-canvas-wrapper"
|
|
1576
1581
|
}, [
|
|
1577
|
-
r(
|
|
1582
|
+
r(je) && (H.value || O.value) && (H.value || O.value).pageNumber <= r(_l) ? (g(), He(r(el), {
|
|
1578
1583
|
key: 0,
|
|
1579
1584
|
annotations: "",
|
|
1580
|
-
page: (H.value ||
|
|
1581
|
-
pdf: r(
|
|
1585
|
+
page: (H.value || O.value).pageNumber,
|
|
1586
|
+
pdf: r(je),
|
|
1582
1587
|
scale: Q.value,
|
|
1583
1588
|
text: !1,
|
|
1584
1589
|
class: "pdf-canvas-absolute"
|
|
1585
|
-
}, null, 8, ["page", "pdf", "scale"])) :
|
|
1590
|
+
}, null, 8, ["page", "pdf", "scale"])) : D("", !0),
|
|
1586
1591
|
s("canvas", {
|
|
1587
1592
|
ref_key: "overlayCanvas",
|
|
1588
|
-
ref:
|
|
1593
|
+
ref: B,
|
|
1589
1594
|
class: "overlay-canvas",
|
|
1590
|
-
onDblclick:
|
|
1591
|
-
onMousedown:
|
|
1592
|
-
onMouseleave:
|
|
1593
|
-
onMousemove:
|
|
1594
|
-
onMouseup:
|
|
1595
|
+
onDblclick: Qt,
|
|
1596
|
+
onMousedown: lo,
|
|
1597
|
+
onMouseleave: ao,
|
|
1598
|
+
onMousemove: to,
|
|
1599
|
+
onMouseup: oo
|
|
1595
1600
|
}, null, 544),
|
|
1596
|
-
|
|
1601
|
+
$.value.visible ? De((g(), b("textarea", {
|
|
1597
1602
|
key: 1,
|
|
1598
1603
|
ref_key: "textEditorInput",
|
|
1599
1604
|
ref: Il,
|
|
1600
|
-
"onUpdate:modelValue": l[14] || (l[14] = (t) =>
|
|
1601
|
-
"aria-label":
|
|
1602
|
-
placeholder:
|
|
1603
|
-
style:
|
|
1605
|
+
"onUpdate:modelValue": l[14] || (l[14] = (t) => $.value.value = t),
|
|
1606
|
+
"aria-label": Yl.value.label,
|
|
1607
|
+
placeholder: Yl.value.placeholder,
|
|
1608
|
+
style: nt(Kt.value),
|
|
1604
1609
|
class: "text-editor-input",
|
|
1605
1610
|
onBlur: vl,
|
|
1606
|
-
onKeydown:
|
|
1607
|
-
}, null, 44,
|
|
1608
|
-
[
|
|
1609
|
-
]) :
|
|
1611
|
+
onKeydown: it(ue(vl, ["ctrl", "prevent"]), ["enter"])
|
|
1612
|
+
}, null, 44, Oa)), [
|
|
1613
|
+
[rt, $.value.value]
|
|
1614
|
+
]) : D("", !0)
|
|
1610
1615
|
], 512)
|
|
1611
1616
|
], 32)
|
|
1612
1617
|
])
|
|
1613
1618
|
]),
|
|
1614
1619
|
_: 1
|
|
1615
1620
|
}, 8, ["visible"]),
|
|
1616
|
-
|
|
1621
|
+
c(r(ol), {
|
|
1617
1622
|
visible: ve.value,
|
|
1618
1623
|
"onUpdate:visible": l[16] || (l[16] = (t) => ve.value = t),
|
|
1619
1624
|
modal: "",
|
|
1620
1625
|
class: "dialog-signature-pad",
|
|
1621
|
-
onHide:
|
|
1626
|
+
onHide: uo
|
|
1622
1627
|
}, {
|
|
1623
|
-
header:
|
|
1624
|
-
s("div",
|
|
1628
|
+
header: A(() => [
|
|
1629
|
+
s("div", za, [
|
|
1625
1630
|
l[24] || (l[24] = s("i", {
|
|
1626
1631
|
class: "ri-ball-pen-line",
|
|
1627
1632
|
"aria-hidden": "true"
|
|
@@ -1629,113 +1634,113 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1629
1634
|
s("span", null, f(e.$t("pdfTools.signaturePad.title")), 1)
|
|
1630
1635
|
])
|
|
1631
1636
|
]),
|
|
1632
|
-
footer:
|
|
1633
|
-
s("div",
|
|
1634
|
-
|
|
1637
|
+
footer: A(() => [
|
|
1638
|
+
s("div", Ga, [
|
|
1639
|
+
c(r(w), {
|
|
1635
1640
|
text: "",
|
|
1636
1641
|
label: e.$t("pdfTools.signaturePad.clear"),
|
|
1637
|
-
onClick:
|
|
1642
|
+
onClick: Ql
|
|
1638
1643
|
}, null, 8, ["label"]),
|
|
1639
|
-
|
|
1644
|
+
c(r(w), {
|
|
1640
1645
|
text: "",
|
|
1641
1646
|
label: e.$t("pdfTools.signaturePad.use"),
|
|
1642
|
-
onClick:
|
|
1647
|
+
onClick: mo
|
|
1643
1648
|
}, null, 8, ["label"])
|
|
1644
1649
|
])
|
|
1645
1650
|
]),
|
|
1646
|
-
default:
|
|
1647
|
-
s("div",
|
|
1651
|
+
default: A(() => [
|
|
1652
|
+
s("div", Wa, [
|
|
1648
1653
|
s("canvas", {
|
|
1649
1654
|
ref_key: "signaturePadCanvas",
|
|
1650
1655
|
ref: fe,
|
|
1651
1656
|
class: "signature-canvas",
|
|
1652
|
-
onMousedown:
|
|
1657
|
+
onMousedown: ql,
|
|
1653
1658
|
onMouseleave: fl,
|
|
1654
|
-
onMousemove:
|
|
1659
|
+
onMousemove: Jl,
|
|
1655
1660
|
onMouseup: fl,
|
|
1656
|
-
onTouchstart: ue(
|
|
1657
|
-
onTouchmove: ue(
|
|
1661
|
+
onTouchstart: ue(vo, ["prevent"]),
|
|
1662
|
+
onTouchmove: ue(fo, ["prevent"]),
|
|
1658
1663
|
onTouchend: ue(fl, ["prevent"])
|
|
1659
1664
|
}, null, 544)
|
|
1660
1665
|
])
|
|
1661
1666
|
]),
|
|
1662
1667
|
_: 1
|
|
1663
1668
|
}, 8, ["visible"]),
|
|
1664
|
-
|
|
1669
|
+
c(Go, {
|
|
1665
1670
|
"default-filename": $l.value,
|
|
1666
|
-
visible:
|
|
1667
|
-
"parent-folder-node":
|
|
1668
|
-
onClose: l[17] || (l[17] = (t) =>
|
|
1669
|
-
onSave:
|
|
1671
|
+
visible: Ve.value,
|
|
1672
|
+
"parent-folder-node": Ge.value,
|
|
1673
|
+
onClose: l[17] || (l[17] = (t) => Ve.value = !1),
|
|
1674
|
+
onSave: Ot
|
|
1670
1675
|
}, null, 8, ["default-filename", "visible", "parent-folder-node"]),
|
|
1671
|
-
|
|
1676
|
+
c(r(ol), {
|
|
1672
1677
|
visible: $e.value,
|
|
1673
1678
|
modal: "",
|
|
1674
1679
|
header: e.$t("pdfTools.insertFromAlfresco.title"),
|
|
1675
1680
|
class: "dialog-insert-pdf",
|
|
1676
1681
|
"onUpdate:visible": l[21] || (l[21] = (t) => $e.value = !1)
|
|
1677
1682
|
}, {
|
|
1678
|
-
footer:
|
|
1679
|
-
s("div",
|
|
1680
|
-
s("div",
|
|
1681
|
-
|
|
1682
|
-
s("span",
|
|
1683
|
-
De((g(),
|
|
1684
|
-
le(f(
|
|
1683
|
+
footer: A(() => [
|
|
1684
|
+
s("div", $s, [
|
|
1685
|
+
s("div", As, [
|
|
1686
|
+
V.value ? (g(), b("div", _s, [
|
|
1687
|
+
s("span", Ms, f(e.$t("pdfTools.insertFromAlfresco.selected")), 1),
|
|
1688
|
+
De((g(), b("span", Fs, [
|
|
1689
|
+
le(f(V.value?.name), 1)
|
|
1685
1690
|
])), [
|
|
1686
1691
|
[
|
|
1687
1692
|
o,
|
|
1688
|
-
|
|
1693
|
+
V.value?.name,
|
|
1689
1694
|
void 0,
|
|
1690
1695
|
{ top: !0 }
|
|
1691
1696
|
]
|
|
1692
1697
|
])
|
|
1693
|
-
])) :
|
|
1694
|
-
ne.value ? (g(),
|
|
1698
|
+
])) : D("", !0),
|
|
1699
|
+
ne.value ? (g(), b("div", Ns, f(ne.value), 1)) : D("", !0)
|
|
1695
1700
|
]),
|
|
1696
|
-
s("div",
|
|
1697
|
-
|
|
1701
|
+
s("div", Rs, [
|
|
1702
|
+
c(r(w), {
|
|
1698
1703
|
label: e.$t("pdfTools.insertFromAlfresco.cancel"),
|
|
1699
1704
|
text: "",
|
|
1700
1705
|
onClick: l[20] || (l[20] = (t) => $e.value = !1)
|
|
1701
1706
|
}, null, 8, ["label"]),
|
|
1702
|
-
|
|
1703
|
-
disabled: !
|
|
1707
|
+
c(r(w), {
|
|
1708
|
+
disabled: !Pt.value,
|
|
1704
1709
|
label: e.$t("pdfTools.insertFromAlfresco.insert"),
|
|
1705
1710
|
icon: "ri-add-line",
|
|
1706
|
-
onClick:
|
|
1711
|
+
onClick: Ft
|
|
1707
1712
|
}, null, 8, ["disabled", "label"])
|
|
1708
1713
|
])
|
|
1709
1714
|
])
|
|
1710
1715
|
]),
|
|
1711
|
-
default:
|
|
1712
|
-
|
|
1716
|
+
default: A(() => [
|
|
1717
|
+
c(r(Mo), {
|
|
1713
1718
|
value: 0,
|
|
1714
|
-
"onUpdate:value":
|
|
1719
|
+
"onUpdate:value": Mt
|
|
1715
1720
|
}, {
|
|
1716
|
-
default:
|
|
1717
|
-
|
|
1718
|
-
default:
|
|
1719
|
-
|
|
1720
|
-
default:
|
|
1721
|
+
default: A(() => [
|
|
1722
|
+
c(r(Fo), null, {
|
|
1723
|
+
default: A(() => [
|
|
1724
|
+
c(r(ll), { value: 0 }, {
|
|
1725
|
+
default: A(() => [
|
|
1721
1726
|
le(f(e.$t("pdfTools.insertFromAlfresco.browse")), 1)
|
|
1722
1727
|
]),
|
|
1723
1728
|
_: 1
|
|
1724
1729
|
}),
|
|
1725
|
-
|
|
1726
|
-
default:
|
|
1730
|
+
c(r(ll), { value: 1 }, {
|
|
1731
|
+
default: A(() => [
|
|
1727
1732
|
le(f(e.$t("pdfTools.insertFromAlfresco.search")), 1)
|
|
1728
1733
|
]),
|
|
1729
1734
|
_: 1
|
|
1730
1735
|
}),
|
|
1731
|
-
|
|
1732
|
-
default:
|
|
1736
|
+
c(r(ll), { value: 2 }, {
|
|
1737
|
+
default: A(() => [
|
|
1733
1738
|
le(f(e.$t("pdfTools.insertFromAlfresco.favorites")), 1)
|
|
1734
1739
|
]),
|
|
1735
1740
|
_: 1
|
|
1736
1741
|
}),
|
|
1737
|
-
|
|
1738
|
-
default:
|
|
1742
|
+
c(r(ll), { value: 3 }, {
|
|
1743
|
+
default: A(() => [
|
|
1739
1744
|
le(f(e.$t("pdfTools.insertFromAlfresco.linkOrId")), 1)
|
|
1740
1745
|
]),
|
|
1741
1746
|
_: 1
|
|
@@ -1743,54 +1748,54 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1743
1748
|
]),
|
|
1744
1749
|
_: 1
|
|
1745
1750
|
}),
|
|
1746
|
-
|
|
1747
|
-
default:
|
|
1748
|
-
|
|
1749
|
-
default:
|
|
1750
|
-
|
|
1751
|
+
c(r(No), null, {
|
|
1752
|
+
default: A(() => [
|
|
1753
|
+
c(r(tl), { value: 0 }, {
|
|
1754
|
+
default: A(() => [
|
|
1755
|
+
c(wt, {
|
|
1751
1756
|
showUserHome: "",
|
|
1752
1757
|
showFiles: "",
|
|
1753
|
-
onSelectNode:
|
|
1758
|
+
onSelectNode: Nt
|
|
1754
1759
|
})
|
|
1755
1760
|
]),
|
|
1756
1761
|
_: 1
|
|
1757
1762
|
}),
|
|
1758
|
-
|
|
1759
|
-
default:
|
|
1760
|
-
s("div",
|
|
1761
|
-
|
|
1763
|
+
c(r(tl), { value: 1 }, {
|
|
1764
|
+
default: A(() => [
|
|
1765
|
+
s("div", Xa, [
|
|
1766
|
+
c(r(Be), {
|
|
1762
1767
|
modelValue: Ae.value,
|
|
1763
1768
|
"onUpdate:modelValue": l[18] || (l[18] = (t) => Ae.value = t),
|
|
1764
1769
|
placeholder: e.$t("pdfTools.insertFromAlfresco.searchPlaceholder"),
|
|
1765
|
-
onKeyup:
|
|
1770
|
+
onKeyup: it(Ll, ["enter"])
|
|
1766
1771
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
1767
|
-
|
|
1772
|
+
c(r(w), {
|
|
1768
1773
|
icon: "ri-search-line",
|
|
1769
1774
|
"aria-label": e.$t("search"),
|
|
1770
1775
|
onClick: Ll
|
|
1771
1776
|
}, null, 8, ["aria-label"])
|
|
1772
1777
|
]),
|
|
1773
|
-
rl.value ? (g(),
|
|
1774
|
-
|
|
1778
|
+
rl.value ? (g(), b("div", Ya, [
|
|
1779
|
+
c(r(Ue), {
|
|
1775
1780
|
class: "spinner-sm",
|
|
1776
1781
|
strokeWidth: "8"
|
|
1777
1782
|
}),
|
|
1778
1783
|
s("span", null, f(e.$t("pdfTools.insertFromAlfresco.searching")), 1)
|
|
1779
|
-
])) : !me.value.length && Al.value ? (g(),
|
|
1780
|
-
s("div",
|
|
1781
|
-
(g(!0),
|
|
1784
|
+
])) : !me.value.length && Al.value ? (g(), b("div", ja, f(e.$t("pdfTools.insertFromAlfresco.noPdfFound")), 1)) : me.value.length ? (g(), b("div", Ka, [
|
|
1785
|
+
s("div", qa, [
|
|
1786
|
+
(g(!0), b(Ze, null, Qe(me.value, (t) => (g(), b("div", {
|
|
1782
1787
|
key: t.id,
|
|
1783
1788
|
class: q(["favorite-item", {
|
|
1784
|
-
"favorite-item-selected":
|
|
1789
|
+
"favorite-item-selected": V.value?.id === t.id
|
|
1785
1790
|
}]),
|
|
1786
1791
|
onClick: (n) => il(t)
|
|
1787
1792
|
}, [
|
|
1788
|
-
s("div",
|
|
1793
|
+
s("div", Za, [
|
|
1789
1794
|
l[25] || (l[25] = s("i", {
|
|
1790
1795
|
class: "ri-file-pdf-line",
|
|
1791
1796
|
"aria-hidden": "true"
|
|
1792
1797
|
}, null, -1)),
|
|
1793
|
-
De((g(),
|
|
1798
|
+
De((g(), b("span", Qa, [
|
|
1794
1799
|
le(f(t.name), 1)
|
|
1795
1800
|
])), [
|
|
1796
1801
|
[
|
|
@@ -1801,18 +1806,18 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1801
1806
|
]
|
|
1802
1807
|
])
|
|
1803
1808
|
])
|
|
1804
|
-
], 10,
|
|
1809
|
+
], 10, Ja))), 128))
|
|
1805
1810
|
]),
|
|
1806
|
-
s("div",
|
|
1807
|
-
|
|
1808
|
-
|
|
1811
|
+
s("div", es, [
|
|
1812
|
+
V.value ? Ye.value ? (g(), b("div", os, [
|
|
1813
|
+
c(r(Ue), {
|
|
1809
1814
|
class: "spinner-md",
|
|
1810
1815
|
strokeWidth: "6"
|
|
1811
1816
|
}),
|
|
1812
|
-
s("p",
|
|
1813
|
-
])) : r(Me) ? (g(),
|
|
1814
|
-
j.value > 0 ? (g(),
|
|
1815
|
-
|
|
1817
|
+
s("p", as, f(e.$t("pdfTools.insertFromAlfresco.loadingPreview")), 1)
|
|
1818
|
+
])) : r(Me) ? (g(), b("div", ss, [
|
|
1819
|
+
j.value > 0 ? (g(), b("div", ns, [
|
|
1820
|
+
c(r(w), {
|
|
1816
1821
|
icon: "ri-arrow-left-s-line",
|
|
1817
1822
|
"aria-label": e.$t("pdf.previousPage"),
|
|
1818
1823
|
text: "",
|
|
@@ -1820,8 +1825,8 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1820
1825
|
disabled: X.value <= 1,
|
|
1821
1826
|
onClick: Rl
|
|
1822
1827
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1823
|
-
s("span",
|
|
1824
|
-
|
|
1828
|
+
s("span", rs, f(X.value) + " / " + f(j.value), 1),
|
|
1829
|
+
c(r(w), {
|
|
1825
1830
|
icon: "ri-arrow-right-s-line",
|
|
1826
1831
|
"aria-label": e.$t("pdf.nextPage"),
|
|
1827
1832
|
text: "",
|
|
@@ -1829,9 +1834,9 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1829
1834
|
disabled: X.value >= j.value,
|
|
1830
1835
|
onClick: Nl
|
|
1831
1836
|
}, null, 8, ["aria-label", "disabled"])
|
|
1832
|
-
])) :
|
|
1833
|
-
s("div",
|
|
1834
|
-
|
|
1837
|
+
])) : D("", !0),
|
|
1838
|
+
s("div", is, [
|
|
1839
|
+
c(r(el), {
|
|
1835
1840
|
pdf: r(Me),
|
|
1836
1841
|
page: X.value,
|
|
1837
1842
|
scale: 0.6,
|
|
@@ -1839,41 +1844,41 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1839
1844
|
text: !1
|
|
1840
1845
|
}, null, 8, ["pdf", "page"])
|
|
1841
1846
|
])
|
|
1842
|
-
])) :
|
|
1847
|
+
])) : D("", !0) : (g(), b("div", ls, [
|
|
1843
1848
|
l[26] || (l[26] = s("i", {
|
|
1844
1849
|
class: "ri-file-pdf-line preview-icon",
|
|
1845
1850
|
"aria-hidden": "true"
|
|
1846
1851
|
}, null, -1)),
|
|
1847
|
-
s("p",
|
|
1852
|
+
s("p", ts, f(e.$t("pdfTools.insertFromAlfresco.selectPdfToPreview")), 1)
|
|
1848
1853
|
]))
|
|
1849
1854
|
])
|
|
1850
|
-
])) :
|
|
1855
|
+
])) : D("", !0)
|
|
1851
1856
|
]),
|
|
1852
1857
|
_: 1
|
|
1853
1858
|
}),
|
|
1854
|
-
|
|
1855
|
-
default:
|
|
1856
|
-
|
|
1857
|
-
|
|
1859
|
+
c(r(tl), { value: 2 }, {
|
|
1860
|
+
default: A(() => [
|
|
1861
|
+
Xe.value ? (g(), b("div", cs, [
|
|
1862
|
+
c(r(Ue), {
|
|
1858
1863
|
class: "spinner-sm",
|
|
1859
1864
|
strokeWidth: "8"
|
|
1860
1865
|
}),
|
|
1861
1866
|
s("span", null, f(e.$t("pdfTools.insertFromAlfresco.loading")), 1)
|
|
1862
|
-
])) : _e.value.length ? (g(),
|
|
1863
|
-
s("div",
|
|
1864
|
-
(g(!0),
|
|
1867
|
+
])) : _e.value.length ? (g(), b("div", us, [
|
|
1868
|
+
s("div", vs, [
|
|
1869
|
+
(g(!0), b(Ze, null, Qe(_e.value, (t) => (g(), b("div", {
|
|
1865
1870
|
key: t.id,
|
|
1866
1871
|
class: q(["favorite-item", {
|
|
1867
|
-
"favorite-item-selected":
|
|
1872
|
+
"favorite-item-selected": V.value?.id === t.id
|
|
1868
1873
|
}]),
|
|
1869
1874
|
onClick: (n) => il(t)
|
|
1870
1875
|
}, [
|
|
1871
|
-
s("div",
|
|
1876
|
+
s("div", ps, [
|
|
1872
1877
|
l[27] || (l[27] = s("i", {
|
|
1873
1878
|
class: "ri-file-pdf-line",
|
|
1874
1879
|
"aria-hidden": "true"
|
|
1875
1880
|
}, null, -1)),
|
|
1876
|
-
De((g(),
|
|
1881
|
+
De((g(), b("span", ms, [
|
|
1877
1882
|
le(f(t.name), 1)
|
|
1878
1883
|
])), [
|
|
1879
1884
|
[
|
|
@@ -1884,18 +1889,18 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1884
1889
|
]
|
|
1885
1890
|
])
|
|
1886
1891
|
])
|
|
1887
|
-
], 10,
|
|
1892
|
+
], 10, fs))), 128))
|
|
1888
1893
|
]),
|
|
1889
|
-
s("div",
|
|
1890
|
-
|
|
1891
|
-
|
|
1894
|
+
s("div", gs, [
|
|
1895
|
+
V.value ? Ye.value ? (g(), b("div", bs, [
|
|
1896
|
+
c(r(Ue), {
|
|
1892
1897
|
class: "spinner-md",
|
|
1893
1898
|
strokeWidth: "6"
|
|
1894
1899
|
}),
|
|
1895
|
-
s("p",
|
|
1896
|
-
])) : r(Me) ? (g(),
|
|
1897
|
-
j.value > 0 ? (g(),
|
|
1898
|
-
|
|
1900
|
+
s("p", ws, f(e.$t("pdfTools.insertFromAlfresco.loadingPreview")), 1)
|
|
1901
|
+
])) : r(Me) ? (g(), b("div", Ts, [
|
|
1902
|
+
j.value > 0 ? (g(), b("div", xs, [
|
|
1903
|
+
c(r(w), {
|
|
1899
1904
|
icon: "ri-arrow-left-s-line",
|
|
1900
1905
|
"aria-label": e.$t("pdf.previousPage"),
|
|
1901
1906
|
text: "",
|
|
@@ -1903,8 +1908,8 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1903
1908
|
disabled: X.value <= 1,
|
|
1904
1909
|
onClick: Rl
|
|
1905
1910
|
}, null, 8, ["aria-label", "disabled"]),
|
|
1906
|
-
s("span",
|
|
1907
|
-
|
|
1911
|
+
s("span", Es, f(X.value) + " / " + f(j.value), 1),
|
|
1912
|
+
c(r(w), {
|
|
1908
1913
|
icon: "ri-arrow-right-s-line",
|
|
1909
1914
|
"aria-label": e.$t("pdf.nextPage"),
|
|
1910
1915
|
text: "",
|
|
@@ -1912,9 +1917,9 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1912
1917
|
disabled: X.value >= j.value,
|
|
1913
1918
|
onClick: Nl
|
|
1914
1919
|
}, null, 8, ["aria-label", "disabled"])
|
|
1915
|
-
])) :
|
|
1916
|
-
s("div",
|
|
1917
|
-
|
|
1920
|
+
])) : D("", !0),
|
|
1921
|
+
s("div", Ps, [
|
|
1922
|
+
c(r(el), {
|
|
1918
1923
|
pdf: r(Me),
|
|
1919
1924
|
page: X.value,
|
|
1920
1925
|
scale: 0.6,
|
|
@@ -1922,30 +1927,30 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1922
1927
|
text: !1
|
|
1923
1928
|
}, null, 8, ["pdf", "page"])
|
|
1924
1929
|
])
|
|
1925
|
-
])) :
|
|
1930
|
+
])) : D("", !0) : (g(), b("div", ys, [
|
|
1926
1931
|
l[28] || (l[28] = s("i", {
|
|
1927
1932
|
class: "ri-file-pdf-line preview-icon",
|
|
1928
1933
|
"aria-hidden": "true"
|
|
1929
1934
|
}, null, -1)),
|
|
1930
|
-
s("p",
|
|
1935
|
+
s("p", hs, f(e.$t("pdfTools.insertFromAlfresco.selectPdfToPreview")), 1)
|
|
1931
1936
|
]))
|
|
1932
1937
|
])
|
|
1933
|
-
])) : (g(),
|
|
1938
|
+
])) : (g(), b("div", ds, f(e.$t("pdfTools.insertFromAlfresco.noPdfFavorite")), 1))
|
|
1934
1939
|
]),
|
|
1935
1940
|
_: 1
|
|
1936
1941
|
}),
|
|
1937
|
-
|
|
1938
|
-
default:
|
|
1939
|
-
s("div",
|
|
1940
|
-
s("div",
|
|
1941
|
-
s("label",
|
|
1942
|
-
|
|
1942
|
+
c(r(tl), { value: 3 }, {
|
|
1943
|
+
default: A(() => [
|
|
1944
|
+
s("div", Cs, [
|
|
1945
|
+
s("div", ks, [
|
|
1946
|
+
s("label", Is, f(e.$t("pdfTools.insertFromAlfresco.alfrescoIdUrl")), 1),
|
|
1947
|
+
c(r(Be), {
|
|
1943
1948
|
id: "alfrescoNodeId",
|
|
1944
1949
|
modelValue: se.value,
|
|
1945
1950
|
"onUpdate:modelValue": l[19] || (l[19] = (t) => se.value = t),
|
|
1946
1951
|
placeholder: e.$t("pdfTools.insertFromAlfresco.alfrescoIdUrlHint")
|
|
1947
1952
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
1948
|
-
s("small",
|
|
1953
|
+
s("small", Ss, f(e.$t("pdfTools.insertFromAlfresco.alfrescoIdUrlHint")), 1)
|
|
1949
1954
|
])
|
|
1950
1955
|
])
|
|
1951
1956
|
]),
|
|
@@ -1963,8 +1968,8 @@ const Ro = { class: "save-as-form" }, Lo = { class: "form-field" }, Do = { for:
|
|
|
1963
1968
|
]);
|
|
1964
1969
|
};
|
|
1965
1970
|
}
|
|
1966
|
-
},
|
|
1971
|
+
}, rn = /* @__PURE__ */ bt(Ls, [["__scopeId", "data-v-8c87c247"]]);
|
|
1967
1972
|
export {
|
|
1968
|
-
|
|
1973
|
+
rn as default
|
|
1969
1974
|
};
|
|
1970
|
-
//# sourceMappingURL=PdfToolsComponent-
|
|
1975
|
+
//# sourceMappingURL=PdfToolsComponent-CXuz7xuL.js.map
|