@reekon-tools/boldr-utils 1.9.1 → 1.9.3

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.
@@ -24,6 +24,7 @@ export interface UseAnnotationCanvasDocResult {
24
24
  error: Error | null;
25
25
  saveStatus: SaveStatus;
26
26
  save: () => Promise<void>;
27
+ refreshThumbnail: () => Promise<void>;
27
28
  ensureFileId: () => Promise<string>;
28
29
  setBackgroundImage: (blob: ImageBlob, dims: {
29
30
  width: number;
@@ -322,6 +322,16 @@ export const useAnnotationCanvasDoc = (options) => {
322
322
  await flush();
323
323
  await thumbnailPromiseRef.current;
324
324
  }, [flush]);
325
+ // Thumbnail-only refresh (see UseAnnotationCanvasDocResult.refreshThumbnail).
326
+ // Deliberately does NOT touch saveStatus: the canvas document is unchanged,
327
+ // so marking it dirty would both write an identical canvas and raise the
328
+ // unsaved-changes prompt for an edit the user already committed elsewhere.
329
+ const refreshThumbnail = useCallback(async () => {
330
+ const id = fileIdRef.current ?? createdIdRef.current;
331
+ if (!id)
332
+ return;
333
+ await saveThumbnail(id);
334
+ }, [saveThumbnail]);
325
335
  const ensureFileId = useCallback(async () => {
326
336
  const existing = fileIdRef.current ?? createdIdRef.current;
327
337
  if (existing)
@@ -402,6 +412,7 @@ export const useAnnotationCanvasDoc = (options) => {
402
412
  error,
403
413
  saveStatus,
404
414
  save,
415
+ refreshThumbnail,
405
416
  ensureFileId,
406
417
  setBackgroundImage,
407
418
  clearBackgroundImage,
@@ -165,6 +165,7 @@ interface FileUploadBase {
165
165
  lastName?: string;
166
166
  };
167
167
  createdAt?: Date;
168
+ lastModified?: number;
168
169
  }
169
170
  export type FileUpload = FileUploadBase & ({
170
171
  type: FileUploadType.Annotation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reekon-tools/boldr-utils",
3
- "version": "1.9.1",
3
+ "version": "1.9.3",
4
4
  "description": "Shared utilities for formulas and measurement conversion used in Reekon apps",
5
5
  "author": "REEKON Tools",
6
6
  "license": "MIT",