@inkbar/svelte 0.2.0 → 0.3.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/README.md CHANGED
@@ -30,7 +30,7 @@ Annotations are plain typed objects. Bind them with `bind:annotations` to keep t
30
30
  pnpm add @inkbar/svelte @inkbar/core @inkbar/theme
31
31
  ```
32
32
 
33
- Svelte 5.46.4 or later is a peer dependency. Add the Vite plugin from `@inkbar/core/vite` so the PDF engine can load its worker and fonts; the [`@inkbar/core` README](https://github.com/inkbar/inkbar/tree/main/packages/core#serving-pdfjs-assets) covers it. The package ships `.svelte` sources, so your bundler compiles them for your target, including the server.
33
+ Svelte 5.46.4 or later is a peer dependency. Add the Vite plugin from `@inkbar/core/vite` so PDF.js can load its worker and fonts; the [`@inkbar/core` README](https://github.com/inkbar/inkbar/tree/main/packages/core#serving-pdfjs-assets) covers it. The package ships `.svelte` sources, so your bundler compiles them for your target, including the server.
34
34
 
35
35
  ## Usage
36
36
 
@@ -65,8 +65,10 @@ Svelte 5.46.4 or later is a peer dependency. Add the Vite plugin from `@inkbar/c
65
65
 
66
66
  <InkRoot src={{ url: signedUrl, key: documentId }} {assets} bind:annotations>
67
67
  <InkToolbar>
68
+ <InkToolButton tool="view" />
68
69
  <InkToolButton tool="select" />
69
70
  <InkToolButton tool="highlight" />
71
+ <InkToolButton tool="redact-area" />
70
72
  <InkToolButton tool="note" />
71
73
  <InkToolbarSeparator />
72
74
  <InkUndo />
@@ -149,13 +151,13 @@ Inside `InkRoot`, `useHistory()` returns the same object. Its `batch(fn)` runs `
149
151
 
150
152
  `InkNotePopover` opens the thread of the activated note. A new note has no text yet, so the form first writes the note's own text (labelled "Comment"); after that it adds replies.
151
153
 
152
- A root note with no text and no replies is removed when its popover closes, or when activation moves to another annotation, so abandoned notes do not stay on the page. Locked notes are never removed. If you add notes yourself (`add({ type: 'note', ... })`), give them `contents`, or they will be removed the first time someone opens and closes them.
154
+ A root note with no text and no replies is removed when its popover closes, or when activation moves to another annotation, so abandoned notes do not stay on the page. Locked notes are never removed. If you add notes yourself (`add({ type: 'text', ... })`), give them `contents`, or they will be removed the first time someone opens and closes them.
153
155
 
154
156
  ## Custom rendering
155
157
 
156
158
  Slots are snippets. `InkViewport` takes `loading`, `empty`, `error`, `annotation` and `pageError`. `InkNotePopover` and `InkSuggestionCard` take `children` as a snippet that receives the popover's props. `InkToolButton` takes `children` as a snippet of `{ active, label }`. The props each receives are typed as `AnnotationSlotProps`, `NotePopoverSlotProps` and `SuggestionCardSlotProps`, the same types the Vue and React packages export.
157
159
 
158
- `InkRoot`, `InkToolbar`, `InkToolButton`, `InkZoomIn` and `InkZoomOut` take a `child` snippet to render your own element. Spread the `props` it gives you on that element. The snippet type is exported as `ChildSnippet`.
160
+ `InkRoot`, `InkToolbar`, `InkToolButton`, `InkUndo`, `InkRedo`, `InkPrevPage`, `InkNextPage`, `InkZoomIn` and `InkZoomOut` take a `child` snippet to render your own element. Spread the `props` it gives you on that element. The snippet type is exported as `ChildSnippet`.
159
161
 
160
162
  ```svelte
161
163
  <InkToolbar>
@@ -167,7 +169,20 @@ Slots are snippets. `InkViewport` takes `loading`, `empty`, `error`, `annotation
167
169
 
168
170
  ## Keyboard
169
171
 
170
- The scroll element takes focus. With the highlight or redact tool active, `Enter` turns the text selection into a mark; with the note tool, `Enter` places a note in the middle of the current page and opens it. On a focused annotation, `Enter` or `Space` selects and activates it (a note opens its thread and a suggested redaction its card; other types are only selected), `ArrowUp` and `ArrowDown` move between annotations, `Shift` + arrow moves it by 1 pt (add `Alt` for 10 pt), `Ctrl` or `Cmd` + `Shift` + arrow resizes an area mark, and `Delete` removes it. The full table is in the [`@inkbar/core` README](https://github.com/inkbar/inkbar/tree/main/packages/core#tools-and-keyboard).
172
+ The scroll area takes focus. From there:
173
+
174
+ - With the `highlight` or `redact-area` tool active, `Enter` turns the text selection into a mark.
175
+ - With the `note` tool active, `Enter` places a note at the centre of the current page and opens it.
176
+
177
+ On a focused annotation:
178
+
179
+ - `Enter` or `Space` selects and activates it. A note opens its thread and a suggested redaction its card; other types are only selected.
180
+ - `ArrowUp` and `ArrowDown` move to the previous or next annotation on the page.
181
+ - `Shift` + arrow moves it by 1 pt, or by 10 pt with `Alt` as well.
182
+ - `Ctrl` or `Cmd` + `Shift` + arrow resizes an area redaction, text box or shape.
183
+ - `Delete` or `Backspace` removes it.
184
+
185
+ The full table, with the zoom and page keys, is in the [`@inkbar/core` README](https://github.com/inkbar/inkbar/tree/main/packages/core#tools-and-keyboard).
171
186
 
172
187
  ## Styling
173
188
 
@@ -40,7 +40,7 @@
40
40
  const a = ctx.activated
41
41
  ? store.annotations.find((x) => x.id === ctx.activated)
42
42
  : undefined
43
- return a?.type === 'note' ? threadRoot(store.annotations, a) : null
43
+ return a?.type === 'text' ? threadRoot(store.annotations, a) : null
44
44
  })
45
45
  const anchorRef = useAnnotationElement(
46
46
  () => ctx.rootEl,
@@ -90,7 +90,7 @@
90
90
  if (!root || !contents) return
91
91
  written.add(root.id)
92
92
  store.add({
93
- type: 'note',
93
+ type: 'text',
94
94
  page: root.page,
95
95
  rect: root.rect,
96
96
  contents,
@@ -52,8 +52,8 @@ export declare function useAnnotations(): {
52
52
  createdAt: string;
53
53
  modifiedAt: string;
54
54
  source: "session" | "pdf";
55
- type: "note";
56
- icon: "note" | "comment" | "help" | "insert" | "key" | "paragraph";
55
+ type: "text";
56
+ icon: "comment" | "note" | "help" | "insert" | "key" | "paragraph";
57
57
  author?: string | undefined;
58
58
  contents?: string | undefined;
59
59
  inReplyTo?: string | undefined;
@@ -73,13 +73,12 @@ export declare function useAnnotations(): {
73
73
  createdAt: string;
74
74
  modifiedAt: string;
75
75
  source: "session" | "pdf";
76
- type: "freeText";
77
- text: string;
76
+ type: "freetext";
77
+ contents: string;
78
78
  fontSize: number;
79
79
  fontFamily: string;
80
80
  align: "left" | "center" | "right";
81
81
  author?: string | undefined;
82
- contents?: string | undefined;
83
82
  inReplyTo?: string | undefined;
84
83
  locked?: boolean | undefined;
85
84
  custom?: Record<string, unknown> | undefined;
@@ -102,13 +101,13 @@ export declare function useAnnotations(): {
102
101
  modifiedAt: string;
103
102
  source: "session" | "pdf";
104
103
  type: "square" | "circle";
105
- strokeWidth: number;
104
+ width: number;
106
105
  author?: string | undefined;
107
106
  contents?: string | undefined;
108
107
  inReplyTo?: string | undefined;
109
108
  locked?: boolean | undefined;
110
109
  custom?: Record<string, unknown> | undefined;
111
- fill?: string | undefined;
110
+ interiorColor?: string | undefined;
112
111
  } | {
113
112
  id: string;
114
113
  page: number;
@@ -132,13 +131,14 @@ export declare function useAnnotations(): {
132
131
  x: number;
133
132
  y: number;
134
133
  };
135
- strokeWidth: number;
134
+ width: number;
136
135
  author?: string | undefined;
137
136
  contents?: string | undefined;
138
137
  inReplyTo?: string | undefined;
139
138
  locked?: boolean | undefined;
140
139
  custom?: Record<string, unknown> | undefined;
141
- endings?: ["square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash", "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash"] | undefined;
140
+ head?: "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash" | undefined;
141
+ tail?: "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash" | undefined;
142
142
  } | {
143
143
  id: string;
144
144
  page: number;
@@ -158,13 +158,13 @@ export declare function useAnnotations(): {
158
158
  x: number;
159
159
  y: number;
160
160
  }[];
161
- strokeWidth: number;
161
+ width: number;
162
162
  author?: string | undefined;
163
163
  contents?: string | undefined;
164
164
  inReplyTo?: string | undefined;
165
165
  locked?: boolean | undefined;
166
166
  custom?: Record<string, unknown> | undefined;
167
- fill?: string | undefined;
167
+ interiorColor?: string | undefined;
168
168
  } | {
169
169
  id: string;
170
170
  page: number;
@@ -180,11 +180,11 @@ export declare function useAnnotations(): {
180
180
  modifiedAt: string;
181
181
  source: "session" | "pdf";
182
182
  type: "ink";
183
- paths: {
183
+ inklist: {
184
184
  x: number;
185
185
  y: number;
186
186
  }[][];
187
- strokeWidth: number;
187
+ width: number;
188
188
  author?: string | undefined;
189
189
  contents?: string | undefined;
190
190
  inReplyTo?: string | undefined;
@@ -206,7 +206,7 @@ export declare function useAnnotations(): {
206
206
  source: "session" | "pdf";
207
207
  type: "redact";
208
208
  origin: "user" | "suggested";
209
- fill: string;
209
+ interiorColor: string;
210
210
  author?: string | undefined;
211
211
  contents?: string | undefined;
212
212
  inReplyTo?: string | undefined;
@@ -292,8 +292,8 @@ export declare function useAnnotations(): {
292
292
  createdAt: string;
293
293
  modifiedAt: string;
294
294
  source: "session" | "pdf";
295
- type: "note";
296
- icon: "note" | "comment" | "help" | "insert" | "key" | "paragraph";
295
+ type: "text";
296
+ icon: "comment" | "note" | "help" | "insert" | "key" | "paragraph";
297
297
  author?: string | undefined;
298
298
  contents?: string | undefined;
299
299
  inReplyTo?: string | undefined;
@@ -313,13 +313,12 @@ export declare function useAnnotations(): {
313
313
  createdAt: string;
314
314
  modifiedAt: string;
315
315
  source: "session" | "pdf";
316
- type: "freeText";
317
- text: string;
316
+ type: "freetext";
317
+ contents: string;
318
318
  fontSize: number;
319
319
  fontFamily: string;
320
320
  align: "left" | "center" | "right";
321
321
  author?: string | undefined;
322
- contents?: string | undefined;
323
322
  inReplyTo?: string | undefined;
324
323
  locked?: boolean | undefined;
325
324
  custom?: Record<string, unknown> | undefined;
@@ -342,13 +341,13 @@ export declare function useAnnotations(): {
342
341
  modifiedAt: string;
343
342
  source: "session" | "pdf";
344
343
  type: "square" | "circle";
345
- strokeWidth: number;
344
+ width: number;
346
345
  author?: string | undefined;
347
346
  contents?: string | undefined;
348
347
  inReplyTo?: string | undefined;
349
348
  locked?: boolean | undefined;
350
349
  custom?: Record<string, unknown> | undefined;
351
- fill?: string | undefined;
350
+ interiorColor?: string | undefined;
352
351
  } | {
353
352
  id: string;
354
353
  page: number;
@@ -372,13 +371,14 @@ export declare function useAnnotations(): {
372
371
  x: number;
373
372
  y: number;
374
373
  };
375
- strokeWidth: number;
374
+ width: number;
376
375
  author?: string | undefined;
377
376
  contents?: string | undefined;
378
377
  inReplyTo?: string | undefined;
379
378
  locked?: boolean | undefined;
380
379
  custom?: Record<string, unknown> | undefined;
381
- endings?: ["square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash", "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash"] | undefined;
380
+ head?: "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash" | undefined;
381
+ tail?: "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash" | undefined;
382
382
  } | {
383
383
  id: string;
384
384
  page: number;
@@ -398,13 +398,13 @@ export declare function useAnnotations(): {
398
398
  x: number;
399
399
  y: number;
400
400
  }[];
401
- strokeWidth: number;
401
+ width: number;
402
402
  author?: string | undefined;
403
403
  contents?: string | undefined;
404
404
  inReplyTo?: string | undefined;
405
405
  locked?: boolean | undefined;
406
406
  custom?: Record<string, unknown> | undefined;
407
- fill?: string | undefined;
407
+ interiorColor?: string | undefined;
408
408
  } | {
409
409
  id: string;
410
410
  page: number;
@@ -420,11 +420,11 @@ export declare function useAnnotations(): {
420
420
  modifiedAt: string;
421
421
  source: "session" | "pdf";
422
422
  type: "ink";
423
- paths: {
423
+ inklist: {
424
424
  x: number;
425
425
  y: number;
426
426
  }[][];
427
- strokeWidth: number;
427
+ width: number;
428
428
  author?: string | undefined;
429
429
  contents?: string | undefined;
430
430
  inReplyTo?: string | undefined;
@@ -446,7 +446,7 @@ export declare function useAnnotations(): {
446
446
  source: "session" | "pdf";
447
447
  type: "redact";
448
448
  origin: "user" | "suggested";
449
- fill: string;
449
+ interiorColor: string;
450
450
  author?: string | undefined;
451
451
  contents?: string | undefined;
452
452
  inReplyTo?: string | undefined;
@@ -531,8 +531,8 @@ export declare function useAnnotations(): {
531
531
  createdAt: string;
532
532
  modifiedAt: string;
533
533
  source: "session" | "pdf";
534
- type: "note";
535
- icon: "note" | "comment" | "help" | "insert" | "key" | "paragraph";
534
+ type: "text";
535
+ icon: "comment" | "note" | "help" | "insert" | "key" | "paragraph";
536
536
  author?: string | undefined;
537
537
  contents?: string | undefined;
538
538
  inReplyTo?: string | undefined;
@@ -552,13 +552,12 @@ export declare function useAnnotations(): {
552
552
  createdAt: string;
553
553
  modifiedAt: string;
554
554
  source: "session" | "pdf";
555
- type: "freeText";
556
- text: string;
555
+ type: "freetext";
556
+ contents: string;
557
557
  fontSize: number;
558
558
  fontFamily: string;
559
559
  align: "left" | "center" | "right";
560
560
  author?: string | undefined;
561
- contents?: string | undefined;
562
561
  inReplyTo?: string | undefined;
563
562
  locked?: boolean | undefined;
564
563
  custom?: Record<string, unknown> | undefined;
@@ -581,13 +580,13 @@ export declare function useAnnotations(): {
581
580
  modifiedAt: string;
582
581
  source: "session" | "pdf";
583
582
  type: "square" | "circle";
584
- strokeWidth: number;
583
+ width: number;
585
584
  author?: string | undefined;
586
585
  contents?: string | undefined;
587
586
  inReplyTo?: string | undefined;
588
587
  locked?: boolean | undefined;
589
588
  custom?: Record<string, unknown> | undefined;
590
- fill?: string | undefined;
589
+ interiorColor?: string | undefined;
591
590
  } | {
592
591
  id: string;
593
592
  page: number;
@@ -611,13 +610,14 @@ export declare function useAnnotations(): {
611
610
  x: number;
612
611
  y: number;
613
612
  };
614
- strokeWidth: number;
613
+ width: number;
615
614
  author?: string | undefined;
616
615
  contents?: string | undefined;
617
616
  inReplyTo?: string | undefined;
618
617
  locked?: boolean | undefined;
619
618
  custom?: Record<string, unknown> | undefined;
620
- endings?: ["square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash", "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash"] | undefined;
619
+ head?: "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash" | undefined;
620
+ tail?: "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash" | undefined;
621
621
  } | {
622
622
  id: string;
623
623
  page: number;
@@ -637,13 +637,13 @@ export declare function useAnnotations(): {
637
637
  x: number;
638
638
  y: number;
639
639
  }[];
640
- strokeWidth: number;
640
+ width: number;
641
641
  author?: string | undefined;
642
642
  contents?: string | undefined;
643
643
  inReplyTo?: string | undefined;
644
644
  locked?: boolean | undefined;
645
645
  custom?: Record<string, unknown> | undefined;
646
- fill?: string | undefined;
646
+ interiorColor?: string | undefined;
647
647
  } | {
648
648
  id: string;
649
649
  page: number;
@@ -659,11 +659,11 @@ export declare function useAnnotations(): {
659
659
  modifiedAt: string;
660
660
  source: "session" | "pdf";
661
661
  type: "ink";
662
- paths: {
662
+ inklist: {
663
663
  x: number;
664
664
  y: number;
665
665
  }[][];
666
- strokeWidth: number;
666
+ width: number;
667
667
  author?: string | undefined;
668
668
  contents?: string | undefined;
669
669
  inReplyTo?: string | undefined;
@@ -685,7 +685,7 @@ export declare function useAnnotations(): {
685
685
  source: "session" | "pdf";
686
686
  type: "redact";
687
687
  origin: "user" | "suggested";
688
- fill: string;
688
+ interiorColor: string;
689
689
  author?: string | undefined;
690
690
  contents?: string | undefined;
691
691
  inReplyTo?: string | undefined;
@@ -771,8 +771,8 @@ export declare function useAnnotations(): {
771
771
  createdAt: string;
772
772
  modifiedAt: string;
773
773
  source: "session" | "pdf";
774
- type: "note";
775
- icon: "note" | "comment" | "help" | "insert" | "key" | "paragraph";
774
+ type: "text";
775
+ icon: "comment" | "note" | "help" | "insert" | "key" | "paragraph";
776
776
  author?: string | undefined;
777
777
  contents?: string | undefined;
778
778
  inReplyTo?: string | undefined;
@@ -792,13 +792,12 @@ export declare function useAnnotations(): {
792
792
  createdAt: string;
793
793
  modifiedAt: string;
794
794
  source: "session" | "pdf";
795
- type: "freeText";
796
- text: string;
795
+ type: "freetext";
796
+ contents: string;
797
797
  fontSize: number;
798
798
  fontFamily: string;
799
799
  align: "left" | "center" | "right";
800
800
  author?: string | undefined;
801
- contents?: string | undefined;
802
801
  inReplyTo?: string | undefined;
803
802
  locked?: boolean | undefined;
804
803
  custom?: Record<string, unknown> | undefined;
@@ -821,13 +820,13 @@ export declare function useAnnotations(): {
821
820
  modifiedAt: string;
822
821
  source: "session" | "pdf";
823
822
  type: "square" | "circle";
824
- strokeWidth: number;
823
+ width: number;
825
824
  author?: string | undefined;
826
825
  contents?: string | undefined;
827
826
  inReplyTo?: string | undefined;
828
827
  locked?: boolean | undefined;
829
828
  custom?: Record<string, unknown> | undefined;
830
- fill?: string | undefined;
829
+ interiorColor?: string | undefined;
831
830
  } | {
832
831
  id: string;
833
832
  page: number;
@@ -851,13 +850,14 @@ export declare function useAnnotations(): {
851
850
  x: number;
852
851
  y: number;
853
852
  };
854
- strokeWidth: number;
853
+ width: number;
855
854
  author?: string | undefined;
856
855
  contents?: string | undefined;
857
856
  inReplyTo?: string | undefined;
858
857
  locked?: boolean | undefined;
859
858
  custom?: Record<string, unknown> | undefined;
860
- endings?: ["square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash", "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash"] | undefined;
859
+ head?: "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash" | undefined;
860
+ tail?: "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash" | undefined;
861
861
  } | {
862
862
  id: string;
863
863
  page: number;
@@ -877,13 +877,13 @@ export declare function useAnnotations(): {
877
877
  x: number;
878
878
  y: number;
879
879
  }[];
880
- strokeWidth: number;
880
+ width: number;
881
881
  author?: string | undefined;
882
882
  contents?: string | undefined;
883
883
  inReplyTo?: string | undefined;
884
884
  locked?: boolean | undefined;
885
885
  custom?: Record<string, unknown> | undefined;
886
- fill?: string | undefined;
886
+ interiorColor?: string | undefined;
887
887
  } | {
888
888
  id: string;
889
889
  page: number;
@@ -899,11 +899,11 @@ export declare function useAnnotations(): {
899
899
  modifiedAt: string;
900
900
  source: "session" | "pdf";
901
901
  type: "ink";
902
- paths: {
902
+ inklist: {
903
903
  x: number;
904
904
  y: number;
905
905
  }[][];
906
- strokeWidth: number;
906
+ width: number;
907
907
  author?: string | undefined;
908
908
  contents?: string | undefined;
909
909
  inReplyTo?: string | undefined;
@@ -925,7 +925,7 @@ export declare function useAnnotations(): {
925
925
  source: "session" | "pdf";
926
926
  type: "redact";
927
927
  origin: "user" | "suggested";
928
- fill: string;
928
+ interiorColor: string;
929
929
  author?: string | undefined;
930
930
  contents?: string | undefined;
931
931
  inReplyTo?: string | undefined;
@@ -1010,8 +1010,8 @@ export declare function useAnnotations(): {
1010
1010
  createdAt: string;
1011
1011
  modifiedAt: string;
1012
1012
  source: "session" | "pdf";
1013
- type: "note";
1014
- icon: "note" | "comment" | "help" | "insert" | "key" | "paragraph";
1013
+ type: "text";
1014
+ icon: "comment" | "note" | "help" | "insert" | "key" | "paragraph";
1015
1015
  author?: string | undefined;
1016
1016
  contents?: string | undefined;
1017
1017
  inReplyTo?: string | undefined;
@@ -1031,13 +1031,12 @@ export declare function useAnnotations(): {
1031
1031
  createdAt: string;
1032
1032
  modifiedAt: string;
1033
1033
  source: "session" | "pdf";
1034
- type: "freeText";
1035
- text: string;
1034
+ type: "freetext";
1035
+ contents: string;
1036
1036
  fontSize: number;
1037
1037
  fontFamily: string;
1038
1038
  align: "left" | "center" | "right";
1039
1039
  author?: string | undefined;
1040
- contents?: string | undefined;
1041
1040
  inReplyTo?: string | undefined;
1042
1041
  locked?: boolean | undefined;
1043
1042
  custom?: Record<string, unknown> | undefined;
@@ -1060,13 +1059,13 @@ export declare function useAnnotations(): {
1060
1059
  modifiedAt: string;
1061
1060
  source: "session" | "pdf";
1062
1061
  type: "square" | "circle";
1063
- strokeWidth: number;
1062
+ width: number;
1064
1063
  author?: string | undefined;
1065
1064
  contents?: string | undefined;
1066
1065
  inReplyTo?: string | undefined;
1067
1066
  locked?: boolean | undefined;
1068
1067
  custom?: Record<string, unknown> | undefined;
1069
- fill?: string | undefined;
1068
+ interiorColor?: string | undefined;
1070
1069
  } | {
1071
1070
  id: string;
1072
1071
  page: number;
@@ -1090,13 +1089,14 @@ export declare function useAnnotations(): {
1090
1089
  x: number;
1091
1090
  y: number;
1092
1091
  };
1093
- strokeWidth: number;
1092
+ width: number;
1094
1093
  author?: string | undefined;
1095
1094
  contents?: string | undefined;
1096
1095
  inReplyTo?: string | undefined;
1097
1096
  locked?: boolean | undefined;
1098
1097
  custom?: Record<string, unknown> | undefined;
1099
- endings?: ["square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash", "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash"] | undefined;
1098
+ head?: "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash" | undefined;
1099
+ tail?: "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash" | undefined;
1100
1100
  } | {
1101
1101
  id: string;
1102
1102
  page: number;
@@ -1116,13 +1116,13 @@ export declare function useAnnotations(): {
1116
1116
  x: number;
1117
1117
  y: number;
1118
1118
  }[];
1119
- strokeWidth: number;
1119
+ width: number;
1120
1120
  author?: string | undefined;
1121
1121
  contents?: string | undefined;
1122
1122
  inReplyTo?: string | undefined;
1123
1123
  locked?: boolean | undefined;
1124
1124
  custom?: Record<string, unknown> | undefined;
1125
- fill?: string | undefined;
1125
+ interiorColor?: string | undefined;
1126
1126
  } | {
1127
1127
  id: string;
1128
1128
  page: number;
@@ -1138,11 +1138,11 @@ export declare function useAnnotations(): {
1138
1138
  modifiedAt: string;
1139
1139
  source: "session" | "pdf";
1140
1140
  type: "ink";
1141
- paths: {
1141
+ inklist: {
1142
1142
  x: number;
1143
1143
  y: number;
1144
1144
  }[][];
1145
- strokeWidth: number;
1145
+ width: number;
1146
1146
  author?: string | undefined;
1147
1147
  contents?: string | undefined;
1148
1148
  inReplyTo?: string | undefined;
@@ -1164,7 +1164,7 @@ export declare function useAnnotations(): {
1164
1164
  source: "session" | "pdf";
1165
1165
  type: "redact";
1166
1166
  origin: "user" | "suggested";
1167
- fill: string;
1167
+ interiorColor: string;
1168
1168
  author?: string | undefined;
1169
1169
  contents?: string | undefined;
1170
1170
  inReplyTo?: string | undefined;
@@ -1249,8 +1249,8 @@ export declare function useAnnotations(): {
1249
1249
  createdAt: string;
1250
1250
  modifiedAt: string;
1251
1251
  source: "session" | "pdf";
1252
- type: "note";
1253
- icon: "note" | "comment" | "help" | "insert" | "key" | "paragraph";
1252
+ type: "text";
1253
+ icon: "comment" | "note" | "help" | "insert" | "key" | "paragraph";
1254
1254
  author?: string | undefined;
1255
1255
  contents?: string | undefined;
1256
1256
  inReplyTo?: string | undefined;
@@ -1270,13 +1270,12 @@ export declare function useAnnotations(): {
1270
1270
  createdAt: string;
1271
1271
  modifiedAt: string;
1272
1272
  source: "session" | "pdf";
1273
- type: "freeText";
1274
- text: string;
1273
+ type: "freetext";
1274
+ contents: string;
1275
1275
  fontSize: number;
1276
1276
  fontFamily: string;
1277
1277
  align: "left" | "center" | "right";
1278
1278
  author?: string | undefined;
1279
- contents?: string | undefined;
1280
1279
  inReplyTo?: string | undefined;
1281
1280
  locked?: boolean | undefined;
1282
1281
  custom?: Record<string, unknown> | undefined;
@@ -1299,13 +1298,13 @@ export declare function useAnnotations(): {
1299
1298
  modifiedAt: string;
1300
1299
  source: "session" | "pdf";
1301
1300
  type: "square" | "circle";
1302
- strokeWidth: number;
1301
+ width: number;
1303
1302
  author?: string | undefined;
1304
1303
  contents?: string | undefined;
1305
1304
  inReplyTo?: string | undefined;
1306
1305
  locked?: boolean | undefined;
1307
1306
  custom?: Record<string, unknown> | undefined;
1308
- fill?: string | undefined;
1307
+ interiorColor?: string | undefined;
1309
1308
  } | {
1310
1309
  id: string;
1311
1310
  page: number;
@@ -1329,13 +1328,14 @@ export declare function useAnnotations(): {
1329
1328
  x: number;
1330
1329
  y: number;
1331
1330
  };
1332
- strokeWidth: number;
1331
+ width: number;
1333
1332
  author?: string | undefined;
1334
1333
  contents?: string | undefined;
1335
1334
  inReplyTo?: string | undefined;
1336
1335
  locked?: boolean | undefined;
1337
1336
  custom?: Record<string, unknown> | undefined;
1338
- endings?: ["square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash", "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash"] | undefined;
1337
+ head?: "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash" | undefined;
1338
+ tail?: "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash" | undefined;
1339
1339
  } | {
1340
1340
  id: string;
1341
1341
  page: number;
@@ -1355,13 +1355,13 @@ export declare function useAnnotations(): {
1355
1355
  x: number;
1356
1356
  y: number;
1357
1357
  }[];
1358
- strokeWidth: number;
1358
+ width: number;
1359
1359
  author?: string | undefined;
1360
1360
  contents?: string | undefined;
1361
1361
  inReplyTo?: string | undefined;
1362
1362
  locked?: boolean | undefined;
1363
1363
  custom?: Record<string, unknown> | undefined;
1364
- fill?: string | undefined;
1364
+ interiorColor?: string | undefined;
1365
1365
  } | {
1366
1366
  id: string;
1367
1367
  page: number;
@@ -1377,11 +1377,11 @@ export declare function useAnnotations(): {
1377
1377
  modifiedAt: string;
1378
1378
  source: "session" | "pdf";
1379
1379
  type: "ink";
1380
- paths: {
1380
+ inklist: {
1381
1381
  x: number;
1382
1382
  y: number;
1383
1383
  }[][];
1384
- strokeWidth: number;
1384
+ width: number;
1385
1385
  author?: string | undefined;
1386
1386
  contents?: string | undefined;
1387
1387
  inReplyTo?: string | undefined;
@@ -1403,7 +1403,7 @@ export declare function useAnnotations(): {
1403
1403
  source: "session" | "pdf";
1404
1404
  type: "redact";
1405
1405
  origin: "user" | "suggested";
1406
- fill: string;
1406
+ interiorColor: string;
1407
1407
  author?: string | undefined;
1408
1408
  contents?: string | undefined;
1409
1409
  inReplyTo?: string | undefined;
@@ -1491,8 +1491,8 @@ export declare function useAnnotations(): {
1491
1491
  createdAt: string;
1492
1492
  modifiedAt: string;
1493
1493
  source: "session" | "pdf";
1494
- type: "note";
1495
- icon: "note" | "comment" | "help" | "insert" | "key" | "paragraph";
1494
+ type: "text";
1495
+ icon: "comment" | "note" | "help" | "insert" | "key" | "paragraph";
1496
1496
  author?: string | undefined;
1497
1497
  contents?: string | undefined;
1498
1498
  inReplyTo?: string | undefined;
@@ -1512,13 +1512,12 @@ export declare function useAnnotations(): {
1512
1512
  createdAt: string;
1513
1513
  modifiedAt: string;
1514
1514
  source: "session" | "pdf";
1515
- type: "freeText";
1516
- text: string;
1515
+ type: "freetext";
1516
+ contents: string;
1517
1517
  fontSize: number;
1518
1518
  fontFamily: string;
1519
1519
  align: "left" | "center" | "right";
1520
1520
  author?: string | undefined;
1521
- contents?: string | undefined;
1522
1521
  inReplyTo?: string | undefined;
1523
1522
  locked?: boolean | undefined;
1524
1523
  custom?: Record<string, unknown> | undefined;
@@ -1541,13 +1540,13 @@ export declare function useAnnotations(): {
1541
1540
  modifiedAt: string;
1542
1541
  source: "session" | "pdf";
1543
1542
  type: "square" | "circle";
1544
- strokeWidth: number;
1543
+ width: number;
1545
1544
  author?: string | undefined;
1546
1545
  contents?: string | undefined;
1547
1546
  inReplyTo?: string | undefined;
1548
1547
  locked?: boolean | undefined;
1549
1548
  custom?: Record<string, unknown> | undefined;
1550
- fill?: string | undefined;
1549
+ interiorColor?: string | undefined;
1551
1550
  } | {
1552
1551
  id: string;
1553
1552
  page: number;
@@ -1571,13 +1570,14 @@ export declare function useAnnotations(): {
1571
1570
  x: number;
1572
1571
  y: number;
1573
1572
  };
1574
- strokeWidth: number;
1573
+ width: number;
1575
1574
  author?: string | undefined;
1576
1575
  contents?: string | undefined;
1577
1576
  inReplyTo?: string | undefined;
1578
1577
  locked?: boolean | undefined;
1579
1578
  custom?: Record<string, unknown> | undefined;
1580
- endings?: ["square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash", "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash"] | undefined;
1579
+ head?: "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash" | undefined;
1580
+ tail?: "square" | "circle" | "none" | "openArrow" | "closedArrow" | "diamond" | "butt" | "slash" | undefined;
1581
1581
  } | {
1582
1582
  id: string;
1583
1583
  page: number;
@@ -1597,13 +1597,13 @@ export declare function useAnnotations(): {
1597
1597
  x: number;
1598
1598
  y: number;
1599
1599
  }[];
1600
- strokeWidth: number;
1600
+ width: number;
1601
1601
  author?: string | undefined;
1602
1602
  contents?: string | undefined;
1603
1603
  inReplyTo?: string | undefined;
1604
1604
  locked?: boolean | undefined;
1605
1605
  custom?: Record<string, unknown> | undefined;
1606
- fill?: string | undefined;
1606
+ interiorColor?: string | undefined;
1607
1607
  } | {
1608
1608
  id: string;
1609
1609
  page: number;
@@ -1619,11 +1619,11 @@ export declare function useAnnotations(): {
1619
1619
  modifiedAt: string;
1620
1620
  source: "session" | "pdf";
1621
1621
  type: "ink";
1622
- paths: {
1622
+ inklist: {
1623
1623
  x: number;
1624
1624
  y: number;
1625
1625
  }[][];
1626
- strokeWidth: number;
1626
+ width: number;
1627
1627
  author?: string | undefined;
1628
1628
  contents?: string | undefined;
1629
1629
  inReplyTo?: string | undefined;
@@ -1645,7 +1645,7 @@ export declare function useAnnotations(): {
1645
1645
  source: "session" | "pdf";
1646
1646
  type: "redact";
1647
1647
  origin: "user" | "suggested";
1648
- fill: string;
1648
+ interiorColor: string;
1649
1649
  author?: string | undefined;
1650
1650
  contents?: string | undefined;
1651
1651
  inReplyTo?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkbar/svelte",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Svelte 5 components and hooks for Inkbar, the browser PDF viewer and editor.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://inkbar.dev",
@@ -26,19 +26,19 @@
26
26
  "./package.json": "./package.json"
27
27
  },
28
28
  "dependencies": {
29
- "@inkbar/icons": "^0.2.0",
29
+ "@inkbar/icons": "^0.3.0",
30
30
  "@internationalized/date": "^3.12.4",
31
31
  "bits-ui": "^2.19.5",
32
32
  "esm-env": "^1.2.0"
33
33
  },
34
34
  "peerDependencies": {
35
- "@inkbar/core": "^0.2.0",
35
+ "@inkbar/core": "^0.3.0",
36
36
  "svelte": "^5.46.4"
37
37
  },
38
38
  "devDependencies": {
39
- "@inkbar/core": "0.2.0",
39
+ "@inkbar/core": "0.3.0",
40
40
  "@inkbar/fixtures": "0.0.0",
41
- "@inkbar/theme": "0.2.0",
41
+ "@inkbar/theme": "0.3.0",
42
42
  "@sveltejs/package": "^3.0.0",
43
43
  "@sveltejs/vite-plugin-svelte": "^7.3.1",
44
44
  "@vitest/browser-playwright": "^5.0.4",