@embedpdf/plugin-annotation 2.3.0 → 2.4.0
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 +40 -13
- package/dist/index.js.map +1 -1
- package/dist/lib/actions.d.ts +2 -1
- package/dist/lib/annotation-plugin.d.ts +1 -0
- package/dist/lib/helpers.d.ts +2 -1
- package/dist/lib/tools/types.d.ts +22 -10
- package/dist/lib/types.d.ts +13 -0
- package/dist/preact/index.cjs +1 -1
- package/dist/preact/index.cjs.map +1 -1
- package/dist/preact/index.js +326 -50
- 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 +325 -49
- package/dist/react/index.js.map +1 -1
- package/dist/shared/components/annotation-container.d.ts +6 -2
- package/dist/shared/components/annotation-layer.d.ts +4 -2
- package/dist/shared/components/annotations.d.ts +3 -1
- package/dist/shared/components/types.d.ts +43 -1
- package/dist/shared/context/index.d.ts +1 -0
- package/dist/shared/context/renderer-registry.d.ts +21 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared-preact/components/annotation-container.d.ts +6 -2
- package/dist/shared-preact/components/annotation-layer.d.ts +4 -2
- package/dist/shared-preact/components/annotations.d.ts +3 -1
- package/dist/shared-preact/components/types.d.ts +43 -1
- package/dist/shared-preact/context/index.d.ts +1 -0
- package/dist/shared-preact/context/renderer-registry.d.ts +21 -0
- package/dist/shared-preact/index.d.ts +2 -0
- package/dist/shared-react/components/annotation-container.d.ts +6 -2
- package/dist/shared-react/components/annotation-layer.d.ts +4 -2
- package/dist/shared-react/components/annotations.d.ts +3 -1
- package/dist/shared-react/components/types.d.ts +43 -1
- package/dist/shared-react/context/index.d.ts +1 -0
- package/dist/shared-react/context/renderer-registry.d.ts +21 -0
- package/dist/shared-react/index.d.ts +2 -0
- package/dist/svelte/components/AnnotationLayer.svelte.d.ts +3 -0
- package/dist/svelte/components/Annotations.svelte.d.ts +3 -0
- package/dist/svelte/components/RendererRegistryProvider.svelte.d.ts +7 -0
- package/dist/svelte/components/index.d.ts +1 -0
- package/dist/svelte/context/index.d.ts +2 -0
- package/dist/svelte/context/renderer-registry.svelte.d.ts +20 -0
- package/dist/svelte/context/types.d.ts +33 -0
- package/dist/svelte/index.cjs +1 -1
- package/dist/svelte/index.cjs.map +1 -1
- package/dist/svelte/index.d.ts +2 -0
- package/dist/svelte/index.js +412 -241
- package/dist/svelte/index.js.map +1 -1
- package/dist/vue/components/annotation-container.vue.d.ts +1 -1
- package/dist/vue/components/annotation-layer.vue.d.ts +3 -0
- package/dist/vue/components/annotations/free-text.vue.d.ts +1 -1
- package/dist/vue/components/annotations/stamp.vue.d.ts +1 -1
- package/dist/vue/components/annotations.vue.d.ts +94 -60
- package/dist/vue/components/group-selection-box.vue.d.ts +1 -1
- package/dist/vue/components/index.d.ts +1 -0
- package/dist/vue/components/preview-renderer.vue.d.ts +1 -1
- package/dist/vue/components/renderer-registry-provider.vue.d.ts +13 -0
- package/dist/vue/context/index.d.ts +2 -0
- package/dist/vue/context/renderer-registry.d.ts +26 -0
- package/dist/vue/context/types.d.ts +33 -0
- package/dist/vue/hooks/use-annotation.d.ts +5 -5
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.d.ts +3 -1
- package/dist/vue/index.js +245 -120
- package/dist/vue/index.js.map +1 -1
- package/dist/vue/types.d.ts +1 -1
- package/package.json +10 -10
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PdfAnnotationObject } from '@embedpdf/models';
|
|
2
2
|
import { SelectionMenuPlacement } from '@embedpdf/utils/vue';
|
|
3
|
-
import { TrackedAnnotation } from '../../lib
|
|
3
|
+
import { TrackedAnnotation } from '../../lib';
|
|
4
4
|
import { VertexConfig } from '../../shared-vue/types';
|
|
5
5
|
import { AnnotationSelectionContext, AnnotationSelectionMenuRenderFn } from '../types';
|
|
6
6
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AnnotationSelectionMenuRenderFn, GroupSelectionMenuRenderFn, ResizeHandleUI, VertexHandleUI } from '../types';
|
|
2
|
+
import { BoxedAnnotationRenderer } from '../context';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
/** The ID of the document that this layer displays annotations for */
|
|
4
5
|
documentId: string;
|
|
@@ -15,6 +16,8 @@ type __VLS_Props = {
|
|
|
15
16
|
selectionMenu?: AnnotationSelectionMenuRenderFn;
|
|
16
17
|
/** Customize group selection menu */
|
|
17
18
|
groupSelectionMenu?: GroupSelectionMenuRenderFn;
|
|
19
|
+
/** Custom renderers for specific annotation types (provided by external plugins) */
|
|
20
|
+
annotationRenderers?: BoxedAnnotationRenderer[];
|
|
18
21
|
};
|
|
19
22
|
declare var __VLS_8: {
|
|
20
23
|
context: import('..').AnnotationSelectionContext;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AnnotationSelectionMenuRenderFn, GroupSelectionMenuRenderFn, ResizeHandleUI, VertexHandleUI } from '../types';
|
|
2
|
+
import { BoxedAnnotationRenderer } from '../context';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
documentId: string;
|
|
4
5
|
pageIndex: number;
|
|
@@ -13,6 +14,8 @@ type __VLS_Props = {
|
|
|
13
14
|
selectionMenu?: AnnotationSelectionMenuRenderFn;
|
|
14
15
|
/** Render function for group selection menu (schema-driven approach) */
|
|
15
16
|
groupSelectionMenu?: GroupSelectionMenuRenderFn;
|
|
17
|
+
/** Custom renderers for specific annotation types (provided by external plugins) */
|
|
18
|
+
annotationRenderers?: BoxedAnnotationRenderer[];
|
|
16
19
|
};
|
|
17
20
|
declare var __VLS_14: {
|
|
18
21
|
context: import('..').AnnotationSelectionContext;
|
|
@@ -41,7 +44,26 @@ declare var __VLS_14: {
|
|
|
41
44
|
onPointercancel: (e: PointerEvent) => void;
|
|
42
45
|
key: string | number;
|
|
43
46
|
style: import('vue').CSSProperties;
|
|
44
|
-
},
|
|
47
|
+
}, __VLS_32: {
|
|
48
|
+
context: import('..').AnnotationSelectionContext;
|
|
49
|
+
selected: boolean;
|
|
50
|
+
rect: {
|
|
51
|
+
origin: {
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
};
|
|
55
|
+
size: {
|
|
56
|
+
width: number;
|
|
57
|
+
height: number;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
placement: import('@embedpdf/utils/vue').SelectionMenuPlacement;
|
|
61
|
+
menuWrapperProps: {
|
|
62
|
+
style: import('vue').CSSProperties;
|
|
63
|
+
onPointerdown: (e: PointerEvent) => void;
|
|
64
|
+
onTouchstart: (e: TouchEvent) => void;
|
|
65
|
+
};
|
|
66
|
+
}, __VLS_35: {
|
|
45
67
|
backgroundColor: "#007ACC";
|
|
46
68
|
onPointerdown: (e: PointerEvent) => void;
|
|
47
69
|
onPointermove: (e: PointerEvent) => void;
|
|
@@ -49,7 +71,15 @@ declare var __VLS_14: {
|
|
|
49
71
|
onPointercancel: (e: PointerEvent) => void;
|
|
50
72
|
key: string | number;
|
|
51
73
|
style: import('vue').CSSProperties;
|
|
52
|
-
},
|
|
74
|
+
}, __VLS_38: {
|
|
75
|
+
backgroundColor: "#007ACC";
|
|
76
|
+
onPointerdown: (e: PointerEvent) => void;
|
|
77
|
+
onPointermove: (e: PointerEvent) => void;
|
|
78
|
+
onPointerup: (e: PointerEvent) => void;
|
|
79
|
+
onPointercancel: (e: PointerEvent) => void;
|
|
80
|
+
key: string | number;
|
|
81
|
+
style: import('vue').CSSProperties;
|
|
82
|
+
}, __VLS_53: {
|
|
53
83
|
context: import('..').AnnotationSelectionContext;
|
|
54
84
|
selected: boolean;
|
|
55
85
|
rect: {
|
|
@@ -68,7 +98,7 @@ declare var __VLS_14: {
|
|
|
68
98
|
onPointerdown: (e: PointerEvent) => void;
|
|
69
99
|
onTouchstart: (e: TouchEvent) => void;
|
|
70
100
|
};
|
|
71
|
-
},
|
|
101
|
+
}, __VLS_56: {
|
|
72
102
|
backgroundColor: "#007ACC";
|
|
73
103
|
onPointerdown: (e: PointerEvent) => void;
|
|
74
104
|
onPointermove: (e: PointerEvent) => void;
|
|
@@ -76,7 +106,7 @@ declare var __VLS_14: {
|
|
|
76
106
|
onPointercancel: (e: PointerEvent) => void;
|
|
77
107
|
key: string | number;
|
|
78
108
|
style: import('vue').CSSProperties;
|
|
79
|
-
},
|
|
109
|
+
}, __VLS_59: {
|
|
80
110
|
backgroundColor: "#007ACC";
|
|
81
111
|
onPointerdown: (e: PointerEvent) => void;
|
|
82
112
|
onPointermove: (e: PointerEvent) => void;
|
|
@@ -84,7 +114,7 @@ declare var __VLS_14: {
|
|
|
84
114
|
onPointercancel: (e: PointerEvent) => void;
|
|
85
115
|
key: string | number;
|
|
86
116
|
style: import('vue').CSSProperties;
|
|
87
|
-
},
|
|
117
|
+
}, __VLS_74: {
|
|
88
118
|
context: import('..').AnnotationSelectionContext;
|
|
89
119
|
selected: boolean;
|
|
90
120
|
rect: {
|
|
@@ -103,7 +133,7 @@ declare var __VLS_14: {
|
|
|
103
133
|
onPointerdown: (e: PointerEvent) => void;
|
|
104
134
|
onTouchstart: (e: TouchEvent) => void;
|
|
105
135
|
};
|
|
106
|
-
},
|
|
136
|
+
}, __VLS_77: {
|
|
107
137
|
backgroundColor: "#007ACC";
|
|
108
138
|
onPointerdown: (e: PointerEvent) => void;
|
|
109
139
|
onPointermove: (e: PointerEvent) => void;
|
|
@@ -111,7 +141,7 @@ declare var __VLS_14: {
|
|
|
111
141
|
onPointercancel: (e: PointerEvent) => void;
|
|
112
142
|
key: string | number;
|
|
113
143
|
style: import('vue').CSSProperties;
|
|
114
|
-
},
|
|
144
|
+
}, __VLS_80: {
|
|
115
145
|
backgroundColor: "#007ACC";
|
|
116
146
|
onPointerdown: (e: PointerEvent) => void;
|
|
117
147
|
onPointermove: (e: PointerEvent) => void;
|
|
@@ -119,7 +149,7 @@ declare var __VLS_14: {
|
|
|
119
149
|
onPointercancel: (e: PointerEvent) => void;
|
|
120
150
|
key: string | number;
|
|
121
151
|
style: import('vue').CSSProperties;
|
|
122
|
-
},
|
|
152
|
+
}, __VLS_95: {
|
|
123
153
|
context: import('..').AnnotationSelectionContext;
|
|
124
154
|
selected: boolean;
|
|
125
155
|
rect: {
|
|
@@ -138,7 +168,7 @@ declare var __VLS_14: {
|
|
|
138
168
|
onPointerdown: (e: PointerEvent) => void;
|
|
139
169
|
onTouchstart: (e: TouchEvent) => void;
|
|
140
170
|
};
|
|
141
|
-
},
|
|
171
|
+
}, __VLS_98: {
|
|
142
172
|
backgroundColor: "#007ACC";
|
|
143
173
|
onPointerdown: (e: PointerEvent) => void;
|
|
144
174
|
onPointermove: (e: PointerEvent) => void;
|
|
@@ -146,7 +176,7 @@ declare var __VLS_14: {
|
|
|
146
176
|
onPointercancel: (e: PointerEvent) => void;
|
|
147
177
|
key: string | number;
|
|
148
178
|
style: import('vue').CSSProperties;
|
|
149
|
-
},
|
|
179
|
+
}, __VLS_101: {
|
|
150
180
|
backgroundColor: "#007ACC";
|
|
151
181
|
onPointerdown: (e: PointerEvent) => void;
|
|
152
182
|
onPointermove: (e: PointerEvent) => void;
|
|
@@ -154,7 +184,7 @@ declare var __VLS_14: {
|
|
|
154
184
|
onPointercancel: (e: PointerEvent) => void;
|
|
155
185
|
key: string | number;
|
|
156
186
|
style: import('vue').CSSProperties;
|
|
157
|
-
},
|
|
187
|
+
}, __VLS_116: {
|
|
158
188
|
context: import('..').AnnotationSelectionContext;
|
|
159
189
|
selected: boolean;
|
|
160
190
|
rect: {
|
|
@@ -173,7 +203,7 @@ declare var __VLS_14: {
|
|
|
173
203
|
onPointerdown: (e: PointerEvent) => void;
|
|
174
204
|
onTouchstart: (e: TouchEvent) => void;
|
|
175
205
|
};
|
|
176
|
-
},
|
|
206
|
+
}, __VLS_119: {
|
|
177
207
|
backgroundColor: "#007ACC";
|
|
178
208
|
onPointerdown: (e: PointerEvent) => void;
|
|
179
209
|
onPointermove: (e: PointerEvent) => void;
|
|
@@ -181,7 +211,7 @@ declare var __VLS_14: {
|
|
|
181
211
|
onPointercancel: (e: PointerEvent) => void;
|
|
182
212
|
key: string | number;
|
|
183
213
|
style: import('vue').CSSProperties;
|
|
184
|
-
},
|
|
214
|
+
}, __VLS_122: {
|
|
185
215
|
backgroundColor: "#007ACC";
|
|
186
216
|
onPointerdown: (e: PointerEvent) => void;
|
|
187
217
|
onPointermove: (e: PointerEvent) => void;
|
|
@@ -189,7 +219,7 @@ declare var __VLS_14: {
|
|
|
189
219
|
onPointercancel: (e: PointerEvent) => void;
|
|
190
220
|
key: string | number;
|
|
191
221
|
style: import('vue').CSSProperties;
|
|
192
|
-
},
|
|
222
|
+
}, __VLS_137: {
|
|
193
223
|
context: import('..').AnnotationSelectionContext;
|
|
194
224
|
selected: boolean;
|
|
195
225
|
rect: {
|
|
@@ -208,7 +238,7 @@ declare var __VLS_14: {
|
|
|
208
238
|
onPointerdown: (e: PointerEvent) => void;
|
|
209
239
|
onTouchstart: (e: TouchEvent) => void;
|
|
210
240
|
};
|
|
211
|
-
},
|
|
241
|
+
}, __VLS_140: {
|
|
212
242
|
backgroundColor: "#007ACC";
|
|
213
243
|
onPointerdown: (e: PointerEvent) => void;
|
|
214
244
|
onPointermove: (e: PointerEvent) => void;
|
|
@@ -216,7 +246,7 @@ declare var __VLS_14: {
|
|
|
216
246
|
onPointercancel: (e: PointerEvent) => void;
|
|
217
247
|
key: string | number;
|
|
218
248
|
style: import('vue').CSSProperties;
|
|
219
|
-
},
|
|
249
|
+
}, __VLS_143: {
|
|
220
250
|
backgroundColor: "#007ACC";
|
|
221
251
|
onPointerdown: (e: PointerEvent) => void;
|
|
222
252
|
onPointermove: (e: PointerEvent) => void;
|
|
@@ -224,7 +254,7 @@ declare var __VLS_14: {
|
|
|
224
254
|
onPointercancel: (e: PointerEvent) => void;
|
|
225
255
|
key: string | number;
|
|
226
256
|
style: import('vue').CSSProperties;
|
|
227
|
-
},
|
|
257
|
+
}, __VLS_158: {
|
|
228
258
|
context: import('..').AnnotationSelectionContext;
|
|
229
259
|
selected: boolean;
|
|
230
260
|
rect: {
|
|
@@ -243,7 +273,7 @@ declare var __VLS_14: {
|
|
|
243
273
|
onPointerdown: (e: PointerEvent) => void;
|
|
244
274
|
onTouchstart: (e: TouchEvent) => void;
|
|
245
275
|
};
|
|
246
|
-
},
|
|
276
|
+
}, __VLS_161: {
|
|
247
277
|
backgroundColor: "#007ACC";
|
|
248
278
|
onPointerdown: (e: PointerEvent) => void;
|
|
249
279
|
onPointermove: (e: PointerEvent) => void;
|
|
@@ -251,7 +281,7 @@ declare var __VLS_14: {
|
|
|
251
281
|
onPointercancel: (e: PointerEvent) => void;
|
|
252
282
|
key: string | number;
|
|
253
283
|
style: import('vue').CSSProperties;
|
|
254
|
-
},
|
|
284
|
+
}, __VLS_164: {
|
|
255
285
|
backgroundColor: "#007ACC";
|
|
256
286
|
onPointerdown: (e: PointerEvent) => void;
|
|
257
287
|
onPointermove: (e: PointerEvent) => void;
|
|
@@ -259,7 +289,7 @@ declare var __VLS_14: {
|
|
|
259
289
|
onPointercancel: (e: PointerEvent) => void;
|
|
260
290
|
key: string | number;
|
|
261
291
|
style: import('vue').CSSProperties;
|
|
262
|
-
},
|
|
292
|
+
}, __VLS_179: {
|
|
263
293
|
context: import('..').AnnotationSelectionContext;
|
|
264
294
|
selected: boolean;
|
|
265
295
|
rect: {
|
|
@@ -278,7 +308,7 @@ declare var __VLS_14: {
|
|
|
278
308
|
onPointerdown: (e: PointerEvent) => void;
|
|
279
309
|
onTouchstart: (e: TouchEvent) => void;
|
|
280
310
|
};
|
|
281
|
-
},
|
|
311
|
+
}, __VLS_182: {
|
|
282
312
|
backgroundColor: "#007ACC";
|
|
283
313
|
onPointerdown: (e: PointerEvent) => void;
|
|
284
314
|
onPointermove: (e: PointerEvent) => void;
|
|
@@ -286,7 +316,7 @@ declare var __VLS_14: {
|
|
|
286
316
|
onPointercancel: (e: PointerEvent) => void;
|
|
287
317
|
key: string | number;
|
|
288
318
|
style: import('vue').CSSProperties;
|
|
289
|
-
},
|
|
319
|
+
}, __VLS_185: {
|
|
290
320
|
backgroundColor: "#007ACC";
|
|
291
321
|
onPointerdown: (e: PointerEvent) => void;
|
|
292
322
|
onPointermove: (e: PointerEvent) => void;
|
|
@@ -294,7 +324,7 @@ declare var __VLS_14: {
|
|
|
294
324
|
onPointercancel: (e: PointerEvent) => void;
|
|
295
325
|
key: string | number;
|
|
296
326
|
style: import('vue').CSSProperties;
|
|
297
|
-
},
|
|
327
|
+
}, __VLS_200: {
|
|
298
328
|
context: import('..').AnnotationSelectionContext;
|
|
299
329
|
selected: boolean;
|
|
300
330
|
rect: {
|
|
@@ -313,7 +343,7 @@ declare var __VLS_14: {
|
|
|
313
343
|
onPointerdown: (e: PointerEvent) => void;
|
|
314
344
|
onTouchstart: (e: TouchEvent) => void;
|
|
315
345
|
};
|
|
316
|
-
},
|
|
346
|
+
}, __VLS_215: {
|
|
317
347
|
context: import('..').AnnotationSelectionContext;
|
|
318
348
|
selected: boolean;
|
|
319
349
|
rect: {
|
|
@@ -332,7 +362,7 @@ declare var __VLS_14: {
|
|
|
332
362
|
onPointerdown: (e: PointerEvent) => void;
|
|
333
363
|
onTouchstart: (e: TouchEvent) => void;
|
|
334
364
|
};
|
|
335
|
-
},
|
|
365
|
+
}, __VLS_230: {
|
|
336
366
|
context: import('..').AnnotationSelectionContext;
|
|
337
367
|
selected: boolean;
|
|
338
368
|
rect: {
|
|
@@ -351,7 +381,7 @@ declare var __VLS_14: {
|
|
|
351
381
|
onPointerdown: (e: PointerEvent) => void;
|
|
352
382
|
onTouchstart: (e: TouchEvent) => void;
|
|
353
383
|
};
|
|
354
|
-
},
|
|
384
|
+
}, __VLS_245: {
|
|
355
385
|
context: import('..').AnnotationSelectionContext;
|
|
356
386
|
selected: boolean;
|
|
357
387
|
rect: {
|
|
@@ -370,7 +400,7 @@ declare var __VLS_14: {
|
|
|
370
400
|
onPointerdown: (e: PointerEvent) => void;
|
|
371
401
|
onTouchstart: (e: TouchEvent) => void;
|
|
372
402
|
};
|
|
373
|
-
},
|
|
403
|
+
}, __VLS_260: {
|
|
374
404
|
context: import('..').AnnotationSelectionContext;
|
|
375
405
|
selected: boolean;
|
|
376
406
|
rect: {
|
|
@@ -389,7 +419,7 @@ declare var __VLS_14: {
|
|
|
389
419
|
onPointerdown: (e: PointerEvent) => void;
|
|
390
420
|
onTouchstart: (e: TouchEvent) => void;
|
|
391
421
|
};
|
|
392
|
-
},
|
|
422
|
+
}, __VLS_263: {
|
|
393
423
|
backgroundColor: "#007ACC";
|
|
394
424
|
onPointerdown: (e: PointerEvent) => void;
|
|
395
425
|
onPointermove: (e: PointerEvent) => void;
|
|
@@ -397,7 +427,7 @@ declare var __VLS_14: {
|
|
|
397
427
|
onPointercancel: (e: PointerEvent) => void;
|
|
398
428
|
key: string | number;
|
|
399
429
|
style: import('vue').CSSProperties;
|
|
400
|
-
},
|
|
430
|
+
}, __VLS_272: {
|
|
401
431
|
context: import('..').GroupSelectionContext;
|
|
402
432
|
selected: boolean;
|
|
403
433
|
rect: {
|
|
@@ -416,7 +446,7 @@ declare var __VLS_14: {
|
|
|
416
446
|
onPointerdown: (e: PointerEvent) => void;
|
|
417
447
|
onTouchstart: (e: TouchEvent) => void;
|
|
418
448
|
};
|
|
419
|
-
},
|
|
449
|
+
}, __VLS_275: {
|
|
420
450
|
backgroundColor: string;
|
|
421
451
|
onPointerdown: (e: PointerEvent) => void;
|
|
422
452
|
onPointermove: (e: PointerEvent) => void;
|
|
@@ -430,65 +460,69 @@ type __VLS_Slots = {} & {
|
|
|
430
460
|
} & {
|
|
431
461
|
'resize-handle'?: (props: typeof __VLS_17) => any;
|
|
432
462
|
} & {
|
|
433
|
-
'
|
|
463
|
+
'selection-menu'?: (props: typeof __VLS_32) => any;
|
|
464
|
+
} & {
|
|
465
|
+
'resize-handle'?: (props: typeof __VLS_35) => any;
|
|
466
|
+
} & {
|
|
467
|
+
'vertex-handle'?: (props: typeof __VLS_38) => any;
|
|
434
468
|
} & {
|
|
435
|
-
'selection-menu'?: (props: typeof
|
|
469
|
+
'selection-menu'?: (props: typeof __VLS_53) => any;
|
|
436
470
|
} & {
|
|
437
|
-
'resize-handle'?: (props: typeof
|
|
471
|
+
'resize-handle'?: (props: typeof __VLS_56) => any;
|
|
438
472
|
} & {
|
|
439
|
-
'vertex-handle'?: (props: typeof
|
|
473
|
+
'vertex-handle'?: (props: typeof __VLS_59) => any;
|
|
440
474
|
} & {
|
|
441
|
-
'selection-menu'?: (props: typeof
|
|
475
|
+
'selection-menu'?: (props: typeof __VLS_74) => any;
|
|
442
476
|
} & {
|
|
443
|
-
'resize-handle'?: (props: typeof
|
|
477
|
+
'resize-handle'?: (props: typeof __VLS_77) => any;
|
|
444
478
|
} & {
|
|
445
|
-
'vertex-handle'?: (props: typeof
|
|
479
|
+
'vertex-handle'?: (props: typeof __VLS_80) => any;
|
|
446
480
|
} & {
|
|
447
|
-
'selection-menu'?: (props: typeof
|
|
481
|
+
'selection-menu'?: (props: typeof __VLS_95) => any;
|
|
448
482
|
} & {
|
|
449
|
-
'resize-handle'?: (props: typeof
|
|
483
|
+
'resize-handle'?: (props: typeof __VLS_98) => any;
|
|
450
484
|
} & {
|
|
451
|
-
'vertex-handle'?: (props: typeof
|
|
485
|
+
'vertex-handle'?: (props: typeof __VLS_101) => any;
|
|
452
486
|
} & {
|
|
453
|
-
'selection-menu'?: (props: typeof
|
|
487
|
+
'selection-menu'?: (props: typeof __VLS_116) => any;
|
|
454
488
|
} & {
|
|
455
|
-
'resize-handle'?: (props: typeof
|
|
489
|
+
'resize-handle'?: (props: typeof __VLS_119) => any;
|
|
456
490
|
} & {
|
|
457
|
-
'vertex-handle'?: (props: typeof
|
|
491
|
+
'vertex-handle'?: (props: typeof __VLS_122) => any;
|
|
458
492
|
} & {
|
|
459
|
-
'selection-menu'?: (props: typeof
|
|
493
|
+
'selection-menu'?: (props: typeof __VLS_137) => any;
|
|
460
494
|
} & {
|
|
461
|
-
'resize-handle'?: (props: typeof
|
|
495
|
+
'resize-handle'?: (props: typeof __VLS_140) => any;
|
|
462
496
|
} & {
|
|
463
|
-
'vertex-handle'?: (props: typeof
|
|
497
|
+
'vertex-handle'?: (props: typeof __VLS_143) => any;
|
|
464
498
|
} & {
|
|
465
|
-
'selection-menu'?: (props: typeof
|
|
499
|
+
'selection-menu'?: (props: typeof __VLS_158) => any;
|
|
466
500
|
} & {
|
|
467
|
-
'resize-handle'?: (props: typeof
|
|
501
|
+
'resize-handle'?: (props: typeof __VLS_161) => any;
|
|
468
502
|
} & {
|
|
469
|
-
'vertex-handle'?: (props: typeof
|
|
503
|
+
'vertex-handle'?: (props: typeof __VLS_164) => any;
|
|
470
504
|
} & {
|
|
471
|
-
'selection-menu'?: (props: typeof
|
|
505
|
+
'selection-menu'?: (props: typeof __VLS_179) => any;
|
|
472
506
|
} & {
|
|
473
|
-
'resize-handle'?: (props: typeof
|
|
507
|
+
'resize-handle'?: (props: typeof __VLS_182) => any;
|
|
474
508
|
} & {
|
|
475
|
-
'vertex-handle'?: (props: typeof
|
|
509
|
+
'vertex-handle'?: (props: typeof __VLS_185) => any;
|
|
476
510
|
} & {
|
|
477
|
-
'selection-menu'?: (props: typeof
|
|
511
|
+
'selection-menu'?: (props: typeof __VLS_200) => any;
|
|
478
512
|
} & {
|
|
479
|
-
'selection-menu'?: (props: typeof
|
|
513
|
+
'selection-menu'?: (props: typeof __VLS_215) => any;
|
|
480
514
|
} & {
|
|
481
|
-
'selection-menu'?: (props: typeof
|
|
515
|
+
'selection-menu'?: (props: typeof __VLS_230) => any;
|
|
482
516
|
} & {
|
|
483
|
-
'selection-menu'?: (props: typeof
|
|
517
|
+
'selection-menu'?: (props: typeof __VLS_245) => any;
|
|
484
518
|
} & {
|
|
485
|
-
'selection-menu'?: (props: typeof
|
|
519
|
+
'selection-menu'?: (props: typeof __VLS_260) => any;
|
|
486
520
|
} & {
|
|
487
|
-
'resize-handle'?: (props: typeof
|
|
521
|
+
'resize-handle'?: (props: typeof __VLS_263) => any;
|
|
488
522
|
} & {
|
|
489
|
-
'group-selection-menu'?: (props: typeof
|
|
523
|
+
'group-selection-menu'?: (props: typeof __VLS_272) => any;
|
|
490
524
|
} & {
|
|
491
|
-
'resize-handle'?: (props: typeof
|
|
525
|
+
'resize-handle'?: (props: typeof __VLS_275) => any;
|
|
492
526
|
};
|
|
493
527
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
494
528
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SelectionMenuPlacement } from '@embedpdf/utils/vue';
|
|
2
|
-
import { TrackedAnnotation } from '../../lib
|
|
2
|
+
import { TrackedAnnotation } from '../../lib';
|
|
3
3
|
import { GroupSelectionContext, GroupSelectionMenuRenderFn, ResizeHandleUI } from '../types';
|
|
4
4
|
type __VLS_Props = {
|
|
5
5
|
documentId: string;
|
|
@@ -6,5 +6,6 @@ export { default as GroupSelectionBox } from './group-selection-box.vue';
|
|
|
6
6
|
export { default as PreviewRenderer } from './preview-renderer.vue';
|
|
7
7
|
export { default as RenderAnnotation } from './render-annotation.vue';
|
|
8
8
|
export { default as TextMarkup } from './text-markup.vue';
|
|
9
|
+
export { default as RendererRegistryProvider } from './renderer-registry-provider.vue';
|
|
9
10
|
export * from './annotations';
|
|
10
11
|
export * from './text-markup';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BoxedAnnotationRenderer, AnnotationRendererEntry, AnnotationRendererProps } from './types';
|
|
2
|
+
import { PdfAnnotationObject } from '@embedpdf/models';
|
|
3
|
+
/**
|
|
4
|
+
* Annotation Renderer Registry
|
|
5
|
+
*
|
|
6
|
+
* Allows external plugins to register custom annotation renderers
|
|
7
|
+
* that integrate with the annotation layer.
|
|
8
|
+
*/
|
|
9
|
+
export interface AnnotationRendererRegistry {
|
|
10
|
+
register(entries: BoxedAnnotationRenderer[]): () => void;
|
|
11
|
+
getAll(): BoxedAnnotationRenderer[];
|
|
12
|
+
}
|
|
13
|
+
export declare function createRendererRegistry(): AnnotationRendererRegistry;
|
|
14
|
+
export declare function provideRendererRegistry(): AnnotationRendererRegistry;
|
|
15
|
+
export declare function useRendererRegistry(): AnnotationRendererRegistry | null;
|
|
16
|
+
/**
|
|
17
|
+
* Composable for plugins to register renderers.
|
|
18
|
+
* Automatically cleans up on unmount.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useRegisterRenderers(entries: BoxedAnnotationRenderer[]): void;
|
|
21
|
+
/**
|
|
22
|
+
* Factory to create a boxed renderer from a typed entry.
|
|
23
|
+
* Wraps component in markRaw to prevent reactivity overhead.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createRenderer<T extends PdfAnnotationObject>(entry: AnnotationRendererEntry<T>): BoxedAnnotationRenderer;
|
|
26
|
+
export type { AnnotationRendererProps, AnnotationRendererEntry, BoxedAnnotationRenderer };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { PdfAnnotationObject } from '@embedpdf/models';
|
|
3
|
+
import { TrackedAnnotation } from '../../lib';
|
|
4
|
+
/**
|
|
5
|
+
* Props passed to custom annotation renderer components
|
|
6
|
+
*/
|
|
7
|
+
export interface AnnotationRendererProps<T extends PdfAnnotationObject = PdfAnnotationObject> {
|
|
8
|
+
annotation: TrackedAnnotation<T>;
|
|
9
|
+
isSelected: boolean;
|
|
10
|
+
scale: number;
|
|
11
|
+
pageIndex: number;
|
|
12
|
+
onClick: (e: PointerEvent | TouchEvent) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Entry for defining a custom annotation renderer.
|
|
16
|
+
* Type safety enforced at definition time via generic.
|
|
17
|
+
*/
|
|
18
|
+
export interface AnnotationRendererEntry<T extends PdfAnnotationObject = PdfAnnotationObject> {
|
|
19
|
+
/** Unique identifier for this renderer */
|
|
20
|
+
id: string;
|
|
21
|
+
/** Returns true if this renderer handles the annotation */
|
|
22
|
+
matches: (annotation: PdfAnnotationObject) => annotation is T;
|
|
23
|
+
/** Vue component to render the annotation */
|
|
24
|
+
component: Component<AnnotationRendererProps<T>>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Boxed renderer stored in registry (generic erased for storage)
|
|
28
|
+
*/
|
|
29
|
+
export interface BoxedAnnotationRenderer {
|
|
30
|
+
id: string;
|
|
31
|
+
matches: (annotation: PdfAnnotationObject) => boolean;
|
|
32
|
+
component: Component<AnnotationRendererProps>;
|
|
33
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MaybeRefOrGetter } from 'vue';
|
|
2
|
-
import { AnnotationPlugin, AnnotationDocumentState } from '../../lib
|
|
2
|
+
import { AnnotationPlugin, AnnotationDocumentState } from '../../lib';
|
|
3
3
|
export declare const useAnnotationPlugin: () => import('@embedpdf/core/vue').PluginState<AnnotationPlugin>;
|
|
4
|
-
export declare const useAnnotationCapability: () => import('@embedpdf/core/vue').CapabilityState<Readonly<import('../../lib
|
|
4
|
+
export declare const useAnnotationCapability: () => import('@embedpdf/core/vue').CapabilityState<Readonly<import('../../lib').AnnotationCapability>>;
|
|
5
5
|
/**
|
|
6
6
|
* Hook for annotation state for a specific document
|
|
7
7
|
* @param documentId Document ID (can be ref, computed, getter, or plain value)
|
|
@@ -9,18 +9,18 @@ export declare const useAnnotationCapability: () => import('@embedpdf/core/vue')
|
|
|
9
9
|
export declare const useAnnotation: (documentId: MaybeRefOrGetter<string>) => {
|
|
10
10
|
state: import('vue').Ref<{
|
|
11
11
|
pages: Record<number, string[]>;
|
|
12
|
-
byUid: Record<string, import('../../lib
|
|
12
|
+
byUid: Record<string, import('../../lib').TrackedAnnotation>;
|
|
13
13
|
selectedUids: string[];
|
|
14
14
|
selectedUid: string | null;
|
|
15
15
|
activeToolId: string | null;
|
|
16
16
|
hasPendingChanges: boolean;
|
|
17
17
|
}, AnnotationDocumentState | {
|
|
18
18
|
pages: Record<number, string[]>;
|
|
19
|
-
byUid: Record<string, import('../../lib
|
|
19
|
+
byUid: Record<string, import('../../lib').TrackedAnnotation>;
|
|
20
20
|
selectedUids: string[];
|
|
21
21
|
selectedUid: string | null;
|
|
22
22
|
activeToolId: string | null;
|
|
23
23
|
hasPendingChanges: boolean;
|
|
24
24
|
}>;
|
|
25
|
-
provides: import('vue').ComputedRef<import('../../lib
|
|
25
|
+
provides: import('vue').ComputedRef<import('../../lib').AnnotationScope | null>;
|
|
26
26
|
};
|