@cervio/plugin-sdk 2.1.0 → 2.1.2

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
@@ -98,8 +98,10 @@ by everyone reads records with `listViewRecords` and counts them with
98
98
  - `me()` and `listEntities()` are answered from the boot payload when the manifest
99
99
  declares `GET /api/v1/me` / `GET /api/v1/entities` in `cervio_apis`: no round trip.
100
100
  - Declare the calls your plugin makes at start in the manifest `boot_requests`
101
- (same path + query as the code, e.g. `/api/v1/views/<view id>/records?limit=50`):
102
- Cervio starts them while the plugin loads and your call gets the response at once.
101
+ (same path + query as the code): Cervio starts them while the plugin loads and your
102
+ call gets the response at once. A view id from the settings goes in as
103
+ `{settings.<key>}`: `/api/v1/views/{settings.view_id}/records?limit=50` (the key must
104
+ be one of the manifest `settings`; Cervio fills it in per organization).
103
105
  - Call `markReady()` once the first data is on screen:
104
106
 
105
107
  ```ts
package/dist/pdf/index.js CHANGED
@@ -236,13 +236,18 @@ function PdfViewer({ url, activePage, onPageChange, renderPageOverlay, locale =
236
236
  setPageSize({ width: viewport.width, height: viewport.height });
237
237
  const canvas = canvasRef.current;
238
238
  if (!canvas) return;
239
- canvas.width = viewport.width;
240
- canvas.height = viewport.height;
239
+ const dpr = typeof window !== "undefined" ? Math.min(window.devicePixelRatio || 1, 3) : 1;
240
+ canvas.width = Math.floor(viewport.width * dpr);
241
+ canvas.height = Math.floor(viewport.height * dpr);
241
242
  canvas.style.width = `${viewport.width}px`;
242
243
  canvas.style.height = `${viewport.height}px`;
243
244
  const ctx = canvas.getContext("2d");
244
245
  if (!ctx) return;
245
- await p.render({ canvasContext: ctx, viewport }).promise;
246
+ await p.render({
247
+ canvasContext: ctx,
248
+ viewport,
249
+ ...dpr !== 1 ? { transform: [dpr, 0, 0, dpr, 0, 0] } : {}
250
+ }).promise;
246
251
  if (cancelled) return;
247
252
  textLayerInstanceRef.current?.cancel();
248
253
  const textLayerDiv = textLayerRef.current;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cervio/plugin-sdk",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
4
4
  "description": "SDK for Cervio plugins: CervioUI client, plugin context, /api/v1 client, theme sync, i18n, PDF viewer (./pdf) and write-gate helpers (./policy).",
5
5
  "keywords": [
6
6
  "cervio",
@@ -63,7 +63,7 @@
63
63
  "tsup": "^9.0.0",
64
64
  "typescript": "^5.8.3",
65
65
  "vitest": "^5.0.5",
66
- "@cervio/plugin-core": "^1.0.1"
66
+ "@cervio/plugin-core": "^1.3.1"
67
67
  },
68
68
  "publishConfig": {
69
69
  "access": "public"