@embedpdf/plugin-annotation 3.0.0-next.21 → 3.0.0-next.23

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 (31) hide show
  1. package/dist/contract/host.cjs +2 -2
  2. package/dist/contract/host.d.cts +3 -3
  3. package/dist/contract/host.d.ts +3 -3
  4. package/dist/contract/host.js +2 -2
  5. package/dist/{contract-Cm0cfAzG.d.cts → contract-BK2g1Rem.d.ts} +85 -68
  6. package/dist/{contract-CPzpRG3h.cjs → contract-BtAl3Yo2.cjs} +4 -4
  7. package/dist/contract-BtAl3Yo2.cjs.map +1 -0
  8. package/dist/{contract-QAvnfm2b.d.ts → contract-CBYEqnev.d.cts} +85 -68
  9. package/dist/{contract-b2e_LZvu.js → contract-OwgW3JE8.js} +4 -4
  10. package/dist/contract-OwgW3JE8.js.map +1 -0
  11. package/dist/contract.cjs +1 -1
  12. package/dist/contract.d.cts +2 -2
  13. package/dist/contract.d.ts +2 -2
  14. package/dist/contract.js +1 -1
  15. package/dist/{host-contract-DY9jFPPF.cjs → host-contract-BzM2upsA.cjs} +2 -2
  16. package/dist/host-contract-BzM2upsA.cjs.map +1 -0
  17. package/dist/{host-contract-BDwyBNrs.d.cts → host-contract-COF2Prd-.d.ts} +33 -29
  18. package/dist/{host-contract-CxrQPcPj.js → host-contract-CSKiuu3g.js} +2 -2
  19. package/dist/host-contract-CSKiuu3g.js.map +1 -0
  20. package/dist/{host-contract-BUub1Un-.d.ts → host-contract-CxOrR_pp.d.cts} +33 -29
  21. package/dist/index.cjs +249 -103
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +4 -4
  24. package/dist/index.d.ts +4 -4
  25. package/dist/index.js +250 -104
  26. package/dist/index.js.map +1 -1
  27. package/package.json +12 -12
  28. package/dist/contract-CPzpRG3h.cjs.map +0 -1
  29. package/dist/contract-b2e_LZvu.js.map +0 -1
  30. package/dist/host-contract-CxrQPcPj.js.map +0 -1
  31. package/dist/host-contract-DY9jFPPF.cjs.map +0 -1
@@ -1,10 +1,10 @@
1
- import { Et as TextItem, G as ArmedStampInfo, Jt as TextSelection, K as ArmedStampPreview, N as AnnotationSelectionAnchor, Vt as ResolvedTool, Y as Behavior, ft as ImageGhost, gt as LinkNavItem, i as AnnotationAnchor, o as AnnotationCapability, r as Annotation$1 } from "./contract-QAvnfm2b.js";
1
+ import { Et as TextItem, G as ArmedStampInfo, K as ArmedStampPreview, Kt as EditorSelection, N as AnnotationSelectionAnchor, Vt as ResolvedTool, Y as Behavior, ft as ImageGhost, gt as LinkNavItem, i as AnnotationAnchor, o as AnnotationCapability, r as Annotation$1 } from "./contract-CBYEqnev.cjs";
2
+ import { ChromeNode, EditableKinds, Effect, Id, KindName, Model, Point, Quad, Rect, RenderItem, SceneNode, Session, SnapSettings, TextEndAnchor, ViewEnv } from "@embedpdf/core-annotation";
2
3
  import { EventHook, PredictedOp, Unsubscribe } from "@embedpdf/core";
4
+ import { Rotation } from "@embedpdf/core-geometry";
3
5
  import { AnnotationAppearanceImage, AnnotationPosition, AnnotationRef, ChangeOp, ImageSource, PageMeasurementViewport, PageRef, PdfMeasure, RichTextParagraph, SerializedEngineError } from "@embedpdf/engine-core/runtime";
4
- import { ChromeNode, EditableKinds, Effect, Id, KindName, Model, Point, Quad, Rect, RenderItem, SceneNode, Session, SnapSettings, TextEndAnchor, ViewEnv } from "@embedpdf/core-annotation";
5
- import { AnnotCommitEntry, AnnotCommitResult } from "@embedpdf/plugin-actions/contract/host";
6
+ import { AnnotationCommitEntry, AnnotationCommitResult } from "@embedpdf/plugin-actions/contract/host";
6
7
  import { AppearancePicture } from "@embedpdf/plugin-render/contract/host";
7
- import { PageRotation } from "@embedpdf/core-geometry";
8
8
  //#region src/model.d.ts
9
9
  /** Where the active tool's ghost is: the pointer on a page, and how that page shows there. */
10
10
  interface GhostPointer {
@@ -12,7 +12,7 @@ interface GhostPointer {
12
12
  readonly page: PageRef;
13
13
  readonly point: Point;
14
14
  /** The page's display rotation at the pointer (an upright tool lays its click out as seen). */
15
- readonly displayRotation?: PageRotation;
15
+ readonly displayRotation?: Rotation;
16
16
  /** The page's zoom at the pointer (a screen-sized icon's size depends on it). */
17
17
  readonly zoom?: number;
18
18
  }
@@ -48,9 +48,10 @@ interface AnnotationModel {
48
48
  * The text editor's selection inside the annotation being edited (flat
49
49
  * offsets over its plain text), or null. It is state because the property
50
50
  * surface reads it: while a range is held, the text style keys report and
51
- * change the runs, not the whole body.
51
+ * change the runs it covers; at a caret, the text typed there next, with the
52
+ * style chosen at the caret.
52
53
  */
53
- readonly textSelection: TextSelection | null;
54
+ readonly textSelection: EditorSelection | null;
54
55
  }
55
56
  //#endregion
56
57
  //#region src/priorities.d.ts
@@ -120,20 +121,20 @@ interface AnnotationLender {
120
121
  /** The ops that move these records of one page to `position` in its drawing order. */
121
122
  reorderOps(page: PageRef, refs: readonly AnnotationRef[], position: AnnotationPosition): readonly ChangeOp[];
122
123
  /** Whether this session may change and delete the record. */
123
- authority(record: Annotation$1): {
124
+ getAuthority(record: Annotation$1): {
124
125
  readonly update: boolean;
125
126
  readonly delete: boolean;
126
127
  };
127
128
  /** What its records' pictures on a page depend on: a new value means new pictures. */
128
- pictureEpoch(page: PageRef): string;
129
+ getPictureEpoch(page: PageRef): string;
129
130
  /** A record's confirmed picture version; kept for one that went, so an undo brings it back with it. */
130
- pictureVersion(record: AnnotationRef): number;
131
+ getPictureVersion(record: AnnotationRef): number;
131
132
  /**
132
133
  * The record's look as it shows isn't its confirmed look yet, whatever changed it (a restyle,
133
134
  * a resize, one just placed, a change the lender made itself): it draws live, by its
134
135
  * {@link painter}, until the engine's picture of it is there.
135
136
  */
136
- pending(record: AnnotationRef): boolean;
137
+ isPending(record: AnnotationRef): boolean;
137
138
  /**
138
139
  * How the lender draws the record live: the record upright in `box` (its box, or where a
139
140
  * gesture has it), in page space; `null` for one it doesn't draw. A record with a painter
@@ -180,7 +181,7 @@ interface AnnotationHostCapability extends AnnotationCapability {
180
181
  remeasurePage(page: PageRef, scale: PdfMeasure): Promise<RecalibrationReport>;
181
182
  /** A distance draft was captured (the measurement plugin turns it into a calibration). */
182
183
  readonly onDraftCaptured: EventHook<CapturedAnnotationDraft>;
183
- distanceCreationPage(): PageRef | null;
184
+ getDistanceCreationPage(): PageRef | null;
184
185
  /**
185
186
  * The selection's anchor as a page shows it: its rotation handle where the
186
187
  * page's view puts it (screen-sized, so it depends on the zoom), for a menu
@@ -188,7 +189,7 @@ interface AnnotationHostCapability extends AnnotationCapability {
188
189
  */
189
190
  getSelectionAnchorIn(view: {
190
191
  scale?: number;
191
- rotation?: PageRotation;
192
+ rotation?: Rotation;
192
193
  zoom?: number;
193
194
  }): AnnotationSelectionAnchor | null;
194
195
  /**
@@ -210,7 +211,7 @@ interface AnnotationHostCapability extends AnnotationCapability {
210
211
  * engine picture is drawn under. `null` for one that isn't a free text here.
211
212
  */
212
213
  getTextItem(ref: AnnotationRef, view?: ViewEnv): TextItem | null;
213
- listChromeNodes(page: PageRef, scale?: number, rotation?: PageRotation, zoom?: number): ChromeNode[];
214
+ listChromeNodes(page: PageRef, scale?: number, rotation?: Rotation, zoom?: number): ChromeNode[];
214
215
  listLinkItems(page: PageRef): LinkNavItem[];
215
216
  /**
216
217
  * What a page's pictures depend on: its baked records at their picture
@@ -231,11 +232,14 @@ interface AnnotationHostCapability extends AnnotationCapability {
231
232
  */
232
233
  whenSynced(): Promise<void>;
233
234
  getEditingId(): Id | null;
234
- beginTextEditAt(page: PageRef, point: Point, scale?: number, rotation?: PageRotation, zoom?: number): boolean;
235
+ beginTextEditAt(page: PageRef, point: Point, scale?: number, rotation?: Rotation, zoom?: number): boolean;
235
236
  draftContents(ref: AnnotationRef, text: string): void;
237
+ /** Returns the paragraphs it keeps: the text typed at the caret takes a style chosen there. */
236
238
  draftRichText(ref: AnnotationRef, doc: {
237
239
  paragraphs: RichTextParagraph[];
238
- }): void;
240
+ }): {
241
+ paragraphs: RichTextParagraph[];
242
+ };
239
243
  setTextSelection(ref: AnnotationRef, range: {
240
244
  start: number;
241
245
  end: number;
@@ -252,24 +256,24 @@ interface AnnotationHostCapability extends AnnotationCapability {
252
256
  }, id: string | null): string;
253
257
  /** The family a CSS family a text box was drawn with stands for, for text the browser drew itself. */
254
258
  getFamilyOfCss(cssFamily: string): string | undefined;
255
- getHitKind(page: PageRef, point: Point, scale?: number, rotation?: PageRotation, zoom?: number, touch?: boolean): 'handle' | 'rotate' | 'group-handle' | 'annot' | 'empty';
256
- claimsTouchAt(page: PageRef, point: Point, scale?: number, rotation?: PageRotation, zoom?: number): boolean;
257
- getCursorAt(page: PageRef, point: Point, scale?: number, rotation?: PageRotation, zoom?: number): string | null;
259
+ getHitKind(page: PageRef, point: Point, scale?: number, rotation?: Rotation, zoom?: number, touch?: boolean): 'handle' | 'rotate' | 'group-handle' | 'annot' | 'empty';
260
+ claimsTouchAt(page: PageRef, point: Point, scale?: number, rotation?: Rotation, zoom?: number): boolean;
261
+ getCursorAt(page: PageRef, point: Point, scale?: number, rotation?: Rotation, zoom?: number): string | null;
258
262
  hoverAt(at: {
259
263
  page: PageRef;
260
264
  point: Point;
261
265
  scale?: number;
262
- rotation?: PageRotation;
266
+ rotation?: Rotation;
263
267
  zoom?: number;
264
268
  } | null): void;
265
- editPointer(phase: 'down' | 'move' | 'up', page: PageRef, point: Point, shift: boolean, scale?: number, rotation?: PageRotation, zoom?: number, touch?: boolean): void;
266
- marqueePointer(phase: 'down' | 'move' | 'up', page: PageRef, point: Point, shift: boolean, scale?: number, rotation?: PageRotation, zoom?: number): void;
267
- createPointer(tool: string, phase: 'down' | 'move' | 'up', page: PageRef, point: Point, finish?: boolean, displayRotation?: PageRotation): void;
269
+ editPointer(phase: 'down' | 'move' | 'up', page: PageRef, point: Point, shift: boolean, scale?: number, rotation?: Rotation, zoom?: number, touch?: boolean): void;
270
+ marqueePointer(phase: 'down' | 'move' | 'up', page: PageRef, point: Point, shift: boolean, scale?: number, rotation?: Rotation, zoom?: number): void;
271
+ createPointer(tool: string, phase: 'down' | 'move' | 'up', page: PageRef, point: Point, finish?: boolean, displayRotation?: Rotation): void;
268
272
  finishInkDraft(): void;
269
273
  /** Place with the active tool at a click; `displayRotation` and `zoom` are the page's view there. */
270
- placeAt(page: PageRef, point: Point, displayRotation?: PageRotation, zoom?: number): boolean;
271
- placeArmedStamp(page: PageRef, point: Point, displayRotation?: PageRotation): boolean;
272
- requestStampAt(page: PageRef, point: Point, displayRotation?: PageRotation): boolean;
274
+ placeAt(page: PageRef, point: Point, displayRotation?: Rotation, zoom?: number): boolean;
275
+ placeArmedStamp(page: PageRef, point: Point, displayRotation?: Rotation): boolean;
276
+ requestStampAt(page: PageRef, point: Point, displayRotation?: Rotation): boolean;
273
277
  /**
274
278
  * Turn the text selection into what the tool makes of it (markup, a caret,
275
279
  * a replace-text pair) and clear the selection; `false`, and nothing, for a
@@ -288,7 +292,7 @@ interface AnnotationHostCapability extends AnnotationCapability {
288
292
  * would take the click calls it, only where the click would reach it and
289
293
  * the user may create; a tool without a ghost clears it.
290
294
  */
291
- hoverGhostAt(toolId: string, page: PageRef, point: Point, displayRotation?: PageRotation, zoom?: number): void;
295
+ hoverGhostAt(toolId: string, page: PageRef, point: Point, displayRotation?: Rotation, zoom?: number): void;
292
296
  clearGhost(): void;
293
297
  /**
294
298
  * A sibling plugin's placement gesture with one of this plugin's tools (the
@@ -317,7 +321,7 @@ interface AnnotationHostCapability extends AnnotationCapability {
317
321
  /** The engaged behavior that owns this annotation now, or `null`. */
318
322
  getBehaviorFor(annotation: Annotation$1): Behavior | null;
319
323
  pruneEngagedSelection(): void;
320
- commitScriptEffects(entries: AnnotCommitEntry[]): Promise<AnnotCommitResult>;
324
+ commitScriptEffects(entries: AnnotationCommitEntry[]): Promise<AnnotationCommitResult>;
321
325
  }
322
326
  /**
323
327
  * The annotation capability token, typed to the full
@@ -328,4 +332,4 @@ interface AnnotationHostCapability extends AnnotationCapability {
328
332
  declare const AnnotationToken: import("@embedpdf/core").CapabilityToken<AnnotationHostCapability>;
329
333
  //#endregion
330
334
  export { CapturedAnnotationDraft as a, ANNOTATION_DRAW_PRIORITY as c, ANNOTATION_PLACE_PRIORITY as d, AnnotationModel as f, AnnotationToken as i, ANNOTATION_EDIT_PRIORITY as l, AnnotationHostCapability as n, RecalibrationReport as o, AnnotationLender as r, previewBucket as s, AnnotationAppearancePicture as t, ANNOTATION_MARQUEE_PRIORITY as u };
331
- //# sourceMappingURL=host-contract-BUub1Un-.d.ts.map
335
+ //# sourceMappingURL=host-contract-CxOrR_pp.d.cts.map