@progress/kendo-pdfviewer-common 0.3.4-dev.202410281223 → 0.4.0-dev.202501060813

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.
@@ -90,7 +90,7 @@ class AnnotationEditorLayerBuilder {
90
90
  }
91
91
  // Create an AnnotationEditor layer div
92
92
  const div = (this.div = document.createElement("div"));
93
- div.className = "k-annotation-editor-layer annotationEditorLayer";
93
+ div.className = "k-annotation-editor-layer";
94
94
  div.hidden = true;
95
95
  div.dir = __classPrivateFieldGet(this, _AnnotationEditorLayerBuilder_uiManager, "f").direction;
96
96
  (_a = __classPrivateFieldGet(this, _AnnotationEditorLayerBuilder_onAppend, "f")) === null || _a === void 0 ? void 0 : _a.call(this, div);
@@ -136,7 +136,8 @@ class AnnotationLayerBuilder {
136
136
  const pageWidthAnnotationLayer = (pageView[2] || 0) + "px";
137
137
  const pageHeightAnnotationLayer = (pageView[3] || 0) + "px";
138
138
  const div = convertToHtml(`
139
- <div class="k-annotation-layer annotationLayer" data-main-rotation="0"
139
+ <div class="k-annotation-layer"
140
+ data-main-rotation="0"
140
141
  style="width: round(var(--scale-factor) * ${pageWidthAnnotationLayer}, 1px);
141
142
  height: round(var(--scale-factor) * ${pageHeightAnnotationLayer}, 1px);">
142
143
  </div>
@@ -692,7 +692,7 @@ class LinkAnnotationElement extends AnnotationElement {
692
692
  }
693
693
  // todo: do not render the class as the rendering is yet to be determined
694
694
  // this.container.classList.add("linkAnnotation");
695
- // this.container.classList.add("k-link-annotation");
695
+ this.container.classList.add("k-link-annotation");
696
696
  if (isBound) {
697
697
  this.container.append(link);
698
698
  }
@@ -43,7 +43,7 @@ class HighlightEditor extends AnnotationEditor {
43
43
  // );
44
44
  // }
45
45
  constructor(params) {
46
- super(Object.assign(Object.assign({}, params), { name: "k-highlight-editor highlightEditor" }));
46
+ super(Object.assign(Object.assign({}, params), { name: "k-highlight-editor" }));
47
47
  _HighlightEditor_instances.add(this);
48
48
  // todo: props
49
49
  this.color = "";
@@ -195,14 +195,14 @@ class HighlightEditor extends AnnotationEditor {
195
195
  /** @inheritdoc */
196
196
  disableEditing() {
197
197
  super.disableEditing();
198
- this.div.classList.toggle("disabled", true);
199
- // this.div.classList.toggle("k-disabled", true);
198
+ // this.div.classList.toggle("disabled", true);
199
+ this.div.classList.toggle("k-highlight-editor-disabled", true);
200
200
  }
201
201
  /** @inheritdoc */
202
202
  enableEditing() {
203
203
  super.enableEditing();
204
- this.div.classList.toggle("disabled", false);
205
- // this.div.classList.toggle("k-disabled", false);
204
+ // this.div.classList.toggle("disabled", false);
205
+ this.div.classList.toggle("k-highlight-editor-disabled", false);
206
206
  }
207
207
  /** @inheritdoc */
208
208
  fixAndSetPosition() {
@@ -19,6 +19,7 @@ const PDF_JS = "pdfjs";
19
19
  const ERROR = "error";
20
20
  const ZOOM_START = "zoomStart";
21
21
  const ZOOM_END = "zoomEnd";
22
+ const PAGE_RENDERED = "pageRendered";
22
23
  const PAGES_LOAD = "pagesLoad";
23
24
  const PRINT_END = "printEnd";
24
25
  const SCROLL = "scroll";
@@ -90,6 +91,7 @@ export class PdfViewer extends Component {
90
91
  enabledPanningClass: "k-enable-panning"
91
92
  },
92
93
  events: {
94
+ [PAGE_RENDERED]: noop,
93
95
  [PAGES_LOAD]: noop,
94
96
  [PRINT_END]: noop,
95
97
  [ZOOM_START]: noop,
@@ -723,6 +725,7 @@ export class PdfViewer extends Component {
723
725
  var _a;
724
726
  const index = clamp(pageIndex, 0, Math.max(0, this.state.pdfDocument.numPages - 1));
725
727
  return (_a = this.pages[index]) === null || _a === void 0 ? void 0 : _a.draw().then(() => {
728
+ this.triggerPageRendered({ page: this.pages[index] });
726
729
  return this.pages[index].element;
727
730
  });
728
731
  }
@@ -777,6 +780,10 @@ export class PdfViewer extends Component {
777
780
  styles,
778
781
  };
779
782
  }
783
+ triggerPageRendered(e) {
784
+ this.trigger(PAGE_RENDERED, e);
785
+ }
786
+ ;
780
787
  triggerPagesLoad(e) {
781
788
  this.trigger(PAGES_LOAD, e);
782
789
  }
@@ -90,7 +90,7 @@ class AnnotationEditorLayerBuilder {
90
90
  }
91
91
  // Create an AnnotationEditor layer div
92
92
  const div = (this.div = document.createElement("div"));
93
- div.className = "k-annotation-editor-layer annotationEditorLayer";
93
+ div.className = "k-annotation-editor-layer";
94
94
  div.hidden = true;
95
95
  div.dir = __classPrivateFieldGet(this, _AnnotationEditorLayerBuilder_uiManager, "f").direction;
96
96
  (_a = __classPrivateFieldGet(this, _AnnotationEditorLayerBuilder_onAppend, "f")) === null || _a === void 0 ? void 0 : _a.call(this, div);
@@ -136,7 +136,8 @@ class AnnotationLayerBuilder {
136
136
  const pageWidthAnnotationLayer = (pageView[2] || 0) + "px";
137
137
  const pageHeightAnnotationLayer = (pageView[3] || 0) + "px";
138
138
  const div = convertToHtml(`
139
- <div class="k-annotation-layer annotationLayer" data-main-rotation="0"
139
+ <div class="k-annotation-layer"
140
+ data-main-rotation="0"
140
141
  style="width: round(var(--scale-factor) * ${pageWidthAnnotationLayer}, 1px);
141
142
  height: round(var(--scale-factor) * ${pageHeightAnnotationLayer}, 1px);">
142
143
  </div>
@@ -692,7 +692,7 @@ class LinkAnnotationElement extends AnnotationElement {
692
692
  }
693
693
  // todo: do not render the class as the rendering is yet to be determined
694
694
  // this.container.classList.add("linkAnnotation");
695
- // this.container.classList.add("k-link-annotation");
695
+ this.container.classList.add("k-link-annotation");
696
696
  if (isBound) {
697
697
  this.container.append(link);
698
698
  }
@@ -43,7 +43,7 @@ class HighlightEditor extends AnnotationEditor {
43
43
  // );
44
44
  // }
45
45
  constructor(params) {
46
- super(Object.assign(Object.assign({}, params), { name: "k-highlight-editor highlightEditor" }));
46
+ super(Object.assign(Object.assign({}, params), { name: "k-highlight-editor" }));
47
47
  _HighlightEditor_instances.add(this);
48
48
  // todo: props
49
49
  this.color = "";
@@ -195,14 +195,14 @@ class HighlightEditor extends AnnotationEditor {
195
195
  /** @inheritdoc */
196
196
  disableEditing() {
197
197
  super.disableEditing();
198
- this.div.classList.toggle("disabled", true);
199
- // this.div.classList.toggle("k-disabled", true);
198
+ // this.div.classList.toggle("disabled", true);
199
+ this.div.classList.toggle("k-highlight-editor-disabled", true);
200
200
  }
201
201
  /** @inheritdoc */
202
202
  enableEditing() {
203
203
  super.enableEditing();
204
- this.div.classList.toggle("disabled", false);
205
- // this.div.classList.toggle("k-disabled", false);
204
+ // this.div.classList.toggle("disabled", false);
205
+ this.div.classList.toggle("k-highlight-editor-disabled", false);
206
206
  }
207
207
  /** @inheritdoc */
208
208
  fixAndSetPosition() {
@@ -19,6 +19,7 @@ const PDF_JS = "pdfjs";
19
19
  const ERROR = "error";
20
20
  const ZOOM_START = "zoomStart";
21
21
  const ZOOM_END = "zoomEnd";
22
+ const PAGE_RENDERED = "pageRendered";
22
23
  const PAGES_LOAD = "pagesLoad";
23
24
  const PRINT_END = "printEnd";
24
25
  const SCROLL = "scroll";
@@ -90,6 +91,7 @@ export class PdfViewer extends Component {
90
91
  enabledPanningClass: "k-enable-panning"
91
92
  },
92
93
  events: {
94
+ [PAGE_RENDERED]: noop,
93
95
  [PAGES_LOAD]: noop,
94
96
  [PRINT_END]: noop,
95
97
  [ZOOM_START]: noop,
@@ -723,6 +725,7 @@ export class PdfViewer extends Component {
723
725
  var _a;
724
726
  const index = clamp(pageIndex, 0, Math.max(0, this.state.pdfDocument.numPages - 1));
725
727
  return (_a = this.pages[index]) === null || _a === void 0 ? void 0 : _a.draw().then(() => {
728
+ this.triggerPageRendered({ page: this.pages[index] });
726
729
  return this.pages[index].element;
727
730
  });
728
731
  }
@@ -777,6 +780,10 @@ export class PdfViewer extends Component {
777
780
  styles,
778
781
  };
779
782
  }
783
+ triggerPageRendered(e) {
784
+ this.trigger(PAGE_RENDERED, e);
785
+ }
786
+ ;
780
787
  triggerPagesLoad(e) {
781
788
  this.trigger(PAGES_LOAD, e);
782
789
  }
@@ -93,7 +93,7 @@ class AnnotationEditorLayerBuilder {
93
93
  }
94
94
  // Create an AnnotationEditor layer div
95
95
  const div = (this.div = document.createElement("div"));
96
- div.className = "k-annotation-editor-layer annotationEditorLayer";
96
+ div.className = "k-annotation-editor-layer";
97
97
  div.hidden = true;
98
98
  div.dir = tslib_1.__classPrivateFieldGet(this, _AnnotationEditorLayerBuilder_uiManager, "f").direction;
99
99
  (_a = tslib_1.__classPrivateFieldGet(this, _AnnotationEditorLayerBuilder_onAppend, "f")) === null || _a === void 0 ? void 0 : _a.call(this, div);
@@ -139,7 +139,8 @@ class AnnotationLayerBuilder {
139
139
  const pageWidthAnnotationLayer = (pageView[2] || 0) + "px";
140
140
  const pageHeightAnnotationLayer = (pageView[3] || 0) + "px";
141
141
  const div = (0, core_1.convertToHtml)(`
142
- <div class="k-annotation-layer annotationLayer" data-main-rotation="0"
142
+ <div class="k-annotation-layer"
143
+ data-main-rotation="0"
143
144
  style="width: round(var(--scale-factor) * ${pageWidthAnnotationLayer}, 1px);
144
145
  height: round(var(--scale-factor) * ${pageHeightAnnotationLayer}, 1px);">
145
146
  </div>
@@ -695,7 +695,7 @@ class LinkAnnotationElement extends AnnotationElement {
695
695
  }
696
696
  // todo: do not render the class as the rendering is yet to be determined
697
697
  // this.container.classList.add("linkAnnotation");
698
- // this.container.classList.add("k-link-annotation");
698
+ this.container.classList.add("k-link-annotation");
699
699
  if (isBound) {
700
700
  this.container.append(link);
701
701
  }
@@ -43,7 +43,7 @@ class HighlightEditor extends annotation_editor_1.AnnotationEditor {
43
43
  // );
44
44
  // }
45
45
  constructor(params) {
46
- super(Object.assign(Object.assign({}, params), { name: "k-highlight-editor highlightEditor" }));
46
+ super(Object.assign(Object.assign({}, params), { name: "k-highlight-editor" }));
47
47
  _HighlightEditor_instances.add(this);
48
48
  // todo: props
49
49
  this.color = "";
@@ -195,14 +195,14 @@ class HighlightEditor extends annotation_editor_1.AnnotationEditor {
195
195
  /** @inheritdoc */
196
196
  disableEditing() {
197
197
  super.disableEditing();
198
- this.div.classList.toggle("disabled", true);
199
- // this.div.classList.toggle("k-disabled", true);
198
+ // this.div.classList.toggle("disabled", true);
199
+ this.div.classList.toggle("k-highlight-editor-disabled", true);
200
200
  }
201
201
  /** @inheritdoc */
202
202
  enableEditing() {
203
203
  super.enableEditing();
204
- this.div.classList.toggle("disabled", false);
205
- // this.div.classList.toggle("k-disabled", false);
204
+ // this.div.classList.toggle("disabled", false);
205
+ this.div.classList.toggle("k-highlight-editor-disabled", false);
206
206
  }
207
207
  /** @inheritdoc */
208
208
  fixAndSetPosition() {
@@ -103,6 +103,7 @@ export declare class PdfViewer extends Component {
103
103
  };
104
104
  };
105
105
  triggerError: (e: any) => void;
106
+ triggerPageRendered(e: any): void;
106
107
  triggerPagesLoad(e: any): void;
107
108
  triggerZoomStart(e: any): void;
108
109
  triggerZoomEnd(e: any): void;
@@ -22,6 +22,7 @@ const PDF_JS = "pdfjs";
22
22
  const ERROR = "error";
23
23
  const ZOOM_START = "zoomStart";
24
24
  const ZOOM_END = "zoomEnd";
25
+ const PAGE_RENDERED = "pageRendered";
25
26
  const PAGES_LOAD = "pagesLoad";
26
27
  const PRINT_END = "printEnd";
27
28
  const SCROLL = "scroll";
@@ -93,6 +94,7 @@ class PdfViewer extends main_1.Component {
93
94
  enabledPanningClass: "k-enable-panning"
94
95
  },
95
96
  events: {
97
+ [PAGE_RENDERED]: main_1.noop,
96
98
  [PAGES_LOAD]: main_1.noop,
97
99
  [PRINT_END]: main_1.noop,
98
100
  [ZOOM_START]: main_1.noop,
@@ -726,6 +728,7 @@ class PdfViewer extends main_1.Component {
726
728
  var _a;
727
729
  const index = (0, main_1.clamp)(pageIndex, 0, Math.max(0, this.state.pdfDocument.numPages - 1));
728
730
  return (_a = this.pages[index]) === null || _a === void 0 ? void 0 : _a.draw().then(() => {
731
+ this.triggerPageRendered({ page: this.pages[index] });
729
732
  return this.pages[index].element;
730
733
  });
731
734
  }
@@ -780,6 +783,10 @@ class PdfViewer extends main_1.Component {
780
783
  styles,
781
784
  };
782
785
  }
786
+ triggerPageRendered(e) {
787
+ this.trigger(PAGE_RENDERED, e);
788
+ }
789
+ ;
783
790
  triggerPagesLoad(e) {
784
791
  this.trigger(PAGES_LOAD, e);
785
792
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@progress/kendo-pdfviewer-common",
3
3
  "description": "Kendo UI TypeScript package exporting functions for PDFViewer component",
4
- "version": "0.3.4-dev.202410281223",
4
+ "version": "0.4.0-dev.202501060813",
5
5
  "keywords": [
6
6
  "Kendo UI"
7
7
  ],