@athenaintel/react 0.10.39 → 0.10.40

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
@@ -193,8 +193,9 @@ When `onCitationClick` is provided, citation navigation is delegated to the host
193
193
  `onCitationAction` handles actions initiated from a citation popover. It currently receives `action: 'open-in-spaces'` when the user clicks the (+) button. Providing the handler delegates that action to the host by default. Set `citationActionBehavior="browser"` to observe the event while preserving Athena's default navigation; requesting host mode without a handler safely falls back to browser behavior.
194
194
 
195
195
  Pass the callback's complete `reference` to the linked `AthenaAssetEmbed`, rather than storing only
196
- `reference.id`. The embed uses the reference anchor to navigate PDFs to the cited page. Updating the
197
- reference also navigates when the host opens another citation in the same asset.
196
+ `reference.id`. The embed uses the reference anchor to navigate PDFs to the cited page and highlight
197
+ the cited excerpt or rectangular region. Updating the reference also navigates when the host opens
198
+ another citation in the same asset.
198
199
 
199
200
  If the host starts with an Athena citation URL/string instead of an
200
201
  `onCitationAction` event, parse it and pass the returned `reference` directly to the embed:
@@ -226,8 +227,10 @@ For example, this citation opens the PDF directly at page 34:
226
227
  https://app.athenaintel.com/dashboard/spaces/?asset_ids=asset_pdf&anchor=page&page=34&excerpt=Term%20debt
227
228
  ```
228
229
 
229
- The important query parameters are `asset_ids`, `anchor=page`, and `page`. Page ranges and
230
- positioned citations are also preserved by `parseAthenaCitationLink`.
230
+ The important query parameters are `asset_ids`, `anchor=page`, `page`, and `excerpt`. Page ranges,
231
+ text anchors, and positioned citations are also preserved by `parseAthenaCitationLink`. A
232
+ `page_rect` may include `unit=percent` (the default) or `unit=point`; retain the unit so the region
233
+ maps to the correct PDF coordinates.
231
234
 
232
235
  ## Theming
233
236
 
package/dist/index.cjs CHANGED
@@ -47552,7 +47552,16 @@ const parseCitationReference = ({
47552
47552
  const width = getFiniteNumber(url, "width");
47553
47553
  const height = getFiniteNumber(url, "height");
47554
47554
  if (page !== null && x !== null && y !== null && width !== null && height !== null) {
47555
- reference2.anchor = { type: anchorType, page, x, y, width, height };
47555
+ const unit = url.searchParams.get("unit");
47556
+ reference2.anchor = {
47557
+ type: anchorType,
47558
+ page,
47559
+ x,
47560
+ y,
47561
+ width,
47562
+ height,
47563
+ ...unit === "percent" || unit === "point" ? { unit } : {}
47564
+ };
47556
47565
  }
47557
47566
  break;
47558
47567
  }
@@ -56501,6 +56510,9 @@ function appendCitationReferenceParams({
56501
56510
  key: "height",
56502
56511
  value: "height" in anchor ? anchor.height : void 0
56503
56512
  });
56513
+ if ("unit" in anchor && (anchor.unit === "percent" || anchor.unit === "point")) {
56514
+ params.set("unit", anchor.unit);
56515
+ }
56504
56516
  break;
56505
56517
  case "page_text":
56506
56518
  params.set("anchor", anchor.type);