@embedpdf/plugin-annotation 2.5.0 → 2.6.1

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 (71) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +1061 -430
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/annotation-plugin.d.ts +24 -6
  6. package/dist/lib/geometry/index.d.ts +1 -0
  7. package/dist/lib/geometry/rotation.d.ts +32 -0
  8. package/dist/lib/handlers/types.d.ts +3 -1
  9. package/dist/lib/index.d.ts +1 -0
  10. package/dist/lib/patching/base-patch.d.ts +87 -0
  11. package/dist/lib/patching/index.d.ts +1 -0
  12. package/dist/lib/patching/insert-upright.d.ts +20 -0
  13. package/dist/lib/patching/patch-registry.d.ts +14 -1
  14. package/dist/lib/patching/patch-utils.d.ts +54 -1
  15. package/dist/lib/patching/patches/circle.patch.d.ts +3 -0
  16. package/dist/lib/patching/patches/freetext.patch.d.ts +3 -0
  17. package/dist/lib/patching/patches/index.d.ts +4 -0
  18. package/dist/lib/patching/patches/square.patch.d.ts +3 -0
  19. package/dist/lib/patching/patches/stamp.patch.d.ts +3 -0
  20. package/dist/lib/tools/default-tools.d.ts +32 -0
  21. package/dist/lib/tools/types.d.ts +20 -1
  22. package/dist/lib/types.d.ts +67 -3
  23. package/dist/preact/adapter.d.ts +3 -0
  24. package/dist/preact/index.cjs +1 -1
  25. package/dist/preact/index.cjs.map +1 -1
  26. package/dist/preact/index.js +793 -126
  27. package/dist/preact/index.js.map +1 -1
  28. package/dist/react/adapter.d.ts +2 -1
  29. package/dist/react/index.cjs +1 -1
  30. package/dist/react/index.cjs.map +1 -1
  31. package/dist/react/index.js +793 -126
  32. package/dist/react/index.js.map +1 -1
  33. package/dist/shared/components/annotation-container.d.ts +10 -2
  34. package/dist/shared/components/annotation-layer.d.ts +9 -3
  35. package/dist/shared/components/annotations.d.ts +4 -1
  36. package/dist/shared/components/group-selection-box.d.ts +12 -4
  37. package/dist/shared/components/render-annotation.d.ts +2 -1
  38. package/dist/shared/components/types.d.ts +51 -1
  39. package/dist/shared-preact/components/annotation-container.d.ts +10 -2
  40. package/dist/shared-preact/components/annotation-layer.d.ts +9 -3
  41. package/dist/shared-preact/components/annotations.d.ts +4 -1
  42. package/dist/shared-preact/components/group-selection-box.d.ts +12 -4
  43. package/dist/shared-preact/components/render-annotation.d.ts +2 -1
  44. package/dist/shared-preact/components/types.d.ts +51 -1
  45. package/dist/shared-react/components/annotation-container.d.ts +10 -2
  46. package/dist/shared-react/components/annotation-layer.d.ts +9 -3
  47. package/dist/shared-react/components/annotations.d.ts +4 -1
  48. package/dist/shared-react/components/group-selection-box.d.ts +12 -4
  49. package/dist/shared-react/components/render-annotation.d.ts +2 -1
  50. package/dist/shared-react/components/types.d.ts +51 -1
  51. package/dist/svelte/components/AnnotationLayer.svelte.d.ts +8 -2
  52. package/dist/svelte/components/Annotations.svelte.d.ts +7 -1
  53. package/dist/svelte/components/GroupSelectionBox.svelte.d.ts +11 -3
  54. package/dist/svelte/components/RenderAnnotation.svelte.d.ts +1 -0
  55. package/dist/svelte/components/types.d.ts +14 -1
  56. package/dist/svelte/index.cjs +1 -1
  57. package/dist/svelte/index.cjs.map +1 -1
  58. package/dist/svelte/index.js +1166 -330
  59. package/dist/svelte/index.js.map +1 -1
  60. package/dist/svelte/types.d.ts +53 -0
  61. package/dist/vue/components/annotation-container.vue.d.ts +35 -9
  62. package/dist/vue/components/annotation-layer.vue.d.ts +29 -5
  63. package/dist/vue/components/annotations.vue.d.ts +278 -134
  64. package/dist/vue/components/group-selection-box.vue.d.ts +35 -10
  65. package/dist/vue/components/render-annotation.vue.d.ts +2 -0
  66. package/dist/vue/index.cjs +1 -1
  67. package/dist/vue/index.cjs.map +1 -1
  68. package/dist/vue/index.js +945 -161
  69. package/dist/vue/index.js.map +1 -1
  70. package/dist/vue/types.d.ts +52 -0
  71. package/package.json +11 -10
@@ -1,3 +1,4 @@
1
+ import { CSSProperties } from 'vue';
1
2
  import { SelectionMenuPropsBase, SelectionMenuRenderFn } from '@embedpdf/utils/vue';
2
3
  import { TrackedAnnotation } from '../lib';
3
4
  export interface AnnotationSelectionContext {
@@ -28,3 +29,54 @@ export interface VertexHandleUI {
28
29
  /** Default background color for the handle (used by default renderer) */
29
30
  color?: string;
30
31
  }
32
+ export type BorderStyle = 'solid' | 'dashed' | 'dotted';
33
+ /** Border configuration for the rotation handle */
34
+ export interface RotationHandleBorder {
35
+ /** Border color (default: '#007ACC') */
36
+ color?: string;
37
+ /** Border style (default: 'solid') */
38
+ style?: BorderStyle;
39
+ /** Border width in px (default: 1) */
40
+ width?: number;
41
+ }
42
+ /** UI customization for rotation handle (Vue) */
43
+ export interface RotationHandleUI {
44
+ /** Handle size in CSS px (default: 32) */
45
+ size?: number;
46
+ /** Gap in CSS px between the bounding box edge and the rotation handle center (default: 20) */
47
+ margin?: number;
48
+ /** Default background color for the handle (default: 'white') */
49
+ color?: string;
50
+ /** Color for the connector line (default: '#007ACC') */
51
+ connectorColor?: string;
52
+ /** Whether to show the connector line (default: false) */
53
+ showConnector?: boolean;
54
+ /** Color for the icon inside the handle (default: '#007ACC') */
55
+ iconColor?: string;
56
+ /** Border configuration for the handle */
57
+ border?: RotationHandleBorder;
58
+ }
59
+ /** Slot props passed to the `#rotation-handle` scoped slot */
60
+ export interface RotationHandleSlotProps {
61
+ key?: string | number;
62
+ style: CSSProperties;
63
+ backgroundColor: string;
64
+ iconColor: string;
65
+ connectorStyle: CSSProperties;
66
+ showConnector: boolean;
67
+ opacity: number;
68
+ /** Resolved border configuration */
69
+ border: RotationHandleBorder;
70
+ [key: string]: any;
71
+ }
72
+ /** Customize the selection outline (color, style, width, offset) */
73
+ export interface SelectionOutline {
74
+ /** Outline color (default: '#007ACC') */
75
+ color?: string;
76
+ /** Outline style (default: 'solid' for single, 'dashed' for group) */
77
+ style?: BorderStyle;
78
+ /** Outline width in px (default: 1 for single, 2 for group) */
79
+ width?: number;
80
+ /** Outline offset in px (default: 1 for single, 2 for group) */
81
+ offset?: number;
82
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embedpdf/plugin-annotation",
3
- "version": "2.5.0",
3
+ "version": "2.6.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.cjs",
@@ -35,16 +35,17 @@
35
35
  }
36
36
  },
37
37
  "dependencies": {
38
- "@embedpdf/models": "2.5.0",
39
- "@embedpdf/utils": "2.5.0"
38
+ "@embedpdf/models": "2.6.1",
39
+ "@embedpdf/utils": "2.6.1"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/react": "^18.2.0",
43
+ "@types/react-dom": "^18.2.0",
43
44
  "typescript": "^5.0.0",
44
- "@embedpdf/plugin-interaction-manager": "2.5.0",
45
45
  "@embedpdf/build": "1.1.0",
46
- "@embedpdf/plugin-selection": "2.5.0",
47
- "@embedpdf/plugin-history": "2.5.0"
46
+ "@embedpdf/plugin-interaction-manager": "2.6.1",
47
+ "@embedpdf/plugin-selection": "2.6.1",
48
+ "@embedpdf/plugin-history": "2.6.1"
48
49
  },
49
50
  "peerDependencies": {
50
51
  "react": ">=16.8.0",
@@ -52,10 +53,10 @@
52
53
  "preact": "^10.26.4",
53
54
  "vue": ">=3.2.0",
54
55
  "svelte": ">=5 <6",
55
- "@embedpdf/plugin-interaction-manager": "2.5.0",
56
- "@embedpdf/core": "2.5.0",
57
- "@embedpdf/plugin-selection": "2.5.0",
58
- "@embedpdf/plugin-history": "2.5.0"
56
+ "@embedpdf/core": "2.6.1",
57
+ "@embedpdf/plugin-interaction-manager": "2.6.1",
58
+ "@embedpdf/plugin-selection": "2.6.1",
59
+ "@embedpdf/plugin-history": "2.6.1"
59
60
  },
60
61
  "files": [
61
62
  "dist",