@progress/kendo-pdfviewer-common 0.3.0-dev.202409251459 → 0.3.0-dev.202410100645
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/es/annotations/annotation-editor-layer-builder.js +139 -0
- package/dist/es/annotations/annotation-editor-layer.js +780 -0
- package/dist/es/annotations/annotation-editor-ui-manager.js +1690 -0
- package/dist/es/annotations/annotation-layer-builder.js +217 -0
- package/dist/es/annotations/annotation-layer.js +2793 -0
- package/dist/es/annotations/draw-layer-builder.js +65 -0
- package/dist/es/annotations/draw-layer.js +220 -0
- package/dist/es/annotations/editors/annotation-editor.js +1519 -0
- package/dist/es/annotations/editors/free-text-editor.js +783 -0
- package/dist/es/annotations/editors/highlight-editor.js +717 -0
- package/dist/es/annotations/editors/outliner.js +747 -0
- package/dist/es/annotations/helpers/annotation-storage.js +294 -0
- package/dist/es/annotations/helpers/color-manager.js +72 -0
- package/dist/es/annotations/helpers/command-manager.js +133 -0
- package/dist/es/annotations/helpers/id-manager.js +34 -0
- package/dist/es/annotations/helpers/image-manager.js +176 -0
- package/dist/es/annotations/helpers/text-accessibility-manager.js +212 -0
- package/dist/es/annotations/helpers/tools.js +19 -0
- package/dist/es/annotations/shared/display_utils.js +1024 -0
- package/dist/es/annotations/shared/event_utils.js +213 -0
- package/dist/es/annotations/shared/murmurhash3.js +126 -0
- package/dist/es/annotations/shared/scripting_utils.js +90 -0
- package/dist/es/annotations/shared/ui_utils.js +823 -0
- package/dist/es/annotations/shared/utils.js +909 -0
- package/dist/es/common/component.js +33 -0
- package/dist/es/common/core.js +91 -0
- package/dist/es/common/dom.js +11 -0
- package/dist/es/common/main.js +4 -0
- package/dist/es/common/math.js +1 -0
- package/dist/es/enums/PdfViewerInteractionMode.js +6 -0
- package/dist/es/links/link-service.js +505 -0
- package/dist/es/main.js +2 -0
- package/dist/es/scroller.js +29 -30
- package/dist/es/text/text-layer-builder.js +288 -0
- package/dist/es/utils.js +5 -5
- package/dist/es/widget/page.js +762 -0
- package/dist/es/widget/pdfviewer.js +1659 -0
- package/dist/es2015/annotations/annotation-editor-layer-builder.js +139 -0
- package/dist/es2015/annotations/annotation-editor-layer.js +780 -0
- package/dist/es2015/annotations/annotation-editor-ui-manager.js +1690 -0
- package/dist/es2015/annotations/annotation-layer-builder.js +217 -0
- package/dist/es2015/annotations/annotation-layer.js +2793 -0
- package/dist/es2015/annotations/draw-layer-builder.js +65 -0
- package/dist/es2015/annotations/draw-layer.js +220 -0
- package/dist/es2015/annotations/editors/annotation-editor.js +1519 -0
- package/dist/es2015/annotations/editors/free-text-editor.js +783 -0
- package/dist/es2015/annotations/editors/highlight-editor.js +717 -0
- package/dist/es2015/annotations/editors/outliner.js +747 -0
- package/dist/es2015/annotations/helpers/annotation-storage.js +294 -0
- package/dist/es2015/annotations/helpers/color-manager.js +72 -0
- package/dist/es2015/annotations/helpers/command-manager.js +133 -0
- package/dist/es2015/annotations/helpers/id-manager.js +34 -0
- package/dist/es2015/annotations/helpers/image-manager.js +176 -0
- package/dist/es2015/annotations/helpers/text-accessibility-manager.js +212 -0
- package/dist/es2015/annotations/helpers/tools.js +19 -0
- package/dist/es2015/annotations/shared/display_utils.js +1024 -0
- package/dist/es2015/annotations/shared/event_utils.js +213 -0
- package/dist/es2015/annotations/shared/murmurhash3.js +126 -0
- package/dist/es2015/annotations/shared/scripting_utils.js +90 -0
- package/dist/es2015/annotations/shared/ui_utils.js +823 -0
- package/dist/es2015/annotations/shared/utils.js +909 -0
- package/dist/es2015/common/component.js +33 -0
- package/dist/es2015/common/core.js +91 -0
- package/dist/es2015/common/dom.js +11 -0
- package/dist/es2015/common/main.js +4 -0
- package/dist/es2015/common/math.js +1 -0
- package/dist/es2015/enums/PdfViewerInteractionMode.js +6 -0
- package/dist/es2015/links/link-service.js +505 -0
- package/dist/es2015/main.js +2 -0
- package/dist/es2015/scroller.js +29 -30
- package/dist/es2015/text/text-layer-builder.js +288 -0
- package/dist/es2015/utils.js +5 -5
- package/dist/es2015/widget/page.js +762 -0
- package/dist/es2015/widget/pdfviewer.js +1659 -0
- package/dist/npm/annotations/annotation-editor-layer-builder.d.ts +39 -0
- package/dist/npm/annotations/annotation-editor-layer-builder.js +142 -0
- package/dist/npm/annotations/annotation-editor-layer.d.ts +196 -0
- package/dist/npm/annotations/annotation-editor-layer.js +783 -0
- package/dist/npm/annotations/annotation-editor-ui-manager.d.ts +281 -0
- package/dist/npm/annotations/annotation-editor-ui-manager.js +1694 -0
- package/dist/npm/annotations/annotation-layer-builder.d.ts +58 -0
- package/dist/npm/annotations/annotation-layer-builder.js +220 -0
- package/dist/npm/annotations/annotation-layer.d.ts +134 -0
- package/dist/npm/annotations/annotation-layer.js +2794 -0
- package/dist/npm/annotations/draw-layer-builder.d.ts +21 -0
- package/dist/npm/annotations/draw-layer-builder.js +68 -0
- package/dist/npm/annotations/draw-layer.d.ts +33 -0
- package/dist/npm/annotations/draw-layer.js +223 -0
- package/dist/npm/annotations/editors/annotation-editor.d.ts +349 -0
- package/dist/npm/annotations/editors/annotation-editor.js +1523 -0
- package/dist/npm/annotations/editors/free-text-editor.d.ts +108 -0
- package/dist/npm/annotations/editors/free-text-editor.js +786 -0
- package/dist/npm/annotations/editors/highlight-editor.d.ts +114 -0
- package/dist/npm/annotations/editors/highlight-editor.js +717 -0
- package/dist/npm/annotations/editors/outliner.d.ts +51 -0
- package/dist/npm/annotations/editors/outliner.js +750 -0
- package/dist/npm/annotations/helpers/annotation-storage.d.ts +98 -0
- package/dist/npm/annotations/helpers/annotation-storage.js +299 -0
- package/dist/npm/annotations/helpers/color-manager.d.ts +6 -0
- package/dist/npm/annotations/helpers/color-manager.js +76 -0
- package/dist/npm/annotations/helpers/command-manager.d.ts +42 -0
- package/dist/npm/annotations/helpers/command-manager.js +137 -0
- package/dist/npm/annotations/helpers/id-manager.d.ts +6 -0
- package/dist/npm/annotations/helpers/id-manager.js +38 -0
- package/dist/npm/annotations/helpers/image-manager.d.ts +18 -0
- package/dist/npm/annotations/helpers/image-manager.js +180 -0
- package/dist/npm/annotations/helpers/text-accessibility-manager.d.ts +36 -0
- package/dist/npm/annotations/helpers/text-accessibility-manager.js +215 -0
- package/dist/npm/annotations/helpers/tools.d.ts +1 -0
- package/dist/npm/annotations/helpers/tools.js +23 -0
- package/dist/npm/annotations/shared/display_utils.d.ts +6 -0
- package/dist/npm/annotations/shared/display_utils.js +1030 -0
- package/dist/npm/annotations/shared/event_utils.d.ts +33 -0
- package/dist/npm/annotations/shared/event_utils.js +165 -0
- package/dist/npm/annotations/shared/murmurhash3.d.ts +8 -0
- package/dist/npm/annotations/shared/murmurhash3.js +129 -0
- package/dist/npm/annotations/shared/scripting_utils.d.ts +17 -0
- package/dist/npm/annotations/shared/scripting_utils.js +93 -0
- package/dist/npm/annotations/shared/ui_utils.d.ts +54 -0
- package/dist/npm/annotations/shared/ui_utils.js +250 -0
- package/dist/npm/annotations/shared/utils.d.ts +148 -0
- package/dist/npm/annotations/shared/utils.js +872 -0
- package/dist/npm/common/component.d.ts +9 -0
- package/dist/npm/common/component.js +37 -0
- package/dist/npm/common/core.d.ts +18 -0
- package/dist/npm/common/core.js +112 -0
- package/dist/npm/common/dom.d.ts +3 -0
- package/dist/npm/common/dom.js +17 -0
- package/dist/npm/common/main.d.ts +4 -0
- package/dist/npm/common/main.js +7 -0
- package/dist/npm/common/math.d.ts +1 -0
- package/dist/npm/common/math.js +5 -0
- package/dist/npm/enums/PdfViewerInteractionMode.d.ts +4 -0
- package/dist/npm/enums/PdfViewerInteractionMode.js +9 -0
- package/dist/npm/links/link-service.d.ts +116 -0
- package/dist/npm/links/link-service.js +501 -0
- package/dist/npm/main.d.ts +2 -0
- package/dist/npm/main.js +2 -0
- package/dist/npm/scroller.d.ts +7 -3
- package/dist/npm/scroller.js +32 -32
- package/dist/npm/text/text-layer-builder.d.ts +30 -0
- package/dist/npm/text/text-layer-builder.js +291 -0
- package/dist/npm/utils.d.ts +20 -2
- package/dist/npm/utils.js +11 -8
- package/dist/npm/widget/page.d.ts +75 -0
- package/dist/npm/widget/page.js +763 -0
- package/dist/npm/widget/pdfviewer.d.ts +222 -0
- package/dist/npm/widget/pdfviewer.js +1663 -0
- package/package.json +13 -9
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { PDFLinkService } from "../links/link-service";
|
|
2
|
+
import { AnnotationLayer } from "./annotation-layer";
|
|
3
|
+
import { EventBus } from "./shared/event_utils";
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {Object} AnnotationLayerBuilderOptions
|
|
6
|
+
* @property {PDFPageProxy} pdfPage
|
|
7
|
+
* @property {AnnotationStorage} [annotationStorage]
|
|
8
|
+
* @property {string} [imageResourcesPath] - Path for image resources, mainly
|
|
9
|
+
* for annotation icons. Include trailing slash.
|
|
10
|
+
* @property {boolean} renderForms
|
|
11
|
+
* @property {IPDFLinkService} linkService
|
|
12
|
+
* @property {IDownloadManager} [downloadManager]
|
|
13
|
+
* @property {boolean} [enableScripting]
|
|
14
|
+
* @property {Promise<boolean>} [hasJSActionsPromise]
|
|
15
|
+
* @property {Promise<Object<string, Array<Object>> | null>}
|
|
16
|
+
* [fieldObjectsPromise]
|
|
17
|
+
* @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap]
|
|
18
|
+
* @property {TextAccessibilityManager} [accessibilityManager]
|
|
19
|
+
* @property {AnnotationEditorUIManager} [annotationEditorUIManager]
|
|
20
|
+
* @property {function} [onAppend]
|
|
21
|
+
*/
|
|
22
|
+
declare class AnnotationLayerBuilder {
|
|
23
|
+
#private;
|
|
24
|
+
annotationLayer: AnnotationLayer;
|
|
25
|
+
pdfPage: any;
|
|
26
|
+
linkService: PDFLinkService;
|
|
27
|
+
annotationStorage: any;
|
|
28
|
+
_annotationCanvasMap: any;
|
|
29
|
+
_annotationEditorUIManager: any;
|
|
30
|
+
div: any;
|
|
31
|
+
_cancelled: any;
|
|
32
|
+
_eventBus: EventBus;
|
|
33
|
+
_accessibilityManager: any;
|
|
34
|
+
/**
|
|
35
|
+
* @param {AnnotationLayerBuilderOptions} options
|
|
36
|
+
*/
|
|
37
|
+
constructor({ pdfPage, eventBus, linkService, annotationStorage, annotationCanvasMap, accessibilityManager, annotationEditorUIManager, onAppend, }: {
|
|
38
|
+
pdfPage: any;
|
|
39
|
+
eventBus: any;
|
|
40
|
+
linkService?: any;
|
|
41
|
+
annotationStorage?: any;
|
|
42
|
+
annotationCanvasMap?: any;
|
|
43
|
+
accessibilityManager?: any;
|
|
44
|
+
annotationEditorUIManager?: any;
|
|
45
|
+
onAppend?: any;
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* @param {PageViewport} viewport
|
|
49
|
+
* @param {string} intent (default value is 'display')
|
|
50
|
+
* @returns {Promise<void>} A promise that is resolved when rendering of the
|
|
51
|
+
* annotations is complete.
|
|
52
|
+
*/
|
|
53
|
+
render(viewport: any, intent?: string): Promise<void>;
|
|
54
|
+
cancel(): void;
|
|
55
|
+
hide(): void;
|
|
56
|
+
hasEditableAnnotations(): boolean;
|
|
57
|
+
}
|
|
58
|
+
export { AnnotationLayerBuilder };
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Copyright 2014 Mozilla Foundation
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
var _AnnotationLayerBuilder_instances, _AnnotationLayerBuilder_onAppend, _AnnotationLayerBuilder_eventAbortController, _AnnotationLayerBuilder_updatePresentationModeState;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AnnotationLayerBuilder = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
/** @typedef {import("../src/display/api").PDFPageProxy} PDFPageProxy */
|
|
21
|
+
// eslint-disable-next-line max-len
|
|
22
|
+
/** @typedef {import("../src/display/display_utils").PageViewport} PageViewport */
|
|
23
|
+
// eslint-disable-next-line max-len
|
|
24
|
+
/** @typedef {import("../src/display/annotation_storage").AnnotationStorage} AnnotationStorage */
|
|
25
|
+
/** @typedef {import("./interfaces").IDownloadManager} IDownloadManager */
|
|
26
|
+
/** @typedef {import("./interfaces").IPDFLinkService} IPDFLinkService */
|
|
27
|
+
// eslint-disable-next-line max-len
|
|
28
|
+
/** @typedef {import("./text_accessibility.js").TextAccessibilityManager} TextAccessibilityManager */
|
|
29
|
+
// eslint-disable-next-line max-len
|
|
30
|
+
/** @typedef {import("../src/display/editor/tools.js").AnnotationEditorUIManager} AnnotationEditorUIManager */
|
|
31
|
+
const core_1 = require("../common/core");
|
|
32
|
+
const annotation_layer_1 = require("./annotation-layer");
|
|
33
|
+
const ui_utils_1 = require("./shared/ui_utils");
|
|
34
|
+
// import { PresentationModeState } from "./shared/ui_utils";
|
|
35
|
+
/**
|
|
36
|
+
* @typedef {Object} AnnotationLayerBuilderOptions
|
|
37
|
+
* @property {PDFPageProxy} pdfPage
|
|
38
|
+
* @property {AnnotationStorage} [annotationStorage]
|
|
39
|
+
* @property {string} [imageResourcesPath] - Path for image resources, mainly
|
|
40
|
+
* for annotation icons. Include trailing slash.
|
|
41
|
+
* @property {boolean} renderForms
|
|
42
|
+
* @property {IPDFLinkService} linkService
|
|
43
|
+
* @property {IDownloadManager} [downloadManager]
|
|
44
|
+
* @property {boolean} [enableScripting]
|
|
45
|
+
* @property {Promise<boolean>} [hasJSActionsPromise]
|
|
46
|
+
* @property {Promise<Object<string, Array<Object>> | null>}
|
|
47
|
+
* [fieldObjectsPromise]
|
|
48
|
+
* @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap]
|
|
49
|
+
* @property {TextAccessibilityManager} [accessibilityManager]
|
|
50
|
+
* @property {AnnotationEditorUIManager} [annotationEditorUIManager]
|
|
51
|
+
* @property {function} [onAppend]
|
|
52
|
+
*/
|
|
53
|
+
class AnnotationLayerBuilder {
|
|
54
|
+
/**
|
|
55
|
+
* @param {AnnotationLayerBuilderOptions} options
|
|
56
|
+
*/
|
|
57
|
+
constructor({ pdfPage, eventBus, linkService = null,
|
|
58
|
+
// downloadManager,
|
|
59
|
+
annotationStorage = null,
|
|
60
|
+
// imageResourcesPath = "",
|
|
61
|
+
// renderForms = true,
|
|
62
|
+
// enableScripting = false,
|
|
63
|
+
// hasJSActionsPromise = null,
|
|
64
|
+
// fieldObjectsPromise = null,
|
|
65
|
+
annotationCanvasMap = null, accessibilityManager = null, annotationEditorUIManager = null, onAppend = null, }) {
|
|
66
|
+
_AnnotationLayerBuilder_instances.add(this);
|
|
67
|
+
// todo: props ported from pdf.js
|
|
68
|
+
this.annotationLayer = null;
|
|
69
|
+
this.pdfPage = null;
|
|
70
|
+
this.linkService = null;
|
|
71
|
+
this.annotationStorage = null;
|
|
72
|
+
this._annotationCanvasMap = null;
|
|
73
|
+
this._annotationEditorUIManager = null;
|
|
74
|
+
this.div = null;
|
|
75
|
+
this._cancelled = null;
|
|
76
|
+
this._eventBus = null;
|
|
77
|
+
this._accessibilityManager = null;
|
|
78
|
+
// todo: props ported from pdf.js
|
|
79
|
+
_AnnotationLayerBuilder_onAppend.set(this, null);
|
|
80
|
+
_AnnotationLayerBuilder_eventAbortController.set(this, null);
|
|
81
|
+
this.pdfPage = pdfPage;
|
|
82
|
+
this.linkService = linkService;
|
|
83
|
+
// this.downloadManager = downloadManager;
|
|
84
|
+
// this.imageResourcesPath = imageResourcesPath;
|
|
85
|
+
// this.renderForms = renderForms;
|
|
86
|
+
this.annotationStorage = annotationStorage;
|
|
87
|
+
// this.enableScripting = enableScripting;
|
|
88
|
+
// this._hasJSActionsPromise = hasJSActionsPromise || Promise.resolve(false);
|
|
89
|
+
// this._fieldObjectsPromise = fieldObjectsPromise || Promise.resolve(null);
|
|
90
|
+
this._annotationCanvasMap = annotationCanvasMap;
|
|
91
|
+
this._accessibilityManager = accessibilityManager;
|
|
92
|
+
this._annotationEditorUIManager = annotationEditorUIManager;
|
|
93
|
+
tslib_1.__classPrivateFieldSet(this, _AnnotationLayerBuilder_onAppend, onAppend, "f");
|
|
94
|
+
this.annotationLayer = null;
|
|
95
|
+
this.div = null;
|
|
96
|
+
this._cancelled = false;
|
|
97
|
+
this._eventBus = (linkService === null || linkService === void 0 ? void 0 : linkService.eventBus) || eventBus;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* @param {PageViewport} viewport
|
|
101
|
+
* @param {string} intent (default value is 'display')
|
|
102
|
+
* @returns {Promise<void>} A promise that is resolved when rendering of the
|
|
103
|
+
* annotations is complete.
|
|
104
|
+
*/
|
|
105
|
+
render(viewport_1) {
|
|
106
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* (viewport, intent = "display") {
|
|
107
|
+
var _a, _b, _c;
|
|
108
|
+
if (this.div) {
|
|
109
|
+
if (this._cancelled || !this.annotationLayer) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
// If an annotationLayer already exists, refresh its children's
|
|
113
|
+
// transformation matrices.
|
|
114
|
+
this.annotationLayer.update({
|
|
115
|
+
viewport: viewport.clone({ dontFlip: true }),
|
|
116
|
+
});
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
// const [annotations, hasJSActions, fieldObjects] = await Promise.all([
|
|
120
|
+
const [annotations] = yield Promise.all([
|
|
121
|
+
this.pdfPage.getAnnotations({ intent }),
|
|
122
|
+
// this._hasJSActionsPromise,
|
|
123
|
+
// this._fieldObjectsPromise,
|
|
124
|
+
]);
|
|
125
|
+
if (this._cancelled) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
// Create an annotation layer div and render the annotations
|
|
129
|
+
// if there is at least one annotation.
|
|
130
|
+
// const div = (this.div = document.createElement("div"));
|
|
131
|
+
// div.className = "annotationLayer";
|
|
132
|
+
// this.#onAppend?.(div);
|
|
133
|
+
if (annotations.length === 0) {
|
|
134
|
+
this.hide();
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const page = this.pdfPage;
|
|
138
|
+
const pageView = (_a = page._pageInfo) === null || _a === void 0 ? void 0 : _a.view;
|
|
139
|
+
const pageWidthAnnotationLayer = (pageView[2] || 0) + "px";
|
|
140
|
+
const pageHeightAnnotationLayer = (pageView[3] || 0) + "px";
|
|
141
|
+
const div = (0, core_1.convertToHtml)(`
|
|
142
|
+
<div class="k-annotation-layer annotationLayer" data-main-rotation="0"
|
|
143
|
+
style="width: round(var(--scale-factor) * ${pageWidthAnnotationLayer}, 1px);
|
|
144
|
+
height: round(var(--scale-factor) * ${pageHeightAnnotationLayer}, 1px);">
|
|
145
|
+
</div>
|
|
146
|
+
`);
|
|
147
|
+
this.div = div;
|
|
148
|
+
(_b = tslib_1.__classPrivateFieldGet(this, _AnnotationLayerBuilder_onAppend, "f")) === null || _b === void 0 ? void 0 : _b.call(this, div);
|
|
149
|
+
this.annotationLayer = new annotation_layer_1.AnnotationLayer({
|
|
150
|
+
div,
|
|
151
|
+
// accessibilityManager: this._accessibilityManager,
|
|
152
|
+
accessibilityManager: null,
|
|
153
|
+
annotationCanvasMap: this._annotationCanvasMap,
|
|
154
|
+
annotationEditorUIManager: this._annotationEditorUIManager,
|
|
155
|
+
page: this.pdfPage,
|
|
156
|
+
viewport: viewport.clone({ dontFlip: true }),
|
|
157
|
+
});
|
|
158
|
+
yield this.annotationLayer.render({
|
|
159
|
+
annotations,
|
|
160
|
+
// imageResourcesPath: this.imageResourcesPath,
|
|
161
|
+
// renderForms: this.renderForms,
|
|
162
|
+
linkService: this.linkService,
|
|
163
|
+
// downloadManager: this.downloadManager,
|
|
164
|
+
// annotationStorage: this.annotationStorage,
|
|
165
|
+
// enableScripting: this.enableScripting,
|
|
166
|
+
// hasJSActions,
|
|
167
|
+
// fieldObjects,
|
|
168
|
+
});
|
|
169
|
+
// Ensure that interactive form elements in the annotationLayer are
|
|
170
|
+
// disabled while PresentationMode is active (see issue 12232).
|
|
171
|
+
if (this.linkService.isInPresentationMode) {
|
|
172
|
+
tslib_1.__classPrivateFieldGet(this, _AnnotationLayerBuilder_instances, "m", _AnnotationLayerBuilder_updatePresentationModeState).call(this, ui_utils_1.PresentationModeState.FULLSCREEN);
|
|
173
|
+
}
|
|
174
|
+
if (!tslib_1.__classPrivateFieldGet(this, _AnnotationLayerBuilder_eventAbortController, "f")) {
|
|
175
|
+
tslib_1.__classPrivateFieldSet(this, _AnnotationLayerBuilder_eventAbortController, new AbortController(), "f");
|
|
176
|
+
(_c = this._eventBus) === null || _c === void 0 ? void 0 : _c._on("presentationmodechanged", evt => {
|
|
177
|
+
tslib_1.__classPrivateFieldGet(this, _AnnotationLayerBuilder_instances, "m", _AnnotationLayerBuilder_updatePresentationModeState).call(this, evt.state);
|
|
178
|
+
}, { signal: tslib_1.__classPrivateFieldGet(this, _AnnotationLayerBuilder_eventAbortController, "f").signal });
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
cancel() {
|
|
183
|
+
var _a;
|
|
184
|
+
this._cancelled = true;
|
|
185
|
+
(_a = tslib_1.__classPrivateFieldGet(this, _AnnotationLayerBuilder_eventAbortController, "f")) === null || _a === void 0 ? void 0 : _a.abort();
|
|
186
|
+
tslib_1.__classPrivateFieldSet(this, _AnnotationLayerBuilder_eventAbortController, null, "f");
|
|
187
|
+
}
|
|
188
|
+
hide() {
|
|
189
|
+
if (!this.div) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
this.div.hidden = true;
|
|
193
|
+
}
|
|
194
|
+
hasEditableAnnotations() {
|
|
195
|
+
var _a;
|
|
196
|
+
return !!((_a = this.annotationLayer) === null || _a === void 0 ? void 0 : _a.hasEditableAnnotations());
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
exports.AnnotationLayerBuilder = AnnotationLayerBuilder;
|
|
200
|
+
_AnnotationLayerBuilder_onAppend = new WeakMap(), _AnnotationLayerBuilder_eventAbortController = new WeakMap(), _AnnotationLayerBuilder_instances = new WeakSet(), _AnnotationLayerBuilder_updatePresentationModeState = function _AnnotationLayerBuilder_updatePresentationModeState(state) {
|
|
201
|
+
if (!this.div) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
let disableFormElements = false;
|
|
205
|
+
switch (state) {
|
|
206
|
+
case ui_utils_1.PresentationModeState.FULLSCREEN:
|
|
207
|
+
disableFormElements = true;
|
|
208
|
+
break;
|
|
209
|
+
case ui_utils_1.PresentationModeState.NORMAL:
|
|
210
|
+
break;
|
|
211
|
+
default:
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
for (const section of this.div.childNodes) {
|
|
215
|
+
if (section.hasAttribute("data-internal-link")) {
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
section.inert = disableFormElements;
|
|
219
|
+
}
|
|
220
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
declare class AnnotationElement {
|
|
2
|
+
#private;
|
|
3
|
+
isRenderable: any;
|
|
4
|
+
data: any;
|
|
5
|
+
layer: any;
|
|
6
|
+
linkService: any;
|
|
7
|
+
downloadManager: any;
|
|
8
|
+
imageResourcesPath: any;
|
|
9
|
+
renderForms: any;
|
|
10
|
+
svgFactory: any;
|
|
11
|
+
annotationStorage: any;
|
|
12
|
+
enableScripting: any;
|
|
13
|
+
hasJSActions: any;
|
|
14
|
+
_fieldObjects: any;
|
|
15
|
+
parent: any;
|
|
16
|
+
container: any;
|
|
17
|
+
popup: any;
|
|
18
|
+
annotationEditorType: any;
|
|
19
|
+
constructor(parameters: any, { isRenderable, ignoreBorder, createQuadrilaterals, }?: {
|
|
20
|
+
isRenderable?: boolean;
|
|
21
|
+
ignoreBorder?: boolean;
|
|
22
|
+
createQuadrilaterals?: boolean;
|
|
23
|
+
});
|
|
24
|
+
static _hasPopupData({ titleObj, contentsObj, richText }: {
|
|
25
|
+
titleObj: any;
|
|
26
|
+
contentsObj: any;
|
|
27
|
+
richText: any;
|
|
28
|
+
}): boolean;
|
|
29
|
+
get _isEditable(): any;
|
|
30
|
+
get hasPopupData(): boolean;
|
|
31
|
+
updateEdited(params: any): void;
|
|
32
|
+
resetEdited(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Create an empty container for the annotation's HTML element.
|
|
35
|
+
*
|
|
36
|
+
* @private
|
|
37
|
+
* @param {boolean} ignoreBorder
|
|
38
|
+
* @memberof AnnotationElement
|
|
39
|
+
* @returns {HTMLElement} A section element.
|
|
40
|
+
*/
|
|
41
|
+
_createContainer(ignoreBorder: any): HTMLElement;
|
|
42
|
+
setRotation(angle: any, container?: any): void;
|
|
43
|
+
get _commonActions(): any;
|
|
44
|
+
_dispatchEventFromSandbox(actions: any, jsEvent: any): void;
|
|
45
|
+
_setDefaultPropertiesFromJS(element: any): void;
|
|
46
|
+
/**
|
|
47
|
+
* Create quadrilaterals from the annotation's quadpoints.
|
|
48
|
+
*
|
|
49
|
+
* @private
|
|
50
|
+
* @memberof AnnotationElement
|
|
51
|
+
*/
|
|
52
|
+
_createQuadrilaterals(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Create a popup for the annotation's HTML element. This is used for
|
|
55
|
+
* annotations that do not have a Popup entry in the dictionary, but
|
|
56
|
+
* are of a type that works with popups (such as Highlight annotations).
|
|
57
|
+
*
|
|
58
|
+
* @private
|
|
59
|
+
* @memberof AnnotationElement
|
|
60
|
+
*/
|
|
61
|
+
_createPopup(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Render the annotation's HTML element(s).
|
|
64
|
+
*
|
|
65
|
+
* @public
|
|
66
|
+
* @memberof AnnotationElement
|
|
67
|
+
*/
|
|
68
|
+
render(): void;
|
|
69
|
+
/**
|
|
70
|
+
* @private
|
|
71
|
+
* @returns {Array}
|
|
72
|
+
*/
|
|
73
|
+
_getElementsByName(name: any, skipId?: any): any[];
|
|
74
|
+
show(): void;
|
|
75
|
+
hide(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Get the HTML element(s) which can trigger a popup when clicked or hovered.
|
|
78
|
+
*
|
|
79
|
+
* @public
|
|
80
|
+
* @memberof AnnotationElement
|
|
81
|
+
* @returns {Array<HTMLElement>|HTMLElement} An array of elements or an
|
|
82
|
+
* element.
|
|
83
|
+
*/
|
|
84
|
+
getElementsToTriggerPopup(): any;
|
|
85
|
+
addHighlightArea(): void;
|
|
86
|
+
_editOnDoubleClick(): void;
|
|
87
|
+
_setRequired(element: any, isRequired: any): void;
|
|
88
|
+
}
|
|
89
|
+
declare class FreeTextAnnotationElement extends AnnotationElement {
|
|
90
|
+
textContent: any;
|
|
91
|
+
textPosition: any;
|
|
92
|
+
constructor(parameters: any);
|
|
93
|
+
render(): any;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Manage the layer containing all the annotations.
|
|
97
|
+
*/
|
|
98
|
+
declare class AnnotationLayer {
|
|
99
|
+
#private;
|
|
100
|
+
div: any;
|
|
101
|
+
page: any;
|
|
102
|
+
viewport: any;
|
|
103
|
+
zIndex: any;
|
|
104
|
+
_annotationEditorUIManager: any;
|
|
105
|
+
constructor({ div, accessibilityManager, annotationCanvasMap, annotationEditorUIManager, page, viewport }: {
|
|
106
|
+
div: any;
|
|
107
|
+
accessibilityManager: any;
|
|
108
|
+
annotationCanvasMap: any;
|
|
109
|
+
annotationEditorUIManager: any;
|
|
110
|
+
page: any;
|
|
111
|
+
viewport: any;
|
|
112
|
+
});
|
|
113
|
+
hide(): void;
|
|
114
|
+
hasEditableAnnotations(): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Render a new annotation layer with all annotation elements.
|
|
117
|
+
*
|
|
118
|
+
* @param {AnnotationLayerParameters} params
|
|
119
|
+
* @memberof AnnotationLayer
|
|
120
|
+
*/
|
|
121
|
+
render(params: any): void;
|
|
122
|
+
/**
|
|
123
|
+
* Update the annotation elements on existing annotation layer.
|
|
124
|
+
*
|
|
125
|
+
* @param {AnnotationLayerParameters} viewport
|
|
126
|
+
* @memberof AnnotationLayer
|
|
127
|
+
*/
|
|
128
|
+
update({ viewport }: {
|
|
129
|
+
viewport: any;
|
|
130
|
+
}): void;
|
|
131
|
+
getEditableAnnotations(): any[];
|
|
132
|
+
getEditableAnnotation(id: any): any;
|
|
133
|
+
}
|
|
134
|
+
export { AnnotationLayer, FreeTextAnnotationElement };
|