@embedpdf/plugin-annotation 3.0.0-next.4 → 3.0.0-next.5
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/{capability-CYbikyob.cjs → capability-BMBwSdaY.cjs} +22 -1
- package/dist/capability-BMBwSdaY.cjs.map +1 -0
- package/dist/{capability-DjUdnoYn.js → capability-CYYDz4dW.js} +22 -1
- package/dist/capability-CYYDz4dW.js.map +1 -0
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/dist/{types-CfewRmXH.d.cts → types-BCB5YKIk.d.ts} +17 -4
- package/dist/{types-DZ29RSW9.d.ts → types-N25K86pT.d.cts} +17 -4
- package/package.json +7 -7
- package/dist/capability-CYbikyob.cjs.map +0 -1
- package/dist/capability-DjUdnoYn.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
let _embedpdf_core = require("@embedpdf/core");
|
|
2
2
|
let _embedpdf_plugin_interaction = require("@embedpdf/plugin-interaction");
|
|
3
3
|
let _embedpdf_engine_core_runtime = require("@embedpdf/engine-core/runtime");
|
|
4
|
+
let _embedpdf_plugin_selection = require("@embedpdf/plugin-selection");
|
|
4
5
|
let _embedpdf_core_annotation = require("@embedpdf/core-annotation");
|
|
5
6
|
let _embedpdf_core_geometry = require("@embedpdf/core-geometry");
|
|
6
7
|
//#region src/types.ts
|
|
@@ -2487,6 +2488,26 @@ function createAnnotationCapability(ctx, config = {}) {
|
|
|
2487
2488
|
finishCreationDraft: () => apply({ t: "finishCreationDraft" }),
|
|
2488
2489
|
finishInkDraft: () => apply({ t: "finishInkDraft" }),
|
|
2489
2490
|
cancelCreationDraft: () => apply({ t: "cancel" }),
|
|
2491
|
+
markupFromSelection: (subtype, preset) => {
|
|
2492
|
+
const selection = ctx.tryGet(_embedpdf_plugin_selection.SelectionToken);
|
|
2493
|
+
if (!selection || !selection.hasSelection()) return false;
|
|
2494
|
+
const snapshot = selection.snapshot();
|
|
2495
|
+
let created = false;
|
|
2496
|
+
for (const page of snapshot.pages) {
|
|
2497
|
+
if (!page.segments.length) continue;
|
|
2498
|
+
apply({
|
|
2499
|
+
t: "createMarkup",
|
|
2500
|
+
subtype,
|
|
2501
|
+
pon: page.pon,
|
|
2502
|
+
quads: page.segments.map((s) => s.quad),
|
|
2503
|
+
preset,
|
|
2504
|
+
flags: preset ? registry.get(preset)?.flags : void 0
|
|
2505
|
+
});
|
|
2506
|
+
created = true;
|
|
2507
|
+
}
|
|
2508
|
+
if (created) selection.clear();
|
|
2509
|
+
return created;
|
|
2510
|
+
},
|
|
2490
2511
|
createMarkup: (subtype, pon, quads, preset) => apply({
|
|
2491
2512
|
t: "createMarkup",
|
|
2492
2513
|
subtype,
|
|
@@ -2746,4 +2767,4 @@ Object.defineProperty(exports, "widgetAppearanceFromProps", {
|
|
|
2746
2767
|
}
|
|
2747
2768
|
});
|
|
2748
2769
|
|
|
2749
|
-
//# sourceMappingURL=capability-
|
|
2770
|
+
//# sourceMappingURL=capability-BMBwSdaY.cjs.map
|