@embedpdf/plugin-annotation 1.5.0 → 2.0.0-next.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 (106) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +1760 -1444
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/actions.d.ts +58 -19
  6. package/dist/lib/annotation-plugin.d.ts +14 -5
  7. package/dist/lib/index.d.ts +1 -1
  8. package/dist/lib/reducer.d.ts +2 -1
  9. package/dist/lib/selectors.d.ts +10 -8
  10. package/dist/lib/types.d.ts +53 -10
  11. package/dist/preact/index.cjs +1 -1
  12. package/dist/preact/index.cjs.map +1 -1
  13. package/dist/preact/index.js +96 -48
  14. package/dist/preact/index.js.map +1 -1
  15. package/dist/react/index.cjs +1 -1
  16. package/dist/react/index.cjs.map +1 -1
  17. package/dist/react/index.js +96 -48
  18. package/dist/react/index.js.map +1 -1
  19. package/dist/shared/components/annotation-container.d.ts +4 -3
  20. package/dist/shared/components/annotation-layer.d.ts +7 -7
  21. package/dist/shared/components/annotation-paint-layer.d.ts +2 -1
  22. package/dist/shared/components/annotations/stamp.d.ts +2 -1
  23. package/dist/shared/components/annotations.d.ts +3 -2
  24. package/dist/shared/components/render-annotation.d.ts +2 -1
  25. package/dist/shared/components/text-markup.d.ts +2 -1
  26. package/dist/shared/components/types.d.ts +7 -7
  27. package/dist/shared/hooks/use-annotation.d.ts +8 -4
  28. package/dist/shared/index.d.ts +1 -0
  29. package/dist/shared-preact/components/annotation-container.d.ts +4 -3
  30. package/dist/shared-preact/components/annotation-layer.d.ts +7 -7
  31. package/dist/shared-preact/components/annotation-paint-layer.d.ts +2 -1
  32. package/dist/shared-preact/components/annotations/stamp.d.ts +2 -1
  33. package/dist/shared-preact/components/annotations.d.ts +3 -2
  34. package/dist/shared-preact/components/render-annotation.d.ts +2 -1
  35. package/dist/shared-preact/components/text-markup.d.ts +2 -1
  36. package/dist/shared-preact/components/types.d.ts +7 -7
  37. package/dist/shared-preact/hooks/use-annotation.d.ts +8 -4
  38. package/dist/shared-preact/index.d.ts +1 -0
  39. package/dist/shared-react/components/annotation-container.d.ts +4 -3
  40. package/dist/shared-react/components/annotation-layer.d.ts +7 -7
  41. package/dist/shared-react/components/annotation-paint-layer.d.ts +2 -1
  42. package/dist/shared-react/components/annotations/stamp.d.ts +2 -1
  43. package/dist/shared-react/components/annotations.d.ts +3 -2
  44. package/dist/shared-react/components/render-annotation.d.ts +2 -1
  45. package/dist/shared-react/components/text-markup.d.ts +2 -1
  46. package/dist/shared-react/components/types.d.ts +7 -7
  47. package/dist/shared-react/hooks/use-annotation.d.ts +8 -4
  48. package/dist/shared-react/index.d.ts +1 -0
  49. package/dist/svelte/components/AnnotationContainer.svelte.d.ts +26 -0
  50. package/dist/svelte/components/AnnotationLayer.svelte.d.ts +27 -0
  51. package/dist/svelte/components/AnnotationPaintLayer.svelte.d.ts +8 -0
  52. package/dist/svelte/components/Annotations.svelte.d.ts +22 -0
  53. package/dist/svelte/components/PreviewRenderer.svelte.d.ts +8 -0
  54. package/dist/svelte/components/RenderAnnotation.svelte.d.ts +13 -0
  55. package/dist/svelte/components/TextMarkup.svelte.d.ts +8 -0
  56. package/dist/svelte/components/annotations/Circle.svelte.d.ts +26 -0
  57. package/dist/svelte/components/annotations/FreeText.svelte.d.ts +15 -0
  58. package/dist/svelte/components/annotations/Ink.svelte.d.ts +14 -0
  59. package/dist/svelte/components/annotations/Line.svelte.d.ts +18 -0
  60. package/dist/svelte/components/annotations/Polygon.svelte.d.ts +19 -0
  61. package/dist/svelte/components/annotations/Polyline.svelte.d.ts +17 -0
  62. package/dist/svelte/components/annotations/Square.svelte.d.ts +16 -0
  63. package/dist/svelte/components/annotations/Stamp.svelte.d.ts +13 -0
  64. package/dist/svelte/components/annotations/index.d.ts +8 -0
  65. package/dist/svelte/components/index.d.ts +9 -0
  66. package/dist/svelte/components/text-markup/Highlight.svelte.d.ts +13 -0
  67. package/dist/svelte/components/text-markup/Squiggly.svelte.d.ts +13 -0
  68. package/dist/svelte/components/text-markup/Strikeout.svelte.d.ts +13 -0
  69. package/dist/svelte/components/text-markup/Underline.svelte.d.ts +13 -0
  70. package/dist/svelte/components/text-markup/index.d.ts +4 -0
  71. package/dist/svelte/components/types.d.ts +32 -0
  72. package/dist/svelte/hooks/index.d.ts +1 -0
  73. package/dist/svelte/hooks/use-annotation.svelte.d.ts +21 -0
  74. package/dist/svelte/index.cjs +2 -0
  75. package/dist/svelte/index.cjs.map +1 -0
  76. package/dist/svelte/index.d.ts +4 -0
  77. package/dist/svelte/index.js +3083 -0
  78. package/dist/svelte/index.js.map +1 -0
  79. package/dist/svelte/types.d.ts +54 -0
  80. package/dist/vue/components/annotation-container.vue.d.ts +10 -5
  81. package/dist/vue/components/annotation-layer.vue.d.ts +13 -7
  82. package/dist/vue/components/annotation-paint-layer.vue.d.ts +3 -1
  83. package/dist/vue/components/annotations/circle.vue.d.ts +2 -1
  84. package/dist/vue/components/annotations/free-text.vue.d.ts +2 -1
  85. package/dist/vue/components/annotations/ink.vue.d.ts +2 -1
  86. package/dist/vue/components/annotations/line.vue.d.ts +2 -1
  87. package/dist/vue/components/annotations/polygon.vue.d.ts +2 -1
  88. package/dist/vue/components/annotations/polyline.vue.d.ts +2 -1
  89. package/dist/vue/components/annotations/square.vue.d.ts +2 -1
  90. package/dist/vue/components/annotations/stamp.vue.d.ts +3 -1
  91. package/dist/vue/components/annotations.vue.d.ts +7 -3
  92. package/dist/vue/components/preview-renderer.vue.d.ts +2 -1
  93. package/dist/vue/components/render-annotation.vue.d.ts +3 -1
  94. package/dist/vue/components/text-markup/highlight.vue.d.ts +2 -1
  95. package/dist/vue/components/text-markup/squiggly.vue.d.ts +2 -1
  96. package/dist/vue/components/text-markup/strikeout.vue.d.ts +2 -1
  97. package/dist/vue/components/text-markup/underline.vue.d.ts +2 -1
  98. package/dist/vue/components/text-markup.vue.d.ts +3 -1
  99. package/dist/vue/hooks/use-annotation.d.ts +21 -2682
  100. package/dist/vue/index.cjs +1 -1
  101. package/dist/vue/index.cjs.map +1 -1
  102. package/dist/vue/index.d.ts +1 -0
  103. package/dist/vue/index.js +354 -250
  104. package/dist/vue/index.js.map +1 -1
  105. package/dist/vue/types.d.ts +23 -0
  106. package/package.json +19 -11
@@ -0,0 +1,23 @@
1
+ import { SelectionMenuPropsBase, SelectionMenuRenderFn } from '@embedpdf/utils/vue';
2
+ import { TrackedAnnotation } from '../lib/index.ts';
3
+ export interface AnnotationSelectionContext {
4
+ type: 'annotation';
5
+ annotation: TrackedAnnotation;
6
+ pageIndex: number;
7
+ }
8
+ export type AnnotationSelectionMenuProps = SelectionMenuPropsBase<AnnotationSelectionContext>;
9
+ export type AnnotationSelectionMenuRenderFn = SelectionMenuRenderFn<AnnotationSelectionContext>;
10
+ /** UI customization for resize handles (Vue) */
11
+ export interface ResizeHandleUI {
12
+ /** Handle size in CSS px (default: 12) */
13
+ size?: number;
14
+ /** Default background color for the handle (used by default renderer) */
15
+ color?: string;
16
+ }
17
+ /** UI customization for vertex handles (Vue) */
18
+ export interface VertexHandleUI {
19
+ /** Handle size in CSS px (default: 12) */
20
+ size?: number;
21
+ /** Default background color for the handle (used by default renderer) */
22
+ color?: string;
23
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embedpdf/plugin-annotation",
3
- "version": "1.5.0",
3
+ "version": "2.0.0-next.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.cjs",
@@ -26,29 +26,36 @@
26
26
  "types": "./dist/vue/index.d.ts",
27
27
  "import": "./dist/vue/index.js",
28
28
  "require": "./dist/vue/index.cjs"
29
+ },
30
+ "./svelte": {
31
+ "types": "./dist/svelte/index.d.ts",
32
+ "svelte": "./dist/svelte/index.js",
33
+ "import": "./dist/svelte/index.js",
34
+ "require": "./dist/svelte/index.cjs"
29
35
  }
30
36
  },
31
37
  "dependencies": {
32
- "@embedpdf/models": "1.5.0",
33
- "@embedpdf/utils": "1.5.0"
38
+ "@embedpdf/models": "2.0.0-next.1",
39
+ "@embedpdf/utils": "2.0.0-next.1"
34
40
  },
35
41
  "devDependencies": {
36
42
  "@types/react": "^18.2.0",
37
43
  "typescript": "^5.0.0",
38
44
  "@embedpdf/build": "1.1.0",
39
- "@embedpdf/plugin-interaction-manager": "1.5.0",
40
- "@embedpdf/plugin-selection": "1.5.0",
41
- "@embedpdf/plugin-history": "1.5.0"
45
+ "@embedpdf/plugin-selection": "2.0.0-next.1",
46
+ "@embedpdf/plugin-interaction-manager": "2.0.0-next.1",
47
+ "@embedpdf/plugin-history": "2.0.0-next.1"
42
48
  },
43
49
  "peerDependencies": {
44
50
  "react": ">=16.8.0",
45
51
  "react-dom": ">=16.8.0",
46
52
  "preact": "^10.26.4",
47
53
  "vue": ">=3.2.0",
48
- "@embedpdf/core": "1.5.0",
49
- "@embedpdf/plugin-interaction-manager": "1.5.0",
50
- "@embedpdf/plugin-selection": "1.5.0",
51
- "@embedpdf/plugin-history": "1.5.0"
54
+ "svelte": ">=5 <6",
55
+ "@embedpdf/core": "2.0.0-next.1",
56
+ "@embedpdf/plugin-interaction-manager": "2.0.0-next.1",
57
+ "@embedpdf/plugin-selection": "2.0.0-next.1",
58
+ "@embedpdf/plugin-history": "2.0.0-next.1"
52
59
  },
53
60
  "files": [
54
61
  "dist",
@@ -71,7 +78,8 @@
71
78
  "build:react": "vite build --mode react",
72
79
  "build:preact": "vite build --mode preact",
73
80
  "build:vue": "vite build --mode vue",
74
- "build": "pnpm run clean && concurrently -c auto -n base,react,preact,vue \"vite build --mode base\" \"vite build --mode react\" \"vite build --mode preact\" \"vite build --mode vue\"",
81
+ "build:svelte": "vite build --mode svelte",
82
+ "build": "pnpm run clean && concurrently -c auto -n base,react,preact,vue,svelte \"vite build --mode base\" \"vite build --mode react\" \"vite build --mode preact\" \"vite build --mode vue\" \"vite build --mode svelte\"",
75
83
  "clean": "rimraf dist",
76
84
  "lint": "eslint src --color",
77
85
  "lint:fix": "eslint src --color --fix"