[Editor] Add a new editor to highlight some text in a pdf (bug 1866119)

This patch is first big step for the new highlight feature.
Few patches will follow in order to conform to the specs UX/UI gave us.
This commit is contained in:
Calixte Denizet 2023-11-22 19:02:42 +01:00
parent 4bf7ff2027
commit 1ea6293923
19 changed files with 897 additions and 56 deletions

View file

@ -13,13 +13,11 @@
* limitations under the License.
*/
/** @typedef {import("../src/display/draw_layer.js").DrawLayer} DrawLayer */
import { DrawLayer } from "pdfjs-lib";
/**
* @typedef {Object} DrawLayerBuilderOptions
* @property {DrawLayer} [drawLayer]
* @property {number} pageIndex
*/
class DrawLayerBuilder {
@ -53,6 +51,14 @@ class DrawLayerBuilder {
this.#drawLayer.destroy();
this.#drawLayer = null;
}
setParent(parent) {
this.#drawLayer?.setParent(parent);
}
getDrawLayer() {
return this.#drawLayer;
}
}
export { DrawLayerBuilder };