@embedpdf/plugin-annotation 2.14.0 → 2.14.2
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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +73 -6
- package/dist/index.js.map +1 -1
- package/dist/lib/annotation-plugin.d.ts +25 -0
- package/dist/lib/helpers.d.ts +8 -0
- package/dist/lib/types.d.ts +21 -2
- package/dist/preact/index.cjs +1 -1
- package/dist/preact/index.cjs.map +1 -1
- package/dist/preact/index.js +27 -18
- package/dist/preact/index.js.map +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +27 -18
- package/dist/react/index.js.map +1 -1
- package/dist/shared/components/annotation-container.d.ts +13 -1
- package/dist/shared/components/types.d.ts +12 -0
- package/dist/shared-preact/components/annotation-container.d.ts +13 -1
- package/dist/shared-preact/components/types.d.ts +12 -0
- package/dist/shared-react/components/annotation-container.d.ts +13 -1
- package/dist/shared-react/components/types.d.ts +12 -0
- package/dist/svelte/components/types.d.ts +12 -0
- package/dist/svelte/index.cjs +1 -1
- package/dist/svelte/index.cjs.map +1 -1
- package/dist/svelte/index.js +31 -20
- package/dist/svelte/index.js.map +1 -1
- package/dist/svelte/types.d.ts +12 -0
- package/dist/vue/components/annotation-container.vue.d.ts +12 -0
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.js +57 -41
- package/dist/vue/index.js.map +1 -1
- package/dist/vue/types.d.ts +12 -0
- package/package.json +12 -12
package/dist/svelte/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createPluginPackage } from "@embedpdf/core";
|
|
2
|
-
import { AnnotationPlugin, initialDocumentState, generateCloudyRectanglePath, generateCloudyEllipsePath, patching, generateCloudyPolygonPath, LockModeType, getAnnotationsByPageIndex, getSelectedAnnotationIds, resolveInteractionProp,
|
|
2
|
+
import { AnnotationPlugin, initialDocumentState, generateCloudyRectanglePath, generateCloudyEllipsePath, patching, generateCloudyPolygonPath, LockModeType, getAnnotationsByPageIndex, getSelectedAnnotationIds, resolveInteractionProp, hasNoViewFlag, hasHiddenFlag, AnnotationPluginPackage as AnnotationPluginPackage$1 } from "@embedpdf/plugin-annotation";
|
|
3
3
|
export * from "@embedpdf/plugin-annotation";
|
|
4
4
|
import "svelte/internal/disclose-version";
|
|
5
5
|
import * as $ from "svelte/internal/client";
|
|
@@ -213,7 +213,7 @@ var root_23 = $.from_html(`<div><div> </div></div>`);
|
|
|
213
213
|
var root$j = $.from_html(`<div data-no-interaction=""><div><div><!> <!></div></div> <div><!> <!> <div><!> <!></div></div> <!> <!></div>`);
|
|
214
214
|
function AnnotationContainer($$anchor, $$props) {
|
|
215
215
|
$.push($$props, true);
|
|
216
|
-
let isEditing = $.prop($$props, "isEditing", 3, false), isMultiSelected = $.prop($$props, "isMultiSelected", 3, false), isRotatable = $.prop($$props, "isRotatable", 3, true), lockAspectRatio = $.prop($$props, "lockAspectRatio", 3, false), propsClass = $.prop($$props, "class", 3, ""), outlineOffset = $.prop($$props, "outlineOffset", 3, 1), zIndex = $.prop($$props, "zIndex", 3, 1), restProps = $.rest_props($$props, [
|
|
216
|
+
let isEditing = $.prop($$props, "isEditing", 3, false), isMultiSelected = $.prop($$props, "isMultiSelected", 3, false), isRotatable = $.prop($$props, "isRotatable", 3, true), lockAspectRatio = $.prop($$props, "lockAspectRatio", 3, false), propsClass = $.prop($$props, "class", 3, ""), structurallyLocked = $.prop($$props, "structurallyLocked", 3, false), contentLocked = $.prop($$props, "contentLocked", 3, false), outlineOffset = $.prop($$props, "outlineOffset", 3, 1), zIndex = $.prop($$props, "zIndex", 3, 1), restProps = $.rest_props($$props, [
|
|
217
217
|
"$$slots",
|
|
218
218
|
"$$events",
|
|
219
219
|
"$$legacy",
|
|
@@ -238,6 +238,8 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
238
238
|
"vertexConfig",
|
|
239
239
|
"selectionMenu",
|
|
240
240
|
"selectionMenuSnippet",
|
|
241
|
+
"structurallyLocked",
|
|
242
|
+
"contentLocked",
|
|
241
243
|
"outlineOffset",
|
|
242
244
|
"onDoubleClick",
|
|
243
245
|
"onSelect",
|
|
@@ -545,7 +547,9 @@ function AnnotationContainer($$anchor, $$props) {
|
|
|
545
547
|
return {
|
|
546
548
|
type: "annotation",
|
|
547
549
|
annotation: $$props.trackedAnnotation,
|
|
548
|
-
pageIndex: $$props.pageIndex
|
|
550
|
+
pageIndex: $$props.pageIndex,
|
|
551
|
+
structurallyLocked: structurallyLocked(),
|
|
552
|
+
contentLocked: contentLocked()
|
|
549
553
|
};
|
|
550
554
|
}
|
|
551
555
|
function buildMenuProps(rect, menuWrapperProps) {
|
|
@@ -4421,21 +4425,22 @@ function Annotations($$anchor, $$props) {
|
|
|
4421
4425
|
var _a;
|
|
4422
4426
|
return ((_a = $.get(annotationProvides)) == null ? void 0 : _a.findToolForAnnotation($.get(annotation).object)) ?? null;
|
|
4423
4427
|
});
|
|
4424
|
-
const
|
|
4425
|
-
const
|
|
4428
|
+
const nonInteractive = $.derived(() => $.get(annotationProvides) ? !$.get(annotationProvides).isAnnotationInteractive($.get(annotation).object) : false);
|
|
4429
|
+
const structurallyLocked = $.derived(() => $.get(annotationProvides) ? $.get(annotationProvides).isAnnotationStructurallyLocked($.get(annotation).object) : false);
|
|
4430
|
+
const contentLocked = $.derived(() => $.get(annotationProvides) ? $.get(annotationProvides).isAnnotationContentLocked($.get(annotation).object) : false);
|
|
4426
4431
|
var fragment_2 = $.comment();
|
|
4427
4432
|
var node_2 = $.first_child(fragment_2);
|
|
4428
4433
|
{
|
|
4429
4434
|
var consequent = ($$anchor4) => {
|
|
4430
|
-
const hasRenderLocked = $.derived(() => $.get(
|
|
4431
|
-
const isSelected = $.derived(() => $.get(
|
|
4432
|
-
const isEditing = $.derived(() => $.get(
|
|
4435
|
+
const hasRenderLocked = $.derived(() => $.get(nonInteractive) && !!$.get(renderer).renderLocked);
|
|
4436
|
+
const isSelected = $.derived(() => $.get(nonInteractive) ? false : $.get(allSelectedIds).includes($.get(annotation).object.id));
|
|
4437
|
+
const isEditing = $.derived(() => $.get(nonInteractive) ? false : $.get(editingId) === $.get(annotation).object.id);
|
|
4433
4438
|
const defaults = $.derived(() => $.get(renderer).interactionDefaults);
|
|
4434
4439
|
const resolvedDraggable = $.derived(() => {
|
|
4435
4440
|
var _a, _b;
|
|
4436
4441
|
return resolveInteractionProp((_a = $.get(tool)) == null ? void 0 : _a.interaction.isDraggable, $.get(annotation).object, ((_b = $.get(defaults)) == null ? void 0 : _b.isDraggable) ?? true);
|
|
4437
4442
|
});
|
|
4438
|
-
const finalDraggable = $.derived(() => $.get(
|
|
4443
|
+
const finalDraggable = $.derived(() => $.get(structurallyLocked) ? false : $.get(renderer).isDraggable ? $.get(renderer).isDraggable($.get(resolvedDraggable), { isEditing: $.get(isEditing) }) : $.get(resolvedDraggable));
|
|
4439
4444
|
const useAP = $.derived(() => {
|
|
4440
4445
|
var _a, _b;
|
|
4441
4446
|
return ((_b = (_a = $.get(tool)) == null ? void 0 : _a.behavior) == null ? void 0 : _b.useAppearanceStream) ?? $.get(renderer).useAppearanceStream ?? true;
|
|
@@ -4457,7 +4462,7 @@ function Annotations($$anchor, $$props) {
|
|
|
4457
4462
|
const noopSelect = $.derived(() => (e) => {
|
|
4458
4463
|
e.stopPropagation();
|
|
4459
4464
|
});
|
|
4460
|
-
const onSelect = $.derived(() => $.get(
|
|
4465
|
+
const onSelect = $.derived(() => $.get(nonInteractive) ? $.get(noopSelect) : $.get(renderer).selectOverride ? (e) => $.get(renderer).selectOverride(e, $.get(annotation), $.get(selectHelpers)) : (e) => handleClick(e, $.get(annotation)));
|
|
4461
4466
|
const RendererComponent = $.derived(() => $.get(hasRenderLocked) ? $.get(renderer).renderLocked : $.get(renderer).component);
|
|
4462
4467
|
{
|
|
4463
4468
|
const children = ($$anchor5, currentObject = $.noop, $$arg1) => {
|
|
@@ -4465,7 +4470,7 @@ function Annotations($$anchor, $$props) {
|
|
|
4465
4470
|
var fragment_4 = $.comment();
|
|
4466
4471
|
var node_3 = $.first_child(fragment_4);
|
|
4467
4472
|
{
|
|
4468
|
-
let $02 = $.derived(() => $.get(
|
|
4473
|
+
let $02 = $.derived(() => $.get(nonInteractive) ? void 0 : $.get(onSelect));
|
|
4469
4474
|
$.component(node_3, () => $.get(RendererComponent), ($$anchor6, RendererComponent_1) => {
|
|
4470
4475
|
RendererComponent_1($$anchor6, {
|
|
4471
4476
|
get annotation() {
|
|
@@ -4500,10 +4505,10 @@ function Annotations($$anchor, $$props) {
|
|
|
4500
4505
|
}
|
|
4501
4506
|
$.append($$anchor5, fragment_4);
|
|
4502
4507
|
};
|
|
4503
|
-
let $0 = $.derived(() => $.get(
|
|
4508
|
+
let $0 = $.derived(() => $.get(nonInteractive) ? false : $.get(isMultiSelected));
|
|
4504
4509
|
let $1 = $.derived(() => {
|
|
4505
4510
|
var _a, _b;
|
|
4506
|
-
return $.get(
|
|
4511
|
+
return $.get(structurallyLocked) ? false : resolveInteractionProp((_a = $.get(tool)) == null ? void 0 : _a.interaction.isResizable, $.get(annotation).object, ((_b = $.get(defaults)) == null ? void 0 : _b.isResizable) ?? false);
|
|
4507
4512
|
});
|
|
4508
4513
|
let $2 = $.derived(() => {
|
|
4509
4514
|
var _a, _b;
|
|
@@ -4511,18 +4516,18 @@ function Annotations($$anchor, $$props) {
|
|
|
4511
4516
|
});
|
|
4512
4517
|
let $3 = $.derived(() => {
|
|
4513
4518
|
var _a, _b;
|
|
4514
|
-
return $.get(
|
|
4519
|
+
return $.get(structurallyLocked) ? false : resolveInteractionProp((_a = $.get(tool)) == null ? void 0 : _a.interaction.isRotatable, $.get(annotation).object, ((_b = $.get(defaults)) == null ? void 0 : _b.isRotatable) ?? false);
|
|
4515
4520
|
});
|
|
4516
|
-
let $4 = $.derived(() => $.get(
|
|
4521
|
+
let $4 = $.derived(() => $.get(structurallyLocked) ? void 0 : $.get(renderer).vertexConfig);
|
|
4517
4522
|
let $5 = $.derived(() => {
|
|
4518
4523
|
var _a, _b;
|
|
4519
|
-
return $.get(
|
|
4524
|
+
return $.get(nonInteractive) ? void 0 : ((_b = (_a = $.get(renderer)).hideSelectionMenu) == null ? void 0 : _b.call(_a, $.get(annotation).object)) ? void 0 : $.get(isMultiSelected) ? void 0 : $$props.selectionMenu;
|
|
4520
4525
|
});
|
|
4521
4526
|
let $6 = $.derived(() => {
|
|
4522
4527
|
var _a, _b;
|
|
4523
|
-
return $.get(
|
|
4528
|
+
return $.get(nonInteractive) ? void 0 : ((_b = (_a = $.get(renderer)).hideSelectionMenu) == null ? void 0 : _b.call(_a, $.get(annotation).object)) ? void 0 : $.get(isMultiSelected) ? void 0 : $$props.selectionMenuSnippet;
|
|
4524
4529
|
});
|
|
4525
|
-
let $7 = $.derived(() => $.get(
|
|
4530
|
+
let $7 = $.derived(() => $.get(nonInteractive) || $.get(contentLocked) ? void 0 : $.get(renderer).onDoubleClick ? (e) => {
|
|
4526
4531
|
e.stopPropagation();
|
|
4527
4532
|
$.get(renderer).onDoubleClick($.get(annotation).object.id, setEditingId);
|
|
4528
4533
|
} : void 0);
|
|
@@ -4566,6 +4571,12 @@ function Annotations($$anchor, $$props) {
|
|
|
4566
4571
|
get selectionMenuSnippet() {
|
|
4567
4572
|
return $.get($6);
|
|
4568
4573
|
},
|
|
4574
|
+
get structurallyLocked() {
|
|
4575
|
+
return $.get(structurallyLocked);
|
|
4576
|
+
},
|
|
4577
|
+
get contentLocked() {
|
|
4578
|
+
return $.get(contentLocked);
|
|
4579
|
+
},
|
|
4569
4580
|
get onSelect() {
|
|
4570
4581
|
return $.get(onSelect);
|
|
4571
4582
|
},
|
|
@@ -4591,13 +4602,13 @@ function Annotations($$anchor, $$props) {
|
|
|
4591
4602
|
}
|
|
4592
4603
|
};
|
|
4593
4604
|
$.if(node_2, ($$render) => {
|
|
4594
|
-
if (!($.get(
|
|
4605
|
+
if (!($.get(nonInteractive) && $.get(renderer).hiddenWhenLocked)) $$render(consequent);
|
|
4595
4606
|
});
|
|
4596
4607
|
}
|
|
4597
4608
|
$.append($$anchor3, fragment_2);
|
|
4598
4609
|
};
|
|
4599
4610
|
$.if(node_1, ($$render) => {
|
|
4600
|
-
if ($.get(renderer)) $$render(consequent_1);
|
|
4611
|
+
if ($.get(renderer) && !hasNoViewFlag($.get(annotation).object) && !hasHiddenFlag($.get(annotation).object)) $$render(consequent_1);
|
|
4601
4612
|
});
|
|
4602
4613
|
}
|
|
4603
4614
|
$.append($$anchor2, fragment_1);
|