@semiont/react-ui 0.2.31 → 0.2.32-build.69

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/dist/index.mjs CHANGED
@@ -26945,9 +26945,10 @@ function CodeMirrorRenderer({
26945
26945
  const target = event.target;
26946
26946
  const annotationElement = target.closest("[data-annotation-id]");
26947
26947
  const annotationId = annotationElement?.getAttribute("data-annotation-id");
26948
- const lastHovered = view2.dom.__lastHoveredAnnotation;
26948
+ const enrichedDom = view2.dom;
26949
+ const lastHovered = enrichedDom.__lastHoveredAnnotation;
26949
26950
  if (annotationId !== lastHovered) {
26950
- view2.dom.__lastHoveredAnnotation = annotationId || null;
26951
+ enrichedDom.__lastHoveredAnnotation = annotationId || null;
26951
26952
  if (callbacksRef.current.onAnnotationHover) {
26952
26953
  callbacksRef.current.onAnnotationHover(annotationId || null);
26953
26954
  }
@@ -27151,17 +27152,20 @@ function DetectionProgressWidget({ progress, onCancel, annotationType = "referen
27151
27152
  }
27152
27153
  )
27153
27154
  ] }),
27154
- progress.requestParams && progress.requestParams.length > 0 && /* @__PURE__ */ jsxs2("div", { className: "semiont-detection-progress__params", children: [
27155
- /* @__PURE__ */ jsx8("div", { className: "semiont-detection-progress__params-title", children: "Request Parameters:" }),
27156
- progress.requestParams.map((param, idx) => /* @__PURE__ */ jsxs2("div", { className: "semiont-detection-progress__param", children: [
27157
- /* @__PURE__ */ jsxs2("span", { className: "semiont-detection-progress__param-label", children: [
27158
- param.label,
27159
- ":"
27160
- ] }),
27161
- " ",
27162
- param.value
27163
- ] }, idx))
27164
- ] }),
27155
+ (() => {
27156
+ const enrichedProgress = progress;
27157
+ return enrichedProgress.requestParams && enrichedProgress.requestParams.length > 0 && /* @__PURE__ */ jsxs2("div", { className: "semiont-detection-progress__params", children: [
27158
+ /* @__PURE__ */ jsx8("div", { className: "semiont-detection-progress__params-title", children: "Request Parameters:" }),
27159
+ enrichedProgress.requestParams.map((param, idx) => /* @__PURE__ */ jsxs2("div", { className: "semiont-detection-progress__param", children: [
27160
+ /* @__PURE__ */ jsxs2("span", { className: "semiont-detection-progress__param-label", children: [
27161
+ param.label,
27162
+ ":"
27163
+ ] }),
27164
+ " ",
27165
+ param.value
27166
+ ] }, idx))
27167
+ ] });
27168
+ })(),
27165
27169
  progress.completedEntityTypes && progress.completedEntityTypes.length > 0 && /* @__PURE__ */ jsx8("div", { className: "semiont-detection-log", children: progress.completedEntityTypes.map((item, index2) => /* @__PURE__ */ jsxs2("div", { className: "semiont-detection-log-item", children: [
27166
27170
  /* @__PURE__ */ jsx8("span", { className: "semiont-detection-check", children: "\u2713" }),
27167
27171
  /* @__PURE__ */ jsxs2("span", { className: "semiont-detection-entity-type", children: [
@@ -46202,13 +46206,16 @@ function formatRelativeTime2(isoString) {
46202
46206
  if (diffDays < 7) return `${diffDays} day${diffDays > 1 ? "s" : ""} ago`;
46203
46207
  return date.toLocaleDateString();
46204
46208
  }
46209
+ function isTextualBody(body) {
46210
+ return typeof body === "object" && body !== null && "type" in body && body.type === "TextualBody" && "value" in body && typeof body.value === "string";
46211
+ }
46205
46212
  function getAssessmentText(annotation) {
46206
46213
  if (!annotation.body) return null;
46207
- if (typeof annotation.body === "object" && "value" in annotation.body && "type" in annotation.body && annotation.body.type === "TextualBody") {
46214
+ if (isTextualBody(annotation.body)) {
46208
46215
  return annotation.body.value || null;
46209
46216
  }
46210
46217
  if (Array.isArray(annotation.body) && annotation.body.length > 0) {
46211
- const textBody = annotation.body.find((b8) => b8.type === "TextualBody");
46218
+ const textBody = annotation.body.find(isTextualBody);
46212
46219
  return textBody?.value || null;
46213
46220
  }
46214
46221
  return null;
@@ -47023,8 +47030,9 @@ function ReferenceEntry({
47023
47030
  const isResolved = isBodyResolved3(reference.body);
47024
47031
  const resolvedResourceUri = isResolved ? getBodySource5(reference.body) : null;
47025
47032
  const entityTypes = getEntityTypes(reference);
47026
- const resolvedDocumentName = reference._resolvedDocumentName;
47027
- const resolvedDocumentMediaType = reference._resolvedDocumentMediaType;
47033
+ const enrichedReference = reference;
47034
+ const resolvedDocumentName = enrichedReference._resolvedDocumentName;
47035
+ const resolvedDocumentMediaType = enrichedReference._resolvedDocumentMediaType;
47028
47036
  const resourceIcon = getResourceIcon(resolvedDocumentMediaType);
47029
47037
  const handleOpen = () => {
47030
47038
  if (resolvedResourceUri) {