@embedpdf/plugin-annotation 3.0.0-next.11 → 3.0.0-next.13

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.
Files changed (46) hide show
  1. package/dist/{capability-DBsr2D-L.js → capability-B_dkoB1K.js} +567 -558
  2. package/dist/capability-B_dkoB1K.js.map +1 -0
  3. package/dist/{capability-Csb9WMm-.cjs → capability-DVx1NmTe.cjs} +568 -577
  4. package/dist/capability-DVx1NmTe.cjs.map +1 -0
  5. package/dist/contract/host.cjs +1 -1
  6. package/dist/contract/host.d.cts +1 -1
  7. package/dist/contract/host.d.ts +1 -1
  8. package/dist/contract/host.js +1 -1
  9. package/dist/contract-CgAcfAE7.d.cts +34 -0
  10. package/dist/contract-CiG2_HBq.d.ts +34 -0
  11. package/dist/contract-DtXE1hjY.js +32 -0
  12. package/dist/contract-DtXE1hjY.js.map +1 -0
  13. package/dist/contract-a4eaQWga.cjs +67 -0
  14. package/dist/contract-a4eaQWga.cjs.map +1 -0
  15. package/dist/contract.cjs +11 -7
  16. package/dist/contract.d.cts +3 -10
  17. package/dist/contract.d.ts +3 -10
  18. package/dist/contract.js +4 -8
  19. package/dist/index.cjs +47 -8
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +3 -3
  22. package/dist/index.d.ts +3 -3
  23. package/dist/index.js +39 -7
  24. package/dist/index.js.map +1 -1
  25. package/dist/internal.cjs +4 -3
  26. package/dist/internal.d.cts +1 -1
  27. package/dist/internal.d.ts +1 -1
  28. package/dist/internal.js +3 -2
  29. package/dist/tools-0NI3b9z8.cjs +536 -0
  30. package/dist/tools-0NI3b9z8.cjs.map +1 -0
  31. package/dist/tools-DBEYx3-c.js +513 -0
  32. package/dist/tools-DBEYx3-c.js.map +1 -0
  33. package/dist/{types-CwytT-TI.js → types-BvB1vUKb.js} +9 -2
  34. package/dist/types-BvB1vUKb.js.map +1 -0
  35. package/dist/{types-otwv-Cdl.d.ts → types-D5V0TIwk.d.ts} +133 -19
  36. package/dist/types-Dlhdw2k_.cjs +31 -0
  37. package/dist/types-Dlhdw2k_.cjs.map +1 -0
  38. package/dist/{types-eLTpocXz.d.cts → types-ObcPYc3-.d.cts} +133 -19
  39. package/package.json +9 -9
  40. package/dist/capability-Csb9WMm-.cjs.map +0 -1
  41. package/dist/capability-DBsr2D-L.js.map +0 -1
  42. package/dist/contract.cjs.map +0 -1
  43. package/dist/contract.js.map +0 -1
  44. package/dist/types-CwytT-TI.js.map +0 -1
  45. package/dist/types-DimcLIic.cjs +0 -17
  46. package/dist/types-DimcLIic.cjs.map +0 -1
@@ -0,0 +1,34 @@
1
+ import { n as AnnotationCapability } from "./types-ObcPYc3-.cjs";
2
+ import { AnnotationFlags as AnnotationFlags$1, AnnotationProps as AnnotationProps$1, AnnotationPropsPatch as AnnotationPropsPatch$1, BlendMode, Border, ClickCreate as ClickCreate$1, LineEnding, LineEndings, PropKey as PropKey$1, PropSpec as PropSpec$1, SnapSettings as SnapSettings$1, TextAlign } from "@embedpdf/core-annotation";
3
+ import { AnnotationDTO as AnnotationDTO$1, AnnotationRef as AnnotationRef$1, AnnotationSubtype, Color, CommentThread as CommentThread$1, CommentThreadReview, ReviewStatus } from "@embedpdf/engine-core/runtime";
4
+ import { CapabilityToken } from "@embedpdf/core";
5
+ //#region src/priorities.d.ts
6
+ /**
7
+ * The interaction-hub priorities of the annotation plugin's handlers — the
8
+ * public contract a sibling plugin builds on when it needs to sit ABOVE or
9
+ * BELOW one of them for the same gesture. Priority only breaks ties between
10
+ * simultaneously-ELIGIBLE handlers (the tool's tags decide eligibility).
11
+ *
12
+ * 1000 annotation-ghost never captures; hides the footprint ghost on every down
13
+ * 100 annotation-edit select/move/resize over an existing annotation
14
+ * 95 annotation-place click-to-place an armed payload on empty page space
15
+ * 55 annotation-draw drag-create under a draw tool (below text-select)
16
+ * 50 annotation-marquee empty-space selection, the final fallback
17
+ *
18
+ * A handler that must win a click over an existing annotation while a
19
+ * placing tool is active (a signature mark dropped onto a signature field)
20
+ * registers above {@link ANNOTATION_EDIT_PRIORITY}, not merely above place:
21
+ * the edit handler captures first over any annotation, a widget included.
22
+ */
23
+ declare const ANNOTATION_GHOST_PRIORITY = 1000;
24
+ declare const ANNOTATION_EDIT_PRIORITY = 100;
25
+ declare const ANNOTATION_PLACE_PRIORITY = 95;
26
+ declare const ANNOTATION_DRAW_PRIORITY = 55;
27
+ declare const ANNOTATION_MARQUEE_PRIORITY = 50;
28
+ //#endregion
29
+ //#region src/contract.d.ts
30
+ /** The public lens over the host capability's one runtime token. */
31
+ declare const AnnotationToken: CapabilityToken<AnnotationCapability>;
32
+ //#endregion
33
+ export { ANNOTATION_GHOST_PRIORITY as C, ANNOTATION_EDIT_PRIORITY as S, ANNOTATION_PLACE_PRIORITY as T, PropSpec$1 as _, AnnotationRef$1 as a, TextAlign as b, BlendMode as c, Color as d, CommentThread$1 as f, PropKey$1 as g, LineEndings as h, AnnotationPropsPatch$1 as i, Border as l, LineEnding as m, AnnotationFlags$1 as n, AnnotationSubtype as o, CommentThreadReview as p, AnnotationProps$1 as r, AnnotationToken as s, AnnotationDTO$1 as t, ClickCreate$1 as u, ReviewStatus as v, ANNOTATION_MARQUEE_PRIORITY as w, ANNOTATION_DRAW_PRIORITY as x, SnapSettings$1 as y };
34
+ //# sourceMappingURL=contract-CgAcfAE7.d.cts.map
@@ -0,0 +1,34 @@
1
+ import { n as AnnotationCapability } from "./types-D5V0TIwk.js";
2
+ import { CapabilityToken } from "@embedpdf/core";
3
+ import { AnnotationDTO as AnnotationDTO$1, AnnotationRef as AnnotationRef$1, AnnotationSubtype, Color, CommentThread as CommentThread$1, CommentThreadReview, ReviewStatus } from "@embedpdf/engine-core/runtime";
4
+ import { AnnotationFlags as AnnotationFlags$1, AnnotationProps as AnnotationProps$1, AnnotationPropsPatch as AnnotationPropsPatch$1, BlendMode, Border, ClickCreate as ClickCreate$1, LineEnding, LineEndings, PropKey as PropKey$1, PropSpec as PropSpec$1, SnapSettings as SnapSettings$1, TextAlign } from "@embedpdf/core-annotation";
5
+ //#region src/priorities.d.ts
6
+ /**
7
+ * The interaction-hub priorities of the annotation plugin's handlers — the
8
+ * public contract a sibling plugin builds on when it needs to sit ABOVE or
9
+ * BELOW one of them for the same gesture. Priority only breaks ties between
10
+ * simultaneously-ELIGIBLE handlers (the tool's tags decide eligibility).
11
+ *
12
+ * 1000 annotation-ghost never captures; hides the footprint ghost on every down
13
+ * 100 annotation-edit select/move/resize over an existing annotation
14
+ * 95 annotation-place click-to-place an armed payload on empty page space
15
+ * 55 annotation-draw drag-create under a draw tool (below text-select)
16
+ * 50 annotation-marquee empty-space selection, the final fallback
17
+ *
18
+ * A handler that must win a click over an existing annotation while a
19
+ * placing tool is active (a signature mark dropped onto a signature field)
20
+ * registers above {@link ANNOTATION_EDIT_PRIORITY}, not merely above place:
21
+ * the edit handler captures first over any annotation, a widget included.
22
+ */
23
+ declare const ANNOTATION_GHOST_PRIORITY = 1000;
24
+ declare const ANNOTATION_EDIT_PRIORITY = 100;
25
+ declare const ANNOTATION_PLACE_PRIORITY = 95;
26
+ declare const ANNOTATION_DRAW_PRIORITY = 55;
27
+ declare const ANNOTATION_MARQUEE_PRIORITY = 50;
28
+ //#endregion
29
+ //#region src/contract.d.ts
30
+ /** The public lens over the host capability's one runtime token. */
31
+ declare const AnnotationToken: CapabilityToken<AnnotationCapability>;
32
+ //#endregion
33
+ export { ANNOTATION_GHOST_PRIORITY as C, ANNOTATION_EDIT_PRIORITY as S, ANNOTATION_PLACE_PRIORITY as T, PropSpec$1 as _, AnnotationRef$1 as a, TextAlign as b, BlendMode as c, Color as d, CommentThread$1 as f, PropKey$1 as g, LineEndings as h, AnnotationPropsPatch$1 as i, Border as l, LineEnding as m, AnnotationFlags$1 as n, AnnotationSubtype as o, CommentThreadReview as p, AnnotationProps$1 as r, AnnotationToken as s, AnnotationDTO$1 as t, ClickCreate$1 as u, ReviewStatus as v, ANNOTATION_MARQUEE_PRIORITY as w, ANNOTATION_DRAW_PRIORITY as x, SnapSettings$1 as y };
34
+ //# sourceMappingURL=contract-CiG2_HBq.d.ts.map
@@ -0,0 +1,32 @@
1
+ import { t as AnnotationToken$1 } from "./types-BvB1vUKb.js";
2
+ //#region src/priorities.ts
3
+ /**
4
+ * The interaction-hub priorities of the annotation plugin's handlers — the
5
+ * public contract a sibling plugin builds on when it needs to sit ABOVE or
6
+ * BELOW one of them for the same gesture. Priority only breaks ties between
7
+ * simultaneously-ELIGIBLE handlers (the tool's tags decide eligibility).
8
+ *
9
+ * 1000 annotation-ghost never captures; hides the footprint ghost on every down
10
+ * 100 annotation-edit select/move/resize over an existing annotation
11
+ * 95 annotation-place click-to-place an armed payload on empty page space
12
+ * 55 annotation-draw drag-create under a draw tool (below text-select)
13
+ * 50 annotation-marquee empty-space selection, the final fallback
14
+ *
15
+ * A handler that must win a click over an existing annotation while a
16
+ * placing tool is active (a signature mark dropped onto a signature field)
17
+ * registers above {@link ANNOTATION_EDIT_PRIORITY}, not merely above place:
18
+ * the edit handler captures first over any annotation, a widget included.
19
+ */
20
+ const ANNOTATION_GHOST_PRIORITY = 1e3;
21
+ const ANNOTATION_EDIT_PRIORITY = 100;
22
+ const ANNOTATION_PLACE_PRIORITY = 95;
23
+ const ANNOTATION_DRAW_PRIORITY = 55;
24
+ const ANNOTATION_MARQUEE_PRIORITY = 50;
25
+ //#endregion
26
+ //#region src/contract.ts
27
+ /** The public lens over the host capability's one runtime token. */
28
+ const AnnotationToken = AnnotationToken$1;
29
+ //#endregion
30
+ export { ANNOTATION_MARQUEE_PRIORITY as a, ANNOTATION_GHOST_PRIORITY as i, ANNOTATION_DRAW_PRIORITY as n, ANNOTATION_PLACE_PRIORITY as o, ANNOTATION_EDIT_PRIORITY as r, AnnotationToken as t };
31
+
32
+ //# sourceMappingURL=contract-DtXE1hjY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-DtXE1hjY.js","names":["AnnotationHostToken"],"sources":["../src/priorities.ts","../src/contract.ts"],"sourcesContent":["/**\n * The interaction-hub priorities of the annotation plugin's handlers — the\n * public contract a sibling plugin builds on when it needs to sit ABOVE or\n * BELOW one of them for the same gesture. Priority only breaks ties between\n * simultaneously-ELIGIBLE handlers (the tool's tags decide eligibility).\n *\n * 1000 annotation-ghost never captures; hides the footprint ghost on every down\n * 100 annotation-edit select/move/resize over an existing annotation\n * 95 annotation-place click-to-place an armed payload on empty page space\n * 55 annotation-draw drag-create under a draw tool (below text-select)\n * 50 annotation-marquee empty-space selection, the final fallback\n *\n * A handler that must win a click over an existing annotation while a\n * placing tool is active (a signature mark dropped onto a signature field)\n * registers above {@link ANNOTATION_EDIT_PRIORITY}, not merely above place:\n * the edit handler captures first over any annotation, a widget included.\n */\nexport const ANNOTATION_GHOST_PRIORITY = 1000;\nexport const ANNOTATION_EDIT_PRIORITY = 100;\nexport const ANNOTATION_PLACE_PRIORITY = 95;\nexport const ANNOTATION_DRAW_PRIORITY = 55;\nexport const ANNOTATION_MARQUEE_PRIORITY = 50;\n","/**\n * Public annotation protocol without the repository, reducer, tools, or plugin\n * wiring. Cross-package capability consumers import this entry.\n */\nimport type { CapabilityToken } from '@embedpdf/core';\n\nimport { AnnotationToken as AnnotationHostToken } from './types';\nimport type { AnnotationCapability } from './types';\n\nexport type {\n AnnotationCapability,\n AnnotationConfig,\n AnnotationState,\n AnnotationAction,\n AnnotationHydration,\n Behavior,\n CommentPermissions,\n CommentsApi,\n ThreadDeleteResult,\n ChromeSettings,\n ChromeSettingsPatch,\n LinkNavItem,\n SelectionFlags,\n SelectionProps,\n StampPlacement,\n StampPreviewProvider,\n StampToolInput,\n FilePickerProvider,\n FilePromptRequest,\n TextItem,\n ToolGhost,\n} from './types';\nexport type { Face, TextFormat, TextSelection } from './rich-text';\nexport type {\n AnnotationDTO,\n AnnotationRef,\n AnnotationSubtype,\n Color,\n CommentThread,\n CommentThreadReview,\n ReviewStatus,\n} from '@embedpdf/engine-core/runtime';\nexport type {\n AnnotationFlags,\n AnnotationProps,\n AnnotationPropsPatch,\n BlendMode,\n Border,\n ClickCreate,\n LineEnding,\n LineEndings,\n PropKey,\n PropSpec,\n SnapSettings,\n TextAlign,\n} from '@embedpdf/core-annotation';\n\n/** The public lens over the host capability's one runtime token. */\nexport const AnnotationToken =\n AnnotationHostToken as unknown as CapabilityToken<AnnotationCapability>;\nexport { previewBucket } from './types';\n/** The tool `armStamp` activates — a sibling that must win a click while a payload is armed keys on it. */\nexport { ARMED_STAMP_TOOL_ID } from './tools';\nexport {\n ANNOTATION_DRAW_PRIORITY,\n ANNOTATION_EDIT_PRIORITY,\n ANNOTATION_GHOST_PRIORITY,\n ANNOTATION_MARQUEE_PRIORITY,\n ANNOTATION_PLACE_PRIORITY,\n} from './priorities';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiBA,MAAa,4BAA4B;AACzC,MAAa,2BAA2B;AACxC,MAAa,4BAA4B;AACzC,MAAa,2BAA2B;AACxC,MAAa,8BAA8B;;;;ACqC3C,MAAa,kBACXA"}
@@ -0,0 +1,67 @@
1
+ const require_types = require("./types-Dlhdw2k_.cjs");
2
+ //#region src/priorities.ts
3
+ /**
4
+ * The interaction-hub priorities of the annotation plugin's handlers — the
5
+ * public contract a sibling plugin builds on when it needs to sit ABOVE or
6
+ * BELOW one of them for the same gesture. Priority only breaks ties between
7
+ * simultaneously-ELIGIBLE handlers (the tool's tags decide eligibility).
8
+ *
9
+ * 1000 annotation-ghost never captures; hides the footprint ghost on every down
10
+ * 100 annotation-edit select/move/resize over an existing annotation
11
+ * 95 annotation-place click-to-place an armed payload on empty page space
12
+ * 55 annotation-draw drag-create under a draw tool (below text-select)
13
+ * 50 annotation-marquee empty-space selection, the final fallback
14
+ *
15
+ * A handler that must win a click over an existing annotation while a
16
+ * placing tool is active (a signature mark dropped onto a signature field)
17
+ * registers above {@link ANNOTATION_EDIT_PRIORITY}, not merely above place:
18
+ * the edit handler captures first over any annotation, a widget included.
19
+ */
20
+ const ANNOTATION_GHOST_PRIORITY = 1e3;
21
+ const ANNOTATION_EDIT_PRIORITY = 100;
22
+ const ANNOTATION_PLACE_PRIORITY = 95;
23
+ const ANNOTATION_DRAW_PRIORITY = 55;
24
+ const ANNOTATION_MARQUEE_PRIORITY = 50;
25
+ //#endregion
26
+ //#region src/contract.ts
27
+ /** The public lens over the host capability's one runtime token. */
28
+ const AnnotationToken = require_types.AnnotationToken;
29
+ //#endregion
30
+ Object.defineProperty(exports, "ANNOTATION_DRAW_PRIORITY", {
31
+ enumerable: true,
32
+ get: function() {
33
+ return ANNOTATION_DRAW_PRIORITY;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "ANNOTATION_EDIT_PRIORITY", {
37
+ enumerable: true,
38
+ get: function() {
39
+ return ANNOTATION_EDIT_PRIORITY;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "ANNOTATION_GHOST_PRIORITY", {
43
+ enumerable: true,
44
+ get: function() {
45
+ return ANNOTATION_GHOST_PRIORITY;
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "ANNOTATION_MARQUEE_PRIORITY", {
49
+ enumerable: true,
50
+ get: function() {
51
+ return ANNOTATION_MARQUEE_PRIORITY;
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "ANNOTATION_PLACE_PRIORITY", {
55
+ enumerable: true,
56
+ get: function() {
57
+ return ANNOTATION_PLACE_PRIORITY;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "AnnotationToken", {
61
+ enumerable: true,
62
+ get: function() {
63
+ return AnnotationToken;
64
+ }
65
+ });
66
+
67
+ //# sourceMappingURL=contract-a4eaQWga.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract-a4eaQWga.cjs","names":["AnnotationHostToken"],"sources":["../src/priorities.ts","../src/contract.ts"],"sourcesContent":["/**\n * The interaction-hub priorities of the annotation plugin's handlers — the\n * public contract a sibling plugin builds on when it needs to sit ABOVE or\n * BELOW one of them for the same gesture. Priority only breaks ties between\n * simultaneously-ELIGIBLE handlers (the tool's tags decide eligibility).\n *\n * 1000 annotation-ghost never captures; hides the footprint ghost on every down\n * 100 annotation-edit select/move/resize over an existing annotation\n * 95 annotation-place click-to-place an armed payload on empty page space\n * 55 annotation-draw drag-create under a draw tool (below text-select)\n * 50 annotation-marquee empty-space selection, the final fallback\n *\n * A handler that must win a click over an existing annotation while a\n * placing tool is active (a signature mark dropped onto a signature field)\n * registers above {@link ANNOTATION_EDIT_PRIORITY}, not merely above place:\n * the edit handler captures first over any annotation, a widget included.\n */\nexport const ANNOTATION_GHOST_PRIORITY = 1000;\nexport const ANNOTATION_EDIT_PRIORITY = 100;\nexport const ANNOTATION_PLACE_PRIORITY = 95;\nexport const ANNOTATION_DRAW_PRIORITY = 55;\nexport const ANNOTATION_MARQUEE_PRIORITY = 50;\n","/**\n * Public annotation protocol without the repository, reducer, tools, or plugin\n * wiring. Cross-package capability consumers import this entry.\n */\nimport type { CapabilityToken } from '@embedpdf/core';\n\nimport { AnnotationToken as AnnotationHostToken } from './types';\nimport type { AnnotationCapability } from './types';\n\nexport type {\n AnnotationCapability,\n AnnotationConfig,\n AnnotationState,\n AnnotationAction,\n AnnotationHydration,\n Behavior,\n CommentPermissions,\n CommentsApi,\n ThreadDeleteResult,\n ChromeSettings,\n ChromeSettingsPatch,\n LinkNavItem,\n SelectionFlags,\n SelectionProps,\n StampPlacement,\n StampPreviewProvider,\n StampToolInput,\n FilePickerProvider,\n FilePromptRequest,\n TextItem,\n ToolGhost,\n} from './types';\nexport type { Face, TextFormat, TextSelection } from './rich-text';\nexport type {\n AnnotationDTO,\n AnnotationRef,\n AnnotationSubtype,\n Color,\n CommentThread,\n CommentThreadReview,\n ReviewStatus,\n} from '@embedpdf/engine-core/runtime';\nexport type {\n AnnotationFlags,\n AnnotationProps,\n AnnotationPropsPatch,\n BlendMode,\n Border,\n ClickCreate,\n LineEnding,\n LineEndings,\n PropKey,\n PropSpec,\n SnapSettings,\n TextAlign,\n} from '@embedpdf/core-annotation';\n\n/** The public lens over the host capability's one runtime token. */\nexport const AnnotationToken =\n AnnotationHostToken as unknown as CapabilityToken<AnnotationCapability>;\nexport { previewBucket } from './types';\n/** The tool `armStamp` activates — a sibling that must win a click while a payload is armed keys on it. */\nexport { ARMED_STAMP_TOOL_ID } from './tools';\nexport {\n ANNOTATION_DRAW_PRIORITY,\n ANNOTATION_EDIT_PRIORITY,\n ANNOTATION_GHOST_PRIORITY,\n ANNOTATION_MARQUEE_PRIORITY,\n ANNOTATION_PLACE_PRIORITY,\n} from './priorities';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiBA,MAAa,4BAA4B;AACzC,MAAa,2BAA2B;AACxC,MAAa,4BAA4B;AACzC,MAAa,2BAA2B;AACxC,MAAa,8BAA8B;;;;ACqC3C,MAAa,kBACXA,cAAAA"}
package/dist/contract.cjs CHANGED
@@ -1,8 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/contract.ts
3
- /** The public lens over the host capability's one runtime token. */
4
- const AnnotationToken = require("./types-DimcLIic.cjs").AnnotationToken;
5
- //#endregion
6
- exports.AnnotationToken = AnnotationToken;
7
-
8
- //# sourceMappingURL=contract.cjs.map
2
+ const require_tools = require("./tools-0NI3b9z8.cjs");
3
+ const require_types = require("./types-Dlhdw2k_.cjs");
4
+ const require_contract = require("./contract-a4eaQWga.cjs");
5
+ exports.ANNOTATION_DRAW_PRIORITY = require_contract.ANNOTATION_DRAW_PRIORITY;
6
+ exports.ANNOTATION_EDIT_PRIORITY = require_contract.ANNOTATION_EDIT_PRIORITY;
7
+ exports.ANNOTATION_GHOST_PRIORITY = require_contract.ANNOTATION_GHOST_PRIORITY;
8
+ exports.ANNOTATION_MARQUEE_PRIORITY = require_contract.ANNOTATION_MARQUEE_PRIORITY;
9
+ exports.ANNOTATION_PLACE_PRIORITY = require_contract.ANNOTATION_PLACE_PRIORITY;
10
+ exports.ARMED_STAMP_TOOL_ID = require_tools.ARMED_STAMP_TOOL_ID;
11
+ exports.AnnotationToken = require_contract.AnnotationToken;
12
+ exports.previewBucket = require_types.previewBucket;
@@ -1,10 +1,3 @@
1
- import { _ as SelectionProps, a as AnnotationHydration, b as ThreadDeleteResult, c as Behavior, d as CommentPermissions, f as CommentsApi, g as SelectionFlags, h as LinkNavItem, l as ChromeSettings, m as FilePromptRequest, n as AnnotationCapability, o as AnnotationState, p as FilePickerProvider, r as AnnotationConfig, t as AnnotationAction, u as ChromeSettingsPatch, v as StampToolInput, x as ToolGhost, y as TextItem } from "./types-eLTpocXz.cjs";
2
- import { AnnotationFlags, AnnotationProps, AnnotationPropsPatch, BlendMode, Border, ClickCreate, LineEnding, LineEndings, PropKey, PropSpec, SnapSettings, TextAlign } from "@embedpdf/core-annotation";
3
- import { AnnotationDTO, AnnotationRef, AnnotationSubtype, Color, CommentThread, CommentThreadReview, ReviewStatus } from "@embedpdf/engine-core/runtime";
4
- import { CapabilityToken } from "@embedpdf/core";
5
- //#region src/contract.d.ts
6
- /** The public lens over the host capability's one runtime token. */
7
- declare const AnnotationToken: CapabilityToken<AnnotationCapability>;
8
- //#endregion
9
- export { type AnnotationAction, type AnnotationCapability, type AnnotationConfig, type AnnotationDTO, type AnnotationFlags, type AnnotationHydration, type AnnotationProps, type AnnotationPropsPatch, type AnnotationRef, type AnnotationState, type AnnotationSubtype, AnnotationToken, type Behavior, type BlendMode, type Border, type ChromeSettings, type ChromeSettingsPatch, type ClickCreate, type Color, type CommentPermissions, type CommentThread, type CommentThreadReview, type CommentsApi, type FilePickerProvider, type FilePromptRequest, type LineEnding, type LineEndings, type LinkNavItem, type PropKey, type PropSpec, type ReviewStatus, type SelectionFlags, type SelectionProps, type SnapSettings, type StampToolInput, type TextAlign, type TextItem, type ThreadDeleteResult, type ToolGhost };
10
- //# sourceMappingURL=contract.d.cts.map
1
+ import { B as TextSelection, C as ToolGhost, R as Face, S as ThreadDeleteResult, T as ARMED_STAMP_TOOL_ID, _ as SelectionProps, a as AnnotationHydration, b as StampToolInput, c as Behavior, d as CommentPermissions, f as CommentsApi, g as SelectionFlags, h as LinkNavItem, l as ChromeSettings, m as FilePromptRequest, n as AnnotationCapability, o as AnnotationState, p as FilePickerProvider, r as AnnotationConfig, t as AnnotationAction, u as ChromeSettingsPatch, v as StampPlacement, w as previewBucket, x as TextItem, y as StampPreviewProvider, z as TextFormat } from "./types-ObcPYc3-.cjs";
2
+ import { C as ANNOTATION_GHOST_PRIORITY, S as ANNOTATION_EDIT_PRIORITY, T as ANNOTATION_PLACE_PRIORITY, _ as PropSpec, a as AnnotationRef, b as TextAlign, c as BlendMode, d as Color, f as CommentThread, g as PropKey, h as LineEndings, i as AnnotationPropsPatch, l as Border, m as LineEnding, n as AnnotationFlags, o as AnnotationSubtype, p as CommentThreadReview, r as AnnotationProps, s as AnnotationToken, t as AnnotationDTO, u as ClickCreate, v as ReviewStatus, w as ANNOTATION_MARQUEE_PRIORITY, x as ANNOTATION_DRAW_PRIORITY, y as SnapSettings } from "./contract-CgAcfAE7.cjs";
3
+ export { ANNOTATION_DRAW_PRIORITY, ANNOTATION_EDIT_PRIORITY, ANNOTATION_GHOST_PRIORITY, ANNOTATION_MARQUEE_PRIORITY, ANNOTATION_PLACE_PRIORITY, ARMED_STAMP_TOOL_ID, type AnnotationAction, type AnnotationCapability, type AnnotationConfig, type AnnotationDTO, type AnnotationFlags, type AnnotationHydration, type AnnotationProps, type AnnotationPropsPatch, type AnnotationRef, type AnnotationState, type AnnotationSubtype, AnnotationToken, type Behavior, type BlendMode, type Border, type ChromeSettings, type ChromeSettingsPatch, type ClickCreate, type Color, type CommentPermissions, type CommentThread, type CommentThreadReview, type CommentsApi, type Face, type FilePickerProvider, type FilePromptRequest, type LineEnding, type LineEndings, type LinkNavItem, type PropKey, type PropSpec, type ReviewStatus, type SelectionFlags, type SelectionProps, type SnapSettings, type StampPlacement, type StampPreviewProvider, type StampToolInput, type TextAlign, type TextFormat, type TextItem, type TextSelection, type ThreadDeleteResult, type ToolGhost, previewBucket };
@@ -1,10 +1,3 @@
1
- import { _ as SelectionProps, a as AnnotationHydration, b as ThreadDeleteResult, c as Behavior, d as CommentPermissions, f as CommentsApi, g as SelectionFlags, h as LinkNavItem, l as ChromeSettings, m as FilePromptRequest, n as AnnotationCapability, o as AnnotationState, p as FilePickerProvider, r as AnnotationConfig, t as AnnotationAction, u as ChromeSettingsPatch, v as StampToolInput, x as ToolGhost, y as TextItem } from "./types-otwv-Cdl.js";
2
- import { CapabilityToken } from "@embedpdf/core";
3
- import { AnnotationDTO, AnnotationRef, AnnotationSubtype, Color, CommentThread, CommentThreadReview, ReviewStatus } from "@embedpdf/engine-core/runtime";
4
- import { AnnotationFlags, AnnotationProps, AnnotationPropsPatch, BlendMode, Border, ClickCreate, LineEnding, LineEndings, PropKey, PropSpec, SnapSettings, TextAlign } from "@embedpdf/core-annotation";
5
- //#region src/contract.d.ts
6
- /** The public lens over the host capability's one runtime token. */
7
- declare const AnnotationToken: CapabilityToken<AnnotationCapability>;
8
- //#endregion
9
- export { type AnnotationAction, type AnnotationCapability, type AnnotationConfig, type AnnotationDTO, type AnnotationFlags, type AnnotationHydration, type AnnotationProps, type AnnotationPropsPatch, type AnnotationRef, type AnnotationState, type AnnotationSubtype, AnnotationToken, type Behavior, type BlendMode, type Border, type ChromeSettings, type ChromeSettingsPatch, type ClickCreate, type Color, type CommentPermissions, type CommentThread, type CommentThreadReview, type CommentsApi, type FilePickerProvider, type FilePromptRequest, type LineEnding, type LineEndings, type LinkNavItem, type PropKey, type PropSpec, type ReviewStatus, type SelectionFlags, type SelectionProps, type SnapSettings, type StampToolInput, type TextAlign, type TextItem, type ThreadDeleteResult, type ToolGhost };
10
- //# sourceMappingURL=contract.d.ts.map
1
+ import { B as TextSelection, C as ToolGhost, R as Face, S as ThreadDeleteResult, T as ARMED_STAMP_TOOL_ID, _ as SelectionProps, a as AnnotationHydration, b as StampToolInput, c as Behavior, d as CommentPermissions, f as CommentsApi, g as SelectionFlags, h as LinkNavItem, l as ChromeSettings, m as FilePromptRequest, n as AnnotationCapability, o as AnnotationState, p as FilePickerProvider, r as AnnotationConfig, t as AnnotationAction, u as ChromeSettingsPatch, v as StampPlacement, w as previewBucket, x as TextItem, y as StampPreviewProvider, z as TextFormat } from "./types-D5V0TIwk.js";
2
+ import { C as ANNOTATION_GHOST_PRIORITY, S as ANNOTATION_EDIT_PRIORITY, T as ANNOTATION_PLACE_PRIORITY, _ as PropSpec, a as AnnotationRef, b as TextAlign, c as BlendMode, d as Color, f as CommentThread, g as PropKey, h as LineEndings, i as AnnotationPropsPatch, l as Border, m as LineEnding, n as AnnotationFlags, o as AnnotationSubtype, p as CommentThreadReview, r as AnnotationProps, s as AnnotationToken, t as AnnotationDTO, u as ClickCreate, v as ReviewStatus, w as ANNOTATION_MARQUEE_PRIORITY, x as ANNOTATION_DRAW_PRIORITY, y as SnapSettings } from "./contract-CiG2_HBq.js";
3
+ export { ANNOTATION_DRAW_PRIORITY, ANNOTATION_EDIT_PRIORITY, ANNOTATION_GHOST_PRIORITY, ANNOTATION_MARQUEE_PRIORITY, ANNOTATION_PLACE_PRIORITY, ARMED_STAMP_TOOL_ID, type AnnotationAction, type AnnotationCapability, type AnnotationConfig, type AnnotationDTO, type AnnotationFlags, type AnnotationHydration, type AnnotationProps, type AnnotationPropsPatch, type AnnotationRef, type AnnotationState, type AnnotationSubtype, AnnotationToken, type Behavior, type BlendMode, type Border, type ChromeSettings, type ChromeSettingsPatch, type ClickCreate, type Color, type CommentPermissions, type CommentThread, type CommentThreadReview, type CommentsApi, type Face, type FilePickerProvider, type FilePromptRequest, type LineEnding, type LineEndings, type LinkNavItem, type PropKey, type PropSpec, type ReviewStatus, type SelectionFlags, type SelectionProps, type SnapSettings, type StampPlacement, type StampPreviewProvider, type StampToolInput, type TextAlign, type TextFormat, type TextItem, type TextSelection, type ThreadDeleteResult, type ToolGhost, previewBucket };
package/dist/contract.js CHANGED
@@ -1,8 +1,4 @@
1
- import { t as AnnotationToken$1 } from "./types-CwytT-TI.js";
2
- //#region src/contract.ts
3
- /** The public lens over the host capability's one runtime token. */
4
- const AnnotationToken = AnnotationToken$1;
5
- //#endregion
6
- export { AnnotationToken };
7
-
8
- //# sourceMappingURL=contract.js.map
1
+ import { t as ARMED_STAMP_TOOL_ID } from "./tools-DBEYx3-c.js";
2
+ import { n as previewBucket } from "./types-BvB1vUKb.js";
3
+ import { a as ANNOTATION_MARQUEE_PRIORITY, i as ANNOTATION_GHOST_PRIORITY, n as ANNOTATION_DRAW_PRIORITY, o as ANNOTATION_PLACE_PRIORITY, r as ANNOTATION_EDIT_PRIORITY, t as AnnotationToken } from "./contract-DtXE1hjY.js";
4
+ export { ANNOTATION_DRAW_PRIORITY, ANNOTATION_EDIT_PRIORITY, ANNOTATION_GHOST_PRIORITY, ANNOTATION_MARQUEE_PRIORITY, ANNOTATION_PLACE_PRIORITY, ARMED_STAMP_TOOL_ID, AnnotationToken, previewBucket };
package/dist/index.cjs CHANGED
@@ -1,8 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_seam = require("./seam-6pJeKOOJ.cjs");
3
- const require_capability = require("./capability-Csb9WMm-.cjs");
4
- const require_types = require("./types-DimcLIic.cjs");
5
- const require_contract = require("./contract.cjs");
3
+ const require_capability = require("./capability-DVx1NmTe.cjs");
4
+ const require_tools = require("./tools-0NI3b9z8.cjs");
5
+ const require_types = require("./types-Dlhdw2k_.cjs");
6
+ const require_contract = require("./contract-a4eaQWga.cjs");
6
7
  require("./authoring.cjs");
7
8
  let _embedpdf_core = require("@embedpdf/core");
8
9
  let _embedpdf_plugin_actions_contract = require("@embedpdf/plugin-actions/contract");
@@ -34,6 +35,31 @@ function registerAnnotationEffects(ctx) {
34
35
  });
35
36
  return;
36
37
  }
38
+ if (event.type === "form.fieldUpdated") {
39
+ apply({
40
+ t: "bumpAp",
41
+ ids: event.field.widgets.filter((w) => w.annotObjectNumber > 0).map((w) => (0, _embedpdf_engine_core_runtime.encodeStableIdKey)({
42
+ kind: "objectNumber",
43
+ value: w.annotObjectNumber
44
+ }))
45
+ });
46
+ return;
47
+ }
48
+ if (event.type === "signature.completed") {
49
+ const widget = event.signature.widget;
50
+ if (widget && widget.annotObjectNumber > 0) apply({
51
+ t: "bumpAp",
52
+ ids: [(0, _embedpdf_engine_core_runtime.encodeStableIdKey)({
53
+ kind: "objectNumber",
54
+ value: widget.annotObjectNumber
55
+ })]
56
+ });
57
+ return;
58
+ }
59
+ if (event.type === "document.versioned") {
60
+ host().rehydrate();
61
+ return;
62
+ }
37
63
  if (event.type === "redaction.applied") {
38
64
  const affected = new Set(event.results.filter((r) => r.status === "applied").map((r) => r.pageObjectNumber));
39
65
  if (affected.size) for (const pon of affected) host().reloadPage(pon);
@@ -126,7 +152,7 @@ function createGhostHandler(anno, interaction) {
126
152
  };
127
153
  return {
128
154
  id: "annotation-ghost",
129
- priority: 1e3,
155
+ priority: require_contract.ANNOTATION_GHOST_PRIORITY,
130
156
  enabledFor: () => true,
131
157
  onDown: () => {
132
158
  anno.clearGhost();
@@ -485,7 +511,8 @@ const initialAnnotationState = (config = {}) => ({
485
511
  hydration: { status: "loading" },
486
512
  chrome: mergeChrome(DEFAULT_CHROME, config.chrome ?? {}),
487
513
  toolGhost: null,
488
- stampArmEpoch: 0
514
+ stampArmEpoch: 0,
515
+ textSelection: null
489
516
  });
490
517
  const annotationReducer = (state, action) => {
491
518
  switch (action.type) {
@@ -505,6 +532,10 @@ const annotationReducer = (state, action) => {
505
532
  ...state,
506
533
  toolGhost: action.ghost
507
534
  };
535
+ case "SET_TEXT_SELECTION": return {
536
+ ...state,
537
+ textSelection: action.selection
538
+ };
508
539
  case "STAMP_ARM_CHANGED": return {
509
540
  ...state,
510
541
  stampArmEpoch: state.stampArmEpoch + 1,
@@ -542,7 +573,7 @@ const annotationPlugin = (config = {}) => (0, _embedpdf_core.definePlugin)({
542
573
  id: tool.id,
543
574
  cursor: tool.cursor,
544
575
  enables: tool.enables,
545
- touchDirect: require_capability.isTouchDirect(tool.enables)
576
+ touchDirect: require_tools.isTouchDirect(tool.enables)
546
577
  });
547
578
  if (tool.defaults) annotation.setDefaults(tool.preset, tool.defaults);
548
579
  }
@@ -555,15 +586,22 @@ const annotationPlugin = (config = {}) => (0, _embedpdf_core.definePlugin)({
555
586
  annotation.cancel();
556
587
  annotation.clearGhost();
557
588
  annotation.pruneEngagedSelection();
558
- if (!interaction.activeTool().enables.has("annotation-stamp")) annotation.disarmStamp();
589
+ const active = interaction.activeTool();
590
+ if (active.id !== "stamp" && !active.enables.has("annotation-stamp")) annotation.disarmStamp();
559
591
  });
560
592
  if (selection) wireMarkup(annotation, selection, interaction);
561
593
  }
562
594
  });
563
595
  //#endregion
596
+ exports.ANNOTATION_DRAW_PRIORITY = require_contract.ANNOTATION_DRAW_PRIORITY;
597
+ exports.ANNOTATION_EDIT_PRIORITY = require_contract.ANNOTATION_EDIT_PRIORITY;
598
+ exports.ANNOTATION_GHOST_PRIORITY = require_contract.ANNOTATION_GHOST_PRIORITY;
599
+ exports.ANNOTATION_MARQUEE_PRIORITY = require_contract.ANNOTATION_MARQUEE_PRIORITY;
600
+ exports.ANNOTATION_PLACE_PRIORITY = require_contract.ANNOTATION_PLACE_PRIORITY;
601
+ exports.ARMED_STAMP_TOOL_ID = require_tools.ARMED_STAMP_TOOL_ID;
564
602
  exports.AnnotationToken = require_contract.AnnotationToken;
565
603
  exports.DEFAULT_CHROME = DEFAULT_CHROME;
566
- exports.DEFAULT_TOOLS = require_capability.DEFAULT_TOOLS;
604
+ exports.DEFAULT_TOOLS = require_tools.DEFAULT_TOOLS;
567
605
  Object.defineProperty(exports, "MIN_DRAG", {
568
606
  enumerable: true,
569
607
  get: function() {
@@ -572,6 +610,7 @@ Object.defineProperty(exports, "MIN_DRAG", {
572
610
  });
573
611
  exports.annotationPlugin = annotationPlugin;
574
612
  exports.fromDTO = require_capability.fromDTO;
613
+ exports.previewBucket = require_types.previewBucket;
575
614
  Object.defineProperty(exports, "propsFor", {
576
615
  enumerable: true,
577
616
  get: function() {