@embedpdf/plugin-annotation 3.0.0-next.12 → 3.0.0-next.14

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 (39) hide show
  1. package/dist/{capability-R7dgogJs.cjs → capability-Bt320iJP.cjs} +713 -597
  2. package/dist/capability-Bt320iJP.cjs.map +1 -0
  3. package/dist/{capability-Bh_1PL5v.js → capability-CoL4na7g.js} +712 -572
  4. package/dist/capability-CoL4na7g.js.map +1 -0
  5. package/dist/contract/host.d.cts +2 -2
  6. package/dist/contract/host.d.ts +2 -2
  7. package/dist/contract-C7rcuNp_.d.cts +34 -0
  8. package/dist/contract-CM2Ovdq_.d.ts +34 -0
  9. package/dist/contract-DtXE1hjY.js +32 -0
  10. package/dist/contract-DtXE1hjY.js.map +1 -0
  11. package/dist/contract-a4eaQWga.cjs +67 -0
  12. package/dist/contract-a4eaQWga.cjs.map +1 -0
  13. package/dist/contract.cjs +9 -7
  14. package/dist/contract.d.cts +3 -10
  15. package/dist/contract.d.ts +3 -10
  16. package/dist/contract.js +4 -8
  17. package/dist/index.cjs +58 -7
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +3 -3
  20. package/dist/index.d.ts +3 -3
  21. package/dist/index.js +51 -6
  22. package/dist/index.js.map +1 -1
  23. package/dist/internal.cjs +3 -2
  24. package/dist/internal.d.cts +2 -2
  25. package/dist/internal.d.ts +2 -2
  26. package/dist/internal.js +2 -1
  27. package/dist/tools-B3i1gjRs.cjs +589 -0
  28. package/dist/tools-B3i1gjRs.cjs.map +1 -0
  29. package/dist/tools-DsfqBn_a.js +566 -0
  30. package/dist/tools-DsfqBn_a.js.map +1 -0
  31. package/dist/types-BvB1vUKb.js.map +1 -1
  32. package/dist/{types-BgetZ4BK.d.ts → types-ChRnKozg.d.cts} +131 -14
  33. package/dist/types-Dlhdw2k_.cjs.map +1 -1
  34. package/dist/{types-BAPdbfPT.d.cts → types-Dmz3eRSG.d.ts} +131 -14
  35. package/package.json +9 -9
  36. package/dist/capability-Bh_1PL5v.js.map +0 -1
  37. package/dist/capability-R7dgogJs.cjs.map +0 -1
  38. package/dist/contract.cjs.map +0 -1
  39. package/dist/contract.js.map +0 -1
@@ -0,0 +1,34 @@
1
+ import { n as AnnotationCapability } from "./types-ChRnKozg.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-C7rcuNp_.d.cts.map
@@ -0,0 +1,34 @@
1
+ import { n as AnnotationCapability } from "./types-Dmz3eRSG.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-CM2Ovdq_.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,10 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_tools = require("./tools-B3i1gjRs.cjs");
2
3
  const require_types = require("./types-Dlhdw2k_.cjs");
3
- //#region src/contract.ts
4
- /** The public lens over the host capability's one runtime token. */
5
- const AnnotationToken = require_types.AnnotationToken;
6
- //#endregion
7
- exports.AnnotationToken = AnnotationToken;
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;
8
12
  exports.previewBucket = require_types.previewBucket;
9
-
10
- //# sourceMappingURL=contract.cjs.map
@@ -1,10 +1,3 @@
1
- import { C as ToolGhost, S as ThreadDeleteResult, _ 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 } from "./types-BAPdbfPT.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 StampPlacement, type StampPreviewProvider, type StampToolInput, type TextAlign, type TextItem, type ThreadDeleteResult, type ToolGhost, previewBucket };
10
- //# sourceMappingURL=contract.d.cts.map
1
+ import { B as Face, C as TextItem, D as ARMED_STAMP_TOOL_ID, E as previewBucket, H as TextSelection, S as StampToolInput, T as ToolGhost, V as TextFormat, a as AnnotationHydration, b as StampPlacement, c as Behavior, d as ChromeSettingsPatch, f as CommentPermissions, g as LinkNavItem, h as FilePromptRequest, m as FilePickerProvider, n as AnnotationCapability, o as AnnotationState, p as CommentsApi, r as AnnotationConfig, t as AnnotationAction, u as ChromeSettings, v as SelectionFlags, w as ThreadDeleteResult, x as StampPreviewProvider, y as SelectionProps } from "./types-ChRnKozg.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-C7rcuNp_.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 { C as ToolGhost, S as ThreadDeleteResult, _ 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 } from "./types-BgetZ4BK.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 StampPlacement, type StampPreviewProvider, type StampToolInput, type TextAlign, type TextItem, type ThreadDeleteResult, type ToolGhost, previewBucket };
10
- //# sourceMappingURL=contract.d.ts.map
1
+ import { B as Face, C as TextItem, D as ARMED_STAMP_TOOL_ID, E as previewBucket, H as TextSelection, S as StampToolInput, T as ToolGhost, V as TextFormat, a as AnnotationHydration, b as StampPlacement, c as Behavior, d as ChromeSettingsPatch, f as CommentPermissions, g as LinkNavItem, h as FilePromptRequest, m as FilePickerProvider, n as AnnotationCapability, o as AnnotationState, p as CommentsApi, r as AnnotationConfig, t as AnnotationAction, u as ChromeSettings, v as SelectionFlags, w as ThreadDeleteResult, x as StampPreviewProvider, y as SelectionProps } from "./types-Dmz3eRSG.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-CM2Ovdq_.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 { n as previewBucket, t as AnnotationToken$1 } from "./types-BvB1vUKb.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, previewBucket };
7
-
8
- //# sourceMappingURL=contract.js.map
1
+ import { t as ARMED_STAMP_TOOL_ID } from "./tools-DsfqBn_a.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-R7dgogJs.cjs");
3
+ const require_capability = require("./capability-Bt320iJP.cjs");
4
+ const require_tools = require("./tools-B3i1gjRs.cjs");
4
5
  const require_types = require("./types-Dlhdw2k_.cjs");
5
- const require_contract = require("./contract.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();
@@ -151,6 +177,7 @@ function createEditHandler(anno, interaction) {
151
177
  claimsTouch: (s) => !!s.page && anno.claimsTouchAt(s.page.pon, s.page.point, s.page.scale, s.page.rotation, s.page.zoom),
152
178
  onDown: (s) => {
153
179
  if (!s.page) return false;
180
+ if (anno.distanceCreationPage?.() != null) return false;
154
181
  const touch = s.pointerType === "touch";
155
182
  const wasEditing = anno.currentEditing() != null;
156
183
  if (wasEditing) anno.endTextEdit();
@@ -289,9 +316,16 @@ function createDrawHandler(anno, interaction) {
289
316
  priority: 55,
290
317
  enabledFor: (t) => t.enables.has("annotation-draw"),
291
318
  onDown: (s) => {
292
- if (!s.page) return false;
293
319
  const tool = toolId();
294
320
  const st = subtypeOf(tool);
321
+ const distancePage = anno.distanceCreationPage?.();
322
+ if (distancePage != null) {
323
+ const point = pointOn(s, distancePage);
324
+ if (point) anno.createPointer(tool, "down", distancePage, point);
325
+ origin = null;
326
+ return true;
327
+ }
328
+ if (!s.page) return false;
295
329
  if (st === "ink" && pendingInk) if (pendingInk.tool === tool && pendingInk.pon === s.page.pon) {
296
330
  clearTimeout(pendingInk.timer);
297
331
  pendingInk = null;
@@ -352,6 +386,12 @@ function createDrawHandler(anno, interaction) {
352
386
  onHover: (s) => {
353
387
  const tool = toolId();
354
388
  const st = subtypeOf(tool);
389
+ const distancePage = anno.distanceCreationPage?.();
390
+ if (distancePage != null) {
391
+ const point = pointOn(s, distancePage);
392
+ if (point) anno.createPointer(tool, "move", distancePage, point);
393
+ return;
394
+ }
355
395
  if (s.page && (drawingPoly && isPolyTool(st) || drawingCallout && isCalloutTool(st))) anno.createPointer(tool, "move", s.page.pon, s.page.point);
356
396
  }
357
397
  };
@@ -485,7 +525,8 @@ const initialAnnotationState = (config = {}) => ({
485
525
  hydration: { status: "loading" },
486
526
  chrome: mergeChrome(DEFAULT_CHROME, config.chrome ?? {}),
487
527
  toolGhost: null,
488
- stampArmEpoch: 0
528
+ stampArmEpoch: 0,
529
+ textSelection: null
489
530
  });
490
531
  const annotationReducer = (state, action) => {
491
532
  switch (action.type) {
@@ -505,6 +546,10 @@ const annotationReducer = (state, action) => {
505
546
  ...state,
506
547
  toolGhost: action.ghost
507
548
  };
549
+ case "SET_TEXT_SELECTION": return {
550
+ ...state,
551
+ textSelection: action.selection
552
+ };
508
553
  case "STAMP_ARM_CHANGED": return {
509
554
  ...state,
510
555
  stampArmEpoch: state.stampArmEpoch + 1,
@@ -542,7 +587,7 @@ const annotationPlugin = (config = {}) => (0, _embedpdf_core.definePlugin)({
542
587
  id: tool.id,
543
588
  cursor: tool.cursor,
544
589
  enables: tool.enables,
545
- touchDirect: require_capability.isTouchDirect(tool.enables)
590
+ touchDirect: require_tools.isTouchDirect(tool.enables)
546
591
  });
547
592
  if (tool.defaults) annotation.setDefaults(tool.preset, tool.defaults);
548
593
  }
@@ -562,9 +607,15 @@ const annotationPlugin = (config = {}) => (0, _embedpdf_core.definePlugin)({
562
607
  }
563
608
  });
564
609
  //#endregion
610
+ exports.ANNOTATION_DRAW_PRIORITY = require_contract.ANNOTATION_DRAW_PRIORITY;
611
+ exports.ANNOTATION_EDIT_PRIORITY = require_contract.ANNOTATION_EDIT_PRIORITY;
612
+ exports.ANNOTATION_GHOST_PRIORITY = require_contract.ANNOTATION_GHOST_PRIORITY;
613
+ exports.ANNOTATION_MARQUEE_PRIORITY = require_contract.ANNOTATION_MARQUEE_PRIORITY;
614
+ exports.ANNOTATION_PLACE_PRIORITY = require_contract.ANNOTATION_PLACE_PRIORITY;
615
+ exports.ARMED_STAMP_TOOL_ID = require_tools.ARMED_STAMP_TOOL_ID;
565
616
  exports.AnnotationToken = require_contract.AnnotationToken;
566
617
  exports.DEFAULT_CHROME = DEFAULT_CHROME;
567
- exports.DEFAULT_TOOLS = require_capability.DEFAULT_TOOLS;
618
+ exports.DEFAULT_TOOLS = require_tools.DEFAULT_TOOLS;
568
619
  Object.defineProperty(exports, "MIN_DRAG", {
569
620
  enumerable: true,
570
621
  get: function() {