@semiont/react-ui 0.4.3 → 0.4.5

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 (144) hide show
  1. package/dist/{ar-5REA6P4J.mjs → ar-RJLR7NDD.mjs} +13 -11
  2. package/dist/ar-RJLR7NDD.mjs.map +1 -0
  3. package/dist/{bn-YHRYHHPD.mjs → bn-4NU2UAZ7.mjs} +13 -11
  4. package/dist/bn-4NU2UAZ7.mjs.map +1 -0
  5. package/dist/{chunk-VVCCMJS7.mjs → chunk-2VWLGQIO.mjs} +13 -11
  6. package/dist/chunk-2VWLGQIO.mjs.map +1 -0
  7. package/dist/{chunk-F74ZQJMA.mjs → chunk-EKQMINCV.mjs} +31 -31
  8. package/dist/{cs-JTJXTX2T.mjs → cs-6UJZFF55.mjs} +13 -11
  9. package/dist/cs-6UJZFF55.mjs.map +1 -0
  10. package/dist/{da-MK37SJB6.mjs → da-CFFBBOH3.mjs} +13 -11
  11. package/dist/da-CFFBBOH3.mjs.map +1 -0
  12. package/dist/{de-LGBCWERA.mjs → de-2KAG6KMX.mjs} +13 -11
  13. package/dist/de-2KAG6KMX.mjs.map +1 -0
  14. package/dist/{el-FKJMFCWY.mjs → el-KVPQ7VNF.mjs} +13 -11
  15. package/dist/el-KVPQ7VNF.mjs.map +1 -0
  16. package/dist/{en-AOSMPC2M.mjs → en-ZW4UKTVX.mjs} +2 -2
  17. package/dist/{es-LVDPIXWU.mjs → es-ZU2ECPVG.mjs} +13 -11
  18. package/dist/es-ZU2ECPVG.mjs.map +1 -0
  19. package/dist/{fa-3VA2PIUD.mjs → fa-CBIVKDIQ.mjs} +13 -11
  20. package/dist/fa-CBIVKDIQ.mjs.map +1 -0
  21. package/dist/{fi-3WM75ZLR.mjs → fi-5HUVT7IK.mjs} +13 -11
  22. package/dist/fi-5HUVT7IK.mjs.map +1 -0
  23. package/dist/{fr-NK4A72WA.mjs → fr-O5WU2US2.mjs} +13 -11
  24. package/dist/fr-O5WU2US2.mjs.map +1 -0
  25. package/dist/{he-IACZDZMB.mjs → he-WP4C2SNJ.mjs} +13 -11
  26. package/dist/he-WP4C2SNJ.mjs.map +1 -0
  27. package/dist/{hi-JZ7MGMMS.mjs → hi-HLQXNRWI.mjs} +13 -11
  28. package/dist/hi-HLQXNRWI.mjs.map +1 -0
  29. package/dist/{id-P3KDQGNK.mjs → id-DTJT2ZA6.mjs} +13 -11
  30. package/dist/id-DTJT2ZA6.mjs.map +1 -0
  31. package/dist/index.css +213 -0
  32. package/dist/index.css.map +1 -1
  33. package/dist/index.d.mts +23 -41
  34. package/dist/index.mjs +377 -350
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/{it-LQS33SUY.mjs → it-2DK57IMT.mjs} +13 -11
  37. package/dist/it-2DK57IMT.mjs.map +1 -0
  38. package/dist/{ja-G4FKZPWD.mjs → ja-52ZNY72Y.mjs} +13 -11
  39. package/dist/ja-52ZNY72Y.mjs.map +1 -0
  40. package/dist/{ko-2XWKQ7BA.mjs → ko-4Z2IMYZO.mjs} +13 -11
  41. package/dist/ko-4Z2IMYZO.mjs.map +1 -0
  42. package/dist/{ms-2SNONIUD.mjs → ms-HKU73KEX.mjs} +13 -11
  43. package/dist/ms-HKU73KEX.mjs.map +1 -0
  44. package/dist/{nl-BMZUAJ7J.mjs → nl-HPHQMXPT.mjs} +13 -11
  45. package/dist/nl-HPHQMXPT.mjs.map +1 -0
  46. package/dist/{no-6J3WIZ6L.mjs → no-Q7G4PVFT.mjs} +13 -11
  47. package/dist/no-Q7G4PVFT.mjs.map +1 -0
  48. package/dist/{pl-QQ7DAUVK.mjs → pl-D43C2CE3.mjs} +13 -11
  49. package/dist/pl-D43C2CE3.mjs.map +1 -0
  50. package/dist/{pt-MU3GN7MW.mjs → pt-V3GFSY7B.mjs} +13 -11
  51. package/dist/pt-V3GFSY7B.mjs.map +1 -0
  52. package/dist/{ro-6GBE72QK.mjs → ro-3UIRV3OA.mjs} +13 -11
  53. package/dist/ro-3UIRV3OA.mjs.map +1 -0
  54. package/dist/{sv-NQIL7PEM.mjs → sv-BMW26A7M.mjs} +13 -11
  55. package/dist/sv-BMW26A7M.mjs.map +1 -0
  56. package/dist/test-utils.mjs +2 -2
  57. package/dist/{th-6OCNZQBE.mjs → th-CMND2QET.mjs} +13 -11
  58. package/dist/th-CMND2QET.mjs.map +1 -0
  59. package/dist/{tr-XWJ5P3SC.mjs → tr-P3AD7MYA.mjs} +13 -11
  60. package/dist/tr-P3AD7MYA.mjs.map +1 -0
  61. package/dist/{uk-AKSN6DGW.mjs → uk-QPONRQ5O.mjs} +13 -11
  62. package/dist/uk-QPONRQ5O.mjs.map +1 -0
  63. package/dist/{vi-23GHQ45M.mjs → vi-G2OMVMCI.mjs} +13 -11
  64. package/dist/vi-G2OMVMCI.mjs.map +1 -0
  65. package/dist/{zh-ITT4QBSN.mjs → zh-HTDN4LKE.mjs} +13 -11
  66. package/dist/zh-HTDN4LKE.mjs.map +1 -0
  67. package/package.json +1 -1
  68. package/src/components/CodeMirrorRenderer.tsx +9 -9
  69. package/src/components/ResourceTagsInline.tsx +1 -1
  70. package/src/components/__tests__/ResourceTagsInline.test.tsx +3 -3
  71. package/src/components/modals/ContextSummary.tsx +56 -165
  72. package/src/components/modals/GatherContextStep.tsx +124 -42
  73. package/src/components/modals/ReferenceWizardModal.tsx +8 -25
  74. package/src/components/modals/SearchModal.css +241 -0
  75. package/src/components/resource/AnnotateView.tsx +3 -3
  76. package/src/components/resource/ResourceViewer.tsx +4 -4
  77. package/src/components/resource/__tests__/annotation-interactions.test.tsx +1 -1
  78. package/src/components/resource/panels/AssessmentPanel.tsx +3 -0
  79. package/src/components/resource/panels/AssistSection.tsx +4 -1
  80. package/src/components/resource/panels/CommentsPanel.tsx +3 -0
  81. package/src/components/resource/panels/ResourceInfoPanel.tsx +82 -0
  82. package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +4 -0
  83. package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +94 -0
  84. package/src/features/resource-viewer/components/ResourceViewerPage.tsx +12 -10
  85. package/translations/ar.json +12 -10
  86. package/translations/bn.json +12 -10
  87. package/translations/cs.json +12 -10
  88. package/translations/da.json +12 -10
  89. package/translations/de.json +12 -10
  90. package/translations/el.json +12 -10
  91. package/translations/en.json +13 -11
  92. package/translations/es.json +12 -10
  93. package/translations/fa.json +12 -10
  94. package/translations/fi.json +12 -10
  95. package/translations/fr.json +12 -10
  96. package/translations/he.json +12 -10
  97. package/translations/hi.json +12 -10
  98. package/translations/id.json +12 -10
  99. package/translations/it.json +12 -10
  100. package/translations/ja.json +12 -10
  101. package/translations/ko.json +12 -10
  102. package/translations/ms.json +12 -10
  103. package/translations/nl.json +12 -10
  104. package/translations/no.json +12 -10
  105. package/translations/pl.json +12 -10
  106. package/translations/pt.json +12 -10
  107. package/translations/ro.json +12 -10
  108. package/translations/sv.json +12 -10
  109. package/translations/th.json +12 -10
  110. package/translations/tr.json +12 -10
  111. package/translations/uk.json +12 -10
  112. package/translations/vi.json +12 -10
  113. package/translations/zh.json +12 -10
  114. package/dist/ar-5REA6P4J.mjs.map +0 -1
  115. package/dist/bn-YHRYHHPD.mjs.map +0 -1
  116. package/dist/chunk-VVCCMJS7.mjs.map +0 -1
  117. package/dist/cs-JTJXTX2T.mjs.map +0 -1
  118. package/dist/da-MK37SJB6.mjs.map +0 -1
  119. package/dist/de-LGBCWERA.mjs.map +0 -1
  120. package/dist/el-FKJMFCWY.mjs.map +0 -1
  121. package/dist/es-LVDPIXWU.mjs.map +0 -1
  122. package/dist/fa-3VA2PIUD.mjs.map +0 -1
  123. package/dist/fi-3WM75ZLR.mjs.map +0 -1
  124. package/dist/fr-NK4A72WA.mjs.map +0 -1
  125. package/dist/he-IACZDZMB.mjs.map +0 -1
  126. package/dist/hi-JZ7MGMMS.mjs.map +0 -1
  127. package/dist/id-P3KDQGNK.mjs.map +0 -1
  128. package/dist/it-LQS33SUY.mjs.map +0 -1
  129. package/dist/ja-G4FKZPWD.mjs.map +0 -1
  130. package/dist/ko-2XWKQ7BA.mjs.map +0 -1
  131. package/dist/ms-2SNONIUD.mjs.map +0 -1
  132. package/dist/nl-BMZUAJ7J.mjs.map +0 -1
  133. package/dist/no-6J3WIZ6L.mjs.map +0 -1
  134. package/dist/pl-QQ7DAUVK.mjs.map +0 -1
  135. package/dist/pt-MU3GN7MW.mjs.map +0 -1
  136. package/dist/ro-6GBE72QK.mjs.map +0 -1
  137. package/dist/sv-NQIL7PEM.mjs.map +0 -1
  138. package/dist/th-6OCNZQBE.mjs.map +0 -1
  139. package/dist/tr-XWJ5P3SC.mjs.map +0 -1
  140. package/dist/uk-AKSN6DGW.mjs.map +0 -1
  141. package/dist/vi-23GHQ45M.mjs.map +0 -1
  142. package/dist/zh-ITT4QBSN.mjs.map +0 -1
  143. /package/dist/{chunk-F74ZQJMA.mjs.map → chunk-EKQMINCV.mjs.map} +0 -0
  144. /package/dist/{en-AOSMPC2M.mjs.map → en-ZW4UKTVX.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  useSessionContext,
23
23
  useToast,
24
24
  useTranslations
25
- } from "./chunk-F74ZQJMA.mjs";
25
+ } from "./chunk-EKQMINCV.mjs";
26
26
  import {
27
27
  ApiClientProvider,
28
28
  EventBusProvider,
@@ -30,7 +30,7 @@ import {
30
30
  useApiClient,
31
31
  useEventBus
32
32
  } from "./chunk-5JZFKRLW.mjs";
33
- import "./chunk-VVCCMJS7.mjs";
33
+ import "./chunk-2VWLGQIO.mjs";
34
34
  import {
35
35
  __commonJS,
36
36
  __export,
@@ -564,8 +564,7 @@ var QUERY_KEYS = {
564
564
  },
565
565
  annotations: {
566
566
  detail: (id2) => ["annotations", id2],
567
- history: (resourceId2, annotationId4) => ["annotations", resourceId2, annotationId4, "history"],
568
- llmContext: (resourceId2, annotationId4) => ["annotations", "llm-context", resourceId2, annotationId4]
567
+ history: (resourceId2, annotationId4) => ["annotations", resourceId2, annotationId4, "history"]
569
568
  },
570
569
  entityTypes: {
571
570
  all: () => ["entity-types"]
@@ -814,15 +813,6 @@ function useAnnotations() {
814
813
  }
815
814
  });
816
815
  }
817
- },
818
- llmContext: {
819
- useQuery: (resourceId2, annotationId4, options) => useQuery({
820
- queryKey: QUERY_KEYS.annotations.llmContext(resourceId2, annotationId4),
821
- queryFn: () => client.gatherAnnotation(resourceId2, annotationId4, { ...options, auth: toAccessToken(token) }),
822
- enabled: !!client && !!resourceId2 && !!annotationId4,
823
- staleTime: 5 * 60 * 1e3
824
- // 5 minutes - context doesn't change often
825
- })
826
816
  }
827
817
  };
828
818
  }
@@ -26500,11 +26490,11 @@ function computeAnnotationDecorations(segments, newAnnotationIds) {
26500
26490
  };
26501
26491
  });
26502
26492
  }
26503
- function computeWidgetDecorations(segments, generatingReferenceId, getTargetDocumentName) {
26493
+ function computeWidgetDecorations(segments, generatingReferenceId, getTargetResourceName) {
26504
26494
  return segments.filter((s11) => s11.annotation && isReference2(s11.annotation)).sort((a15, b8) => a15.end - b8.end).map((segment) => {
26505
26495
  const annotation = segment.annotation;
26506
26496
  const bodySource = getBodySource3(annotation.body);
26507
- const targetName = bodySource ? getTargetDocumentName?.(bodySource) : void 0;
26497
+ const targetName = bodySource ? getTargetResourceName?.(bodySource) : void 0;
26508
26498
  const isGenerating = generatingReferenceId ? annotation.id === generatingReferenceId : false;
26509
26499
  return {
26510
26500
  annotationId: annotation.id,
@@ -26542,7 +26532,7 @@ function handleWidgetClick(target) {
26542
26532
  return {
26543
26533
  handled: true,
26544
26534
  action: "navigate",
26545
- documentId: bodySource,
26535
+ resourceId: bodySource,
26546
26536
  annotationId: annotationId4
26547
26537
  };
26548
26538
  }
@@ -26555,8 +26545,8 @@ function handleWidgetClick(target) {
26555
26545
  }
26556
26546
  function dispatchWidgetClick(result, eventBus) {
26557
26547
  if (!result.handled) return;
26558
- if (result.action === "navigate" && result.documentId) {
26559
- eventBus.get("browse:reference-navigate").next({ documentId: result.documentId });
26548
+ if (result.action === "navigate" && result.resourceId) {
26549
+ eventBus.get("browse:reference-navigate").next({ resourceId: result.resourceId });
26560
26550
  } else if (result.action === "browse-click" && result.annotationId) {
26561
26551
  eventBus.get("browse:click").next({
26562
26552
  annotationId: result.annotationId,
@@ -26630,9 +26620,9 @@ function createAnnotationDecorationsField() {
26630
26620
  provide: (field) => EditorView.decorations.from(field)
26631
26621
  });
26632
26622
  }
26633
- function buildWidgetDecorations(_content, segments, generatingReferenceId, getTargetDocumentName) {
26623
+ function buildWidgetDecorations(_content, segments, generatingReferenceId, getTargetResourceName) {
26634
26624
  const builder = new RangeSetBuilder();
26635
- const widgetMetas = computeWidgetDecorations(segments, generatingReferenceId, getTargetDocumentName);
26625
+ const widgetMetas = computeWidgetDecorations(segments, generatingReferenceId, getTargetResourceName);
26636
26626
  const annotationsByEnd = /* @__PURE__ */ new Map();
26637
26627
  for (const s11 of segments) {
26638
26628
  if (s11.annotation && isReference3(s11.annotation)) {
@@ -26663,7 +26653,7 @@ var widgetDecorationsField = StateField.define({
26663
26653
  effect.value.content,
26664
26654
  effect.value.segments,
26665
26655
  effect.value.generatingReferenceId,
26666
- effect.value.getTargetDocumentName
26656
+ effect.value.getTargetResourceName
26667
26657
  );
26668
26658
  }
26669
26659
  }
@@ -26683,7 +26673,7 @@ function CodeMirrorRenderer({
26683
26673
  showLineNumbers = false,
26684
26674
  enableWidgets = false,
26685
26675
  eventBus,
26686
- getTargetDocumentName,
26676
+ getTargetResourceName,
26687
26677
  generatingReferenceId,
26688
26678
  hoverDelayMs
26689
26679
  }) {
@@ -26695,7 +26685,7 @@ function CodeMirrorRenderer({
26695
26685
  const segmentsByIdRef = useRef8(/* @__PURE__ */ new Map());
26696
26686
  const lineNumbersCompartment = useRef8(new Compartment());
26697
26687
  const eventBusRef = useRef8(eventBus);
26698
- const getTargetDocumentNameRef = useRef8(getTargetDocumentName);
26688
+ const getTargetResourceNameRef = useRef8(getTargetResourceName);
26699
26689
  segmentsRef.current = segments;
26700
26690
  const segmentsById = /* @__PURE__ */ new Map();
26701
26691
  for (const s11 of segments) {
@@ -26703,7 +26693,7 @@ function CodeMirrorRenderer({
26703
26693
  }
26704
26694
  segmentsByIdRef.current = segmentsById;
26705
26695
  eventBusRef.current = eventBus;
26706
- getTargetDocumentNameRef.current = getTargetDocumentName;
26696
+ getTargetResourceNameRef.current = getTargetResourceName;
26707
26697
  useEffect11(() => {
26708
26698
  if (!containerRef.current || viewRef.current) return;
26709
26699
  const annotationDecorationsField = createAnnotationDecorationsField();
@@ -26874,7 +26864,7 @@ function CodeMirrorRenderer({
26874
26864
  content: content4,
26875
26865
  segments: convertedSegments,
26876
26866
  generatingReferenceId,
26877
- getTargetDocumentName: getTargetDocumentNameRef.current
26867
+ getTargetResourceName: getTargetResourceNameRef.current
26878
26868
  })
26879
26869
  });
26880
26870
  }, [content4, convertedSegments, enableWidgets, generatingReferenceId]);
@@ -30557,7 +30547,7 @@ function AnnotateView({
30557
30547
  uiState,
30558
30548
  onUIStateChange,
30559
30549
  enableWidgets = false,
30560
- getTargetDocumentName,
30550
+ getTargetResourceName,
30561
30551
  generatingReferenceId,
30562
30552
  showLineNumbers = false,
30563
30553
  hoverDelayMs = 150,
@@ -30675,7 +30665,7 @@ function AnnotateView({
30675
30665
  hoverDelayMs,
30676
30666
  enableWidgets,
30677
30667
  eventBus,
30678
- ...getTargetDocumentName && { getTargetDocumentName },
30668
+ ...getTargetResourceName && { getTargetResourceName },
30679
30669
  ...generatingReferenceId !== void 0 && { generatingReferenceId }
30680
30670
  }
30681
30671
  ) })
@@ -46120,8 +46110,8 @@ function ResourceViewer({
46120
46110
  hoveredAnnotationId,
46121
46111
  scrollToAnnotationId
46122
46112
  };
46123
- const getTargetDocumentName = useCallback17((documentId) => {
46124
- const referencedResource = references.find((a15) => getBodySource4(a15.body) === documentId);
46113
+ const getTargetResourceName = useCallback17((resourceId2) => {
46114
+ const referencedResource = references.find((a15) => getBodySource4(a15.body) === resourceId2);
46125
46115
  return referencedResource ? getExactText3(getTargetSelector4(referencedResource.target)) : void 0;
46126
46116
  }, [references]);
46127
46117
  return /* @__PURE__ */ jsxs18("div", { ref: documentViewerRef, className: "semiont-resource-viewer", children: [
@@ -46139,7 +46129,7 @@ function ResourceViewer({
46139
46129
  if ("selectedShape" in updates) setSelectedShape(updates.selectedShape);
46140
46130
  },
46141
46131
  enableWidgets: true,
46142
- getTargetDocumentName,
46132
+ getTargetResourceName,
46143
46133
  ...generatingReferenceId !== void 0 && { generatingReferenceId },
46144
46134
  showLineNumbers,
46145
46135
  hoverDelayMs,
@@ -46312,6 +46302,7 @@ import { Fragment as Fragment5, jsx as jsx29, jsxs as jsxs20 } from "react/jsx-r
46312
46302
  function AssistSection({
46313
46303
  annotationType,
46314
46304
  isAssisting,
46305
+ locale,
46315
46306
  progress
46316
46307
  }) {
46317
46308
  const panelName = annotationType === "highlight" ? "HighlightPanel" : annotationType === "assessment" ? "AssessmentPanel" : "CommentsPanel";
@@ -46338,12 +46329,13 @@ function AssistSection({
46338
46329
  options: {
46339
46330
  instructions: instructions.trim() || void 0,
46340
46331
  tone: (annotationType === "comment" || annotationType === "assessment") && tone ? tone : void 0,
46341
- density: (annotationType === "comment" || annotationType === "assessment" || annotationType === "highlight") && useDensity ? density : void 0
46332
+ density: (annotationType === "comment" || annotationType === "assessment" || annotationType === "highlight") && useDensity ? density : void 0,
46333
+ language: annotationType === "comment" || annotationType === "assessment" ? locale : void 0
46342
46334
  }
46343
46335
  });
46344
46336
  setInstructions("");
46345
46337
  setTone("");
46346
- }, [annotationType, instructions, tone, useDensity, density]);
46338
+ }, [annotationType, instructions, tone, useDensity, density, locale]);
46347
46339
  const handleDismissProgress = useCallback18(() => {
46348
46340
  eventBus.get("mark:progress-dismiss").next(void 0);
46349
46341
  }, []);
@@ -46542,6 +46534,7 @@ function AssessmentPanel({
46542
46534
  pendingAnnotation,
46543
46535
  isAssisting = false,
46544
46536
  progress,
46537
+ locale,
46545
46538
  annotateMode = true,
46546
46539
  scrollToAnnotationId,
46547
46540
  onScrollCompleted,
@@ -46686,6 +46679,7 @@ function AssessmentPanel({
46686
46679
  {
46687
46680
  annotationType: "assessment",
46688
46681
  isAssisting,
46682
+ locale,
46689
46683
  progress
46690
46684
  }
46691
46685
  ),
@@ -46939,6 +46933,7 @@ function CommentsPanel({
46939
46933
  annotateMode = true,
46940
46934
  isAssisting = false,
46941
46935
  progress,
46936
+ locale,
46942
46937
  scrollToAnnotationId,
46943
46938
  onScrollCompleted,
46944
46939
  hoveredAnnotationId
@@ -47084,6 +47079,7 @@ function CommentsPanel({
47084
47079
  {
47085
47080
  annotationType: "comment",
47086
47081
  isAssisting,
47082
+ locale,
47087
47083
  progress
47088
47084
  }
47089
47085
  ),
@@ -47829,7 +47825,13 @@ function ResourceInfoPanel({
47829
47825
  documentLocale,
47830
47826
  primaryMediaType,
47831
47827
  primaryByteSize,
47832
- isArchived = false
47828
+ isArchived = false,
47829
+ dateCreated,
47830
+ dateModified,
47831
+ creationMethod,
47832
+ wasAttributedTo,
47833
+ wasDerivedFrom,
47834
+ generator
47833
47835
  }) {
47834
47836
  const t12 = useTranslations("ResourceInfoPanel");
47835
47837
  const eventBus = useEventBus();
@@ -47855,6 +47857,46 @@ function ResourceInfoPanel({
47855
47857
  ] })
47856
47858
  ] })
47857
47859
  ] }),
47860
+ (dateCreated || dateModified || creationMethod || wasAttributedTo || wasDerivedFrom || generator) && /* @__PURE__ */ jsxs31("div", { className: "semiont-resource-info-panel__section", children: [
47861
+ /* @__PURE__ */ jsx39("h3", { className: "semiont-resource-info-panel__heading", children: t12("provenance") }),
47862
+ /* @__PURE__ */ jsxs31("div", { className: "semiont-resource-info-panel__field-group", children: [
47863
+ dateCreated && /* @__PURE__ */ jsxs31("div", { children: [
47864
+ /* @__PURE__ */ jsx39("span", { className: "semiont-resource-info-panel__label", children: t12("createdAt") }),
47865
+ /* @__PURE__ */ jsx39("span", { className: "semiont-resource-info-panel__value", children: new Date(dateCreated).toLocaleString() })
47866
+ ] }),
47867
+ dateModified && /* @__PURE__ */ jsxs31("div", { children: [
47868
+ /* @__PURE__ */ jsx39("span", { className: "semiont-resource-info-panel__label", children: t12("modifiedAt") }),
47869
+ /* @__PURE__ */ jsx39("span", { className: "semiont-resource-info-panel__value", children: new Date(dateModified).toLocaleString() })
47870
+ ] }),
47871
+ creationMethod && /* @__PURE__ */ jsxs31("div", { children: [
47872
+ /* @__PURE__ */ jsx39("span", { className: "semiont-resource-info-panel__label", children: t12("creationMethod") }),
47873
+ /* @__PURE__ */ jsx39("span", { className: "semiont-resource-info-panel__value", children: creationMethod })
47874
+ ] }),
47875
+ wasAttributedTo && /* @__PURE__ */ jsxs31("div", { children: [
47876
+ /* @__PURE__ */ jsx39("span", { className: "semiont-resource-info-panel__label", children: t12("attributedTo") }),
47877
+ /* @__PURE__ */ jsx39("span", { className: "semiont-resource-info-panel__value", children: (Array.isArray(wasAttributedTo) ? wasAttributedTo : [wasAttributedTo]).map((a15) => a15.name).join(", ") })
47878
+ ] }),
47879
+ wasDerivedFrom && /* @__PURE__ */ jsxs31("div", { children: [
47880
+ /* @__PURE__ */ jsx39("span", { className: "semiont-resource-info-panel__label", children: t12("derivedFrom") }),
47881
+ /* @__PURE__ */ jsx39("span", { className: "semiont-resource-info-panel__value", children: (Array.isArray(wasDerivedFrom) ? wasDerivedFrom : [wasDerivedFrom]).map((id2, i12) => /* @__PURE__ */ jsxs31(
47882
+ "button",
47883
+ {
47884
+ className: "semiont-resource-info-panel__link",
47885
+ onClick: () => eventBus.get("browse:reference-navigate").next({ resourceId: id2 }),
47886
+ children: [
47887
+ i12 > 0 && ", ",
47888
+ id2
47889
+ ]
47890
+ },
47891
+ id2
47892
+ )) })
47893
+ ] }),
47894
+ generator && /* @__PURE__ */ jsxs31("div", { children: [
47895
+ /* @__PURE__ */ jsx39("span", { className: "semiont-resource-info-panel__label", children: t12("generatedBy") }),
47896
+ /* @__PURE__ */ jsx39("span", { className: "semiont-resource-info-panel__value", children: (Array.isArray(generator) ? generator : [generator]).map((a15) => a15.name).join(", ") })
47897
+ ] })
47898
+ ] })
47899
+ ] }),
47858
47900
  documentEntityTypes.length > 0 && /* @__PURE__ */ jsxs31("div", { className: "semiont-resource-info-panel__section", children: [
47859
47901
  /* @__PURE__ */ jsx39("h3", { className: "semiont-resource-info-panel__heading", children: t12("entityTypeTags") }),
47860
47902
  /* @__PURE__ */ jsx39("div", { className: "semiont-resource-info-panel__tag-list", children: documentEntityTypes.map((tag) => /* @__PURE__ */ jsx39(
@@ -48504,6 +48546,7 @@ function UnifiedAnnotationsPanel(props) {
48504
48546
  isAssisting,
48505
48547
  progress,
48506
48548
  annotateMode: props.annotateMode,
48549
+ locale: props.locale,
48507
48550
  scrollToAnnotationId: props.scrollToAnnotationId,
48508
48551
  onScrollCompleted: props.onScrollCompleted,
48509
48552
  hoveredAnnotationId: props.hoveredAnnotationId
@@ -53194,123 +53237,57 @@ function CollapsibleResourceNavigation({
53194
53237
  }
53195
53238
 
53196
53239
  // src/components/modals/ReferenceWizardModal.tsx
53197
- import { useState as useState35, useEffect as useEffect41, useCallback as useCallback31 } from "react";
53240
+ import { useState as useState36, useEffect as useEffect42, useCallback as useCallback31 } from "react";
53241
+
53242
+ // src/components/modals/GatherContextStep.tsx
53243
+ import { useState as useState33, useEffect as useEffect41, useRef as useRef32 } from "react";
53198
53244
 
53199
53245
  // src/components/modals/ContextSummary.tsx
53200
53246
  import { Fragment as Fragment11, jsx as jsx50, jsxs as jsxs41 } from "react/jsx-runtime";
53201
- function ContextSummary({ context, userHint, onUserHintChange, translations: t12 }) {
53202
- const annotation = context.annotation;
53203
- const sourceResource = context.sourceResource;
53204
- const sourceContext = context.sourceContext;
53247
+ function ContextSummary({ context, translations: t12 }) {
53205
53248
  const graphContext = context.graphContext;
53206
- const entityTypes = context.metadata?.entityTypes ?? [];
53207
53249
  const connections = graphContext?.connections ?? [];
53208
53250
  const citedBy = graphContext?.citedBy ?? [];
53209
53251
  const citedByCount = graphContext?.citedByCount ?? 0;
53210
- const siblingEntityTypes = graphContext?.siblingEntityTypes ?? [];
53211
- return /* @__PURE__ */ jsxs41(Fragment11, { children: [
53212
- /* @__PURE__ */ jsxs41("div", { className: "semiont-form__field", children: [
53213
- /* @__PURE__ */ jsx50("label", { className: "semiont-form__label", children: t12.annotationLabel }),
53214
- /* @__PURE__ */ jsxs41("div", { style: {
53215
- padding: "0.5rem 0.75rem",
53216
- backgroundColor: "var(--semiont-bg-secondary)",
53217
- borderRadius: "var(--semiont-radius-md)",
53218
- border: "1px solid var(--semiont-border-primary)",
53219
- fontSize: "var(--semiont-text-sm)",
53252
+ return /* @__PURE__ */ jsx50(Fragment11, { children: graphContext && (connections.length > 0 || citedByCount > 0) && /* @__PURE__ */ jsxs41("div", { style: { display: "flex", flexDirection: "column", gap: "1rem" }, children: [
53253
+ connections.length > 0 && /* @__PURE__ */ jsxs41("div", { children: [
53254
+ /* @__PURE__ */ jsx50("div", { style: {
53255
+ fontSize: "var(--semiont-text-xs)",
53256
+ fontWeight: 700,
53257
+ textTransform: "uppercase",
53258
+ letterSpacing: "0.06em",
53259
+ color: "var(--semiont-text-tertiary)",
53260
+ marginBottom: "0.375rem"
53261
+ }, children: t12.connectionsLabel }),
53262
+ /* @__PURE__ */ jsx50("ul", { style: { display: "flex", flexDirection: "column", gap: "0.375rem", listStyle: "none", padding: 0, margin: 0 }, children: connections.map((conn) => /* @__PURE__ */ jsxs41("li", { style: {
53220
53263
  display: "flex",
53221
- flexDirection: "column",
53222
- gap: "0.25rem"
53264
+ flexWrap: "wrap",
53265
+ alignItems: "center",
53266
+ gap: "0.375rem",
53267
+ fontSize: "var(--semiont-text-sm)"
53223
53268
  }, children: [
53224
- /* @__PURE__ */ jsxs41("div", { style: { display: "flex", gap: "0.5rem", alignItems: "center" }, children: [
53225
- /* @__PURE__ */ jsxs41("span", { style: { fontWeight: 500, color: "var(--semiont-text-secondary)" }, children: [
53226
- t12.motivationLabel,
53227
- ":"
53228
- ] }),
53229
- /* @__PURE__ */ jsx50("span", { className: "semiont-chip", style: { fontSize: "var(--semiont-text-xs)", padding: "0.125rem 0.5rem" }, children: annotation.motivation })
53230
- ] }),
53231
- /* @__PURE__ */ jsxs41("div", { style: { display: "flex", gap: "0.5rem", alignItems: "center" }, children: [
53232
- /* @__PURE__ */ jsxs41("span", { style: { fontWeight: 500, color: "var(--semiont-text-secondary)" }, children: [
53233
- t12.sourceResourceLabel,
53234
- ":"
53235
- ] }),
53236
- /* @__PURE__ */ jsx50("span", { style: { color: "var(--semiont-text-primary)" }, children: sourceResource.name })
53237
- ] })
53238
- ] })
53239
- ] }),
53240
- sourceContext && /* @__PURE__ */ jsxs41("div", { className: "semiont-form__field", children: [
53241
- /* @__PURE__ */ jsx50("label", { className: "semiont-form__label", children: t12.sourceContextLabel }),
53242
- /* @__PURE__ */ jsx50("div", { style: {
53243
- padding: "0.75rem",
53244
- backgroundColor: "var(--semiont-bg-secondary)",
53245
- borderRadius: "var(--semiont-radius-md)",
53246
- border: "1px solid var(--semiont-border-primary)",
53247
- maxHeight: "200px",
53248
- overflowY: "auto"
53249
- }, children: /* @__PURE__ */ jsxs41("div", { style: { fontSize: "var(--semiont-text-sm)", fontFamily: "monospace", whiteSpace: "pre-wrap", color: "var(--semiont-text-secondary)" }, children: [
53250
- sourceContext.before && /* @__PURE__ */ jsx50("span", { children: sourceContext.before }),
53251
- /* @__PURE__ */ jsx50("span", { style: {
53252
- backgroundColor: "var(--semiont-color-primary-100)",
53253
- padding: "0 0.25rem",
53254
- fontWeight: 600,
53255
- color: "var(--semiont-color-primary-900)"
53256
- }, children: sourceContext.selected }),
53257
- sourceContext.after && /* @__PURE__ */ jsx50("span", { children: sourceContext.after })
53258
- ] }) })
53259
- ] }),
53260
- entityTypes.length > 0 && /* @__PURE__ */ jsxs41("div", { className: "semiont-form__field", children: [
53261
- /* @__PURE__ */ jsx50("label", { className: "semiont-form__label", children: t12.entityTypesLabel }),
53262
- /* @__PURE__ */ jsx50("div", { style: { display: "flex", flexWrap: "wrap", gap: "0.375rem" }, children: entityTypes.map((et) => /* @__PURE__ */ jsx50("span", { className: "semiont-chip", style: { fontSize: "var(--semiont-text-xs)", padding: "0.125rem 0.5rem" }, children: et }, et)) })
53269
+ /* @__PURE__ */ jsx50("span", { style: { color: "var(--semiont-text-primary)", fontWeight: 500 }, children: conn.resourceName }),
53270
+ conn.bidirectional && /* @__PURE__ */ jsx50("span", { className: "semiont-chip", style: { fontSize: "var(--semiont-text-xs)", padding: "0.125rem 0.375rem" }, children: "mutual" }),
53271
+ conn.entityTypes && conn.entityTypes.map((et) => /* @__PURE__ */ jsx50("span", { className: "semiont-chip", style: { fontSize: "var(--semiont-text-xs)", padding: "0.125rem 0.375rem" }, children: et }, et))
53272
+ ] }, conn.resourceId)) })
53263
53273
  ] }),
53264
- graphContext && (connections.length > 0 || citedByCount > 0 || siblingEntityTypes.length > 0) && /* @__PURE__ */ jsxs41("div", { className: "semiont-form__field", children: [
53265
- /* @__PURE__ */ jsx50("label", { className: "semiont-form__label", children: t12.graphContextLabel }),
53274
+ citedByCount > 0 && /* @__PURE__ */ jsxs41("div", { children: [
53266
53275
  /* @__PURE__ */ jsxs41("div", { style: {
53267
- padding: "0.75rem",
53268
- backgroundColor: "var(--semiont-bg-secondary)",
53269
- borderRadius: "var(--semiont-radius-md)",
53270
- border: "1px solid var(--semiont-border-primary)",
53271
- fontSize: "var(--semiont-text-sm)",
53272
- display: "flex",
53273
- flexDirection: "column",
53274
- gap: "0.5rem"
53276
+ fontSize: "var(--semiont-text-xs)",
53277
+ fontWeight: 700,
53278
+ textTransform: "uppercase",
53279
+ letterSpacing: "0.06em",
53280
+ color: "var(--semiont-text-tertiary)",
53281
+ marginBottom: "0.375rem"
53275
53282
  }, children: [
53276
- connections.length > 0 && /* @__PURE__ */ jsxs41("div", { children: [
53277
- /* @__PURE__ */ jsx50("span", { style: { fontWeight: 500, color: "var(--semiont-text-secondary)" }, children: t12.connectionsLabel }),
53278
- /* @__PURE__ */ jsx50("ul", { style: { marginTop: "0.25rem", display: "flex", flexDirection: "column", gap: "0.125rem", listStyle: "none", padding: 0 }, children: connections.map((conn) => /* @__PURE__ */ jsxs41("li", { style: { color: "var(--semiont-text-secondary)", display: "flex", alignItems: "center", gap: "0.375rem" }, children: [
53279
- /* @__PURE__ */ jsx50("span", { children: conn.resourceName }),
53280
- conn.bidirectional && /* @__PURE__ */ jsx50("span", { className: "semiont-chip", style: { fontSize: "var(--semiont-text-xs)", padding: "0.125rem 0.375rem" }, children: "mutual" }),
53281
- conn.entityTypes && conn.entityTypes.length > 0 && /* @__PURE__ */ jsx50("span", { style: { fontSize: "var(--semiont-text-xs)", color: "var(--semiont-text-tertiary)" }, children: conn.entityTypes.join(", ") })
53282
- ] }, conn.resourceId)) })
53283
- ] }),
53284
- citedByCount > 0 && /* @__PURE__ */ jsxs41("div", { children: [
53285
- /* @__PURE__ */ jsxs41("span", { style: { fontWeight: 500, color: "var(--semiont-text-secondary)" }, children: [
53286
- t12.citedByLabel,
53287
- " (",
53288
- citedByCount,
53289
- ")"
53290
- ] }),
53291
- citedBy.length > 0 && /* @__PURE__ */ jsx50("ul", { style: { marginTop: "0.25rem", display: "flex", flexDirection: "column", gap: "0.125rem", listStyle: "none", padding: 0 }, children: citedBy.map((ref) => /* @__PURE__ */ jsx50("li", { style: { color: "var(--semiont-text-secondary)" }, children: ref.resourceName }, ref.resourceId)) })
53292
- ] }),
53293
- siblingEntityTypes.length > 0 && /* @__PURE__ */ jsxs41("div", { children: [
53294
- /* @__PURE__ */ jsx50("span", { style: { fontWeight: 500, color: "var(--semiont-text-secondary)" }, children: t12.siblingTypesLabel }),
53295
- /* @__PURE__ */ jsx50("div", { style: { display: "flex", flexWrap: "wrap", gap: "0.25rem", marginTop: "0.25rem" }, children: siblingEntityTypes.map((et) => /* @__PURE__ */ jsx50("span", { className: "semiont-chip", style: { fontSize: "var(--semiont-text-xs)", padding: "0.125rem 0.5rem" }, children: et }, et)) })
53296
- ] })
53297
- ] })
53298
- ] }),
53299
- /* @__PURE__ */ jsxs41("div", { className: "semiont-form__field", children: [
53300
- /* @__PURE__ */ jsx50("label", { className: "semiont-form__label", children: t12.userHintLabel }),
53301
- /* @__PURE__ */ jsx50(
53302
- "input",
53303
- {
53304
- type: "text",
53305
- value: userHint ?? "",
53306
- onChange: onUserHintChange ? (e6) => onUserHintChange(e6.target.value) : void 0,
53307
- readOnly: !onUserHintChange,
53308
- placeholder: t12.userHintPlaceholder,
53309
- className: "semiont-search-modal__search-input"
53310
- }
53311
- )
53283
+ t12.citedByLabel,
53284
+ " (",
53285
+ citedByCount,
53286
+ ")"
53287
+ ] }),
53288
+ citedBy.length > 0 && /* @__PURE__ */ jsx50("ul", { style: { display: "flex", flexDirection: "column", gap: "0.25rem", listStyle: "none", padding: 0, margin: 0 }, children: citedBy.map((ref) => /* @__PURE__ */ jsx50("li", { style: { fontSize: "var(--semiont-text-sm)", color: "var(--semiont-text-primary)", fontWeight: 500 }, children: ref.resourceName }, ref.resourceId)) })
53312
53289
  ] })
53313
- ] });
53290
+ ] }) });
53314
53291
  }
53315
53292
 
53316
53293
  // src/components/modals/GatherContextStep.tsx
@@ -53321,77 +53298,135 @@ function GatherContextStep({
53321
53298
  contextError,
53322
53299
  userHint,
53323
53300
  onUserHintChange,
53324
- onCancel,
53325
53301
  onBind,
53326
53302
  onGenerate,
53327
53303
  onCompose,
53328
53304
  translations: t12
53329
53305
  }) {
53306
+ const [sourceExpanded, setSourceExpanded] = useState33(false);
53330
53307
  const contextReady = !contextLoading && !contextError && !!context;
53331
- return /* @__PURE__ */ jsxs42(Fragment12, { children: [
53332
- contextLoading && /* @__PURE__ */ jsx51("div", { className: "semiont-modal__empty-state", style: { textAlign: "center", padding: "1rem 0" }, children: t12.loadingContext }),
53308
+ const sourceContext = context?.sourceContext;
53309
+ const highlightRef = useRef32(null);
53310
+ useEffect41(() => {
53311
+ if (highlightRef.current) {
53312
+ highlightRef.current.scrollIntoView({ block: "center", behavior: "instant" });
53313
+ }
53314
+ }, [context]);
53315
+ return /* @__PURE__ */ jsxs42("div", { className: "semiont-gather__outer", children: [
53316
+ contextLoading && /* @__PURE__ */ jsxs42("div", { className: "semiont-gather__loading", children: [
53317
+ /* @__PURE__ */ jsxs42("div", { style: { display: "flex", gap: "0.5rem" }, children: [
53318
+ /* @__PURE__ */ jsx51("span", { className: "semiont-gather__loading-dot" }),
53319
+ /* @__PURE__ */ jsx51("span", { className: "semiont-gather__loading-dot" }),
53320
+ /* @__PURE__ */ jsx51("span", { className: "semiont-gather__loading-dot" })
53321
+ ] }),
53322
+ /* @__PURE__ */ jsx51("span", { className: "semiont-gather__loading-text", children: t12.loadingContext })
53323
+ ] }),
53333
53324
  !!contextError && /* @__PURE__ */ jsx51("div", { style: { textAlign: "center", padding: "1rem 0", color: "var(--semiont-color-red-600)" }, children: t12.failedContext }),
53334
- context && /* @__PURE__ */ jsx51(ContextSummary, { context, userHint, onUserHintChange, translations: t12 }),
53335
- /* @__PURE__ */ jsxs42("div", { className: "semiont-modal__actions", style: { paddingTop: "0.5rem" }, children: [
53336
- /* @__PURE__ */ jsxs42(
53337
- "button",
53338
- {
53339
- type: "button",
53340
- onClick: onCancel,
53341
- className: "semiont-button--secondary semiont-button--flex",
53342
- children: [
53343
- "\u2715 ",
53344
- t12.cancel
53345
- ]
53346
- }
53347
- ),
53348
- /* @__PURE__ */ jsxs42(
53349
- "button",
53350
- {
53351
- type: "button",
53352
- onClick: onBind,
53353
- disabled: !contextReady,
53354
- className: "semiont-button--primary semiont-button--flex",
53355
- children: [
53356
- "\u{1F50D} ",
53357
- t12.search,
53358
- "\u2026"
53359
- ]
53360
- }
53361
- ),
53362
- /* @__PURE__ */ jsxs42(
53363
- "button",
53364
- {
53365
- type: "button",
53366
- onClick: onGenerate,
53367
- disabled: !contextReady,
53368
- className: "semiont-button--primary semiont-button--flex",
53369
- children: [
53370
- "\u2728 ",
53371
- t12.generate,
53372
- "\u2026"
53373
- ]
53374
- }
53375
- ),
53376
- /* @__PURE__ */ jsxs42(
53377
- "button",
53378
- {
53379
- type: "button",
53380
- onClick: onCompose,
53381
- disabled: !contextReady,
53382
- className: "semiont-button--secondary semiont-button--flex",
53383
- children: [
53384
- "\u270D\uFE0F ",
53385
- t12.compose
53386
- ]
53387
- }
53388
- )
53325
+ context && /* @__PURE__ */ jsxs42(Fragment12, { children: [
53326
+ sourceContext && /* @__PURE__ */ jsxs42("div", { className: "semiont-gather__source-strip", children: [
53327
+ /* @__PURE__ */ jsxs42("label", { className: "semiont-form__label", style: { marginBottom: "0.375rem" }, children: [
53328
+ t12.sourceContextLabel,
53329
+ context.sourceResource?.name ? ` "${context.sourceResource.name}"` : ""
53330
+ ] }),
53331
+ /* @__PURE__ */ jsxs42("div", { className: `semiont-gather__source-box${sourceExpanded ? " semiont-gather__source-box--expanded" : ""}`, children: [
53332
+ /* @__PURE__ */ jsx51("div", { className: "semiont-gather__source-context", children: /* @__PURE__ */ jsxs42("div", { style: { fontSize: "var(--semiont-text-sm)", fontFamily: "monospace", whiteSpace: "pre-wrap", color: "var(--semiont-text-secondary)" }, children: [
53333
+ sourceContext.before && /* @__PURE__ */ jsx51("span", { children: sourceContext.before }),
53334
+ /* @__PURE__ */ jsx51(
53335
+ "span",
53336
+ {
53337
+ ref: highlightRef,
53338
+ style: {
53339
+ backgroundColor: "var(--semiont-color-primary-100)",
53340
+ padding: "0 0.25rem",
53341
+ fontWeight: 600,
53342
+ color: "var(--semiont-color-primary-900)"
53343
+ },
53344
+ children: sourceContext.selected
53345
+ }
53346
+ ),
53347
+ (context.metadata?.entityTypes ?? []).map((et) => /* @__PURE__ */ jsx51("span", { className: "semiont-chip", style: { fontSize: "var(--semiont-text-xs)", padding: "0.125rem 0.375rem", fontWeight: 400, verticalAlign: "middle", marginLeft: "0.25rem" }, children: et }, et)),
53348
+ context.annotation?.motivation && /* @__PURE__ */ jsx51("span", { className: "semiont-chip", style: { fontSize: "var(--semiont-text-xs)", padding: "0.125rem 0.375rem", fontWeight: 400, verticalAlign: "middle", marginLeft: "0.25rem" }, children: context.annotation.motivation }),
53349
+ sourceContext.after && /* @__PURE__ */ jsx51("span", { children: sourceContext.after })
53350
+ ] }) }),
53351
+ /* @__PURE__ */ jsx51(
53352
+ "button",
53353
+ {
53354
+ type: "button",
53355
+ className: "semiont-gather__expand-btn",
53356
+ onClick: () => setSourceExpanded((v4) => !v4),
53357
+ children: sourceExpanded ? "\u25B2 less" : "\u25BC more"
53358
+ }
53359
+ )
53360
+ ] })
53361
+ ] }),
53362
+ /* @__PURE__ */ jsxs42("div", { className: "semiont-gather__body", children: [
53363
+ /* @__PURE__ */ jsx51("div", { className: "semiont-gather__left", children: /* @__PURE__ */ jsx51(ContextSummary, { context, translations: t12 }) }),
53364
+ /* @__PURE__ */ jsx51("div", { className: "semiont-gather__right", children: /* @__PURE__ */ jsxs42("div", { className: "semiont-form__field", children: [
53365
+ /* @__PURE__ */ jsx51("label", { className: "semiont-form__label", children: t12.userHintLabel }),
53366
+ /* @__PURE__ */ jsx51(
53367
+ "textarea",
53368
+ {
53369
+ value: userHint,
53370
+ onChange: (e6) => onUserHintChange(e6.target.value),
53371
+ placeholder: t12.userHintPlaceholder,
53372
+ className: "semiont-search-modal__search-input semiont-gather__hint-textarea",
53373
+ style: { resize: "vertical", fontFamily: "inherit" }
53374
+ }
53375
+ )
53376
+ ] }) })
53377
+ ] }),
53378
+ /* @__PURE__ */ jsxs42("div", { className: "semiont-gather__footer", children: [
53379
+ /* @__PURE__ */ jsx51("div", { className: "semiont-gather__footer-label", children: t12.resolutionStrategyLabel }),
53380
+ /* @__PURE__ */ jsxs42("div", { className: "semiont-gather__actions", children: [
53381
+ /* @__PURE__ */ jsxs42(
53382
+ "button",
53383
+ {
53384
+ type: "button",
53385
+ onClick: onBind,
53386
+ disabled: !contextReady,
53387
+ className: "semiont-button--primary semiont-button--flex",
53388
+ children: [
53389
+ "\u{1F50D} ",
53390
+ t12.search,
53391
+ "\u2026"
53392
+ ]
53393
+ }
53394
+ ),
53395
+ /* @__PURE__ */ jsxs42(
53396
+ "button",
53397
+ {
53398
+ type: "button",
53399
+ onClick: onGenerate,
53400
+ disabled: !contextReady,
53401
+ className: "semiont-button--primary semiont-button--flex",
53402
+ children: [
53403
+ "\u2728 ",
53404
+ t12.generate,
53405
+ "\u2026"
53406
+ ]
53407
+ }
53408
+ ),
53409
+ /* @__PURE__ */ jsxs42(
53410
+ "button",
53411
+ {
53412
+ type: "button",
53413
+ onClick: onCompose,
53414
+ disabled: !contextReady,
53415
+ className: "semiont-button--secondary semiont-button--flex",
53416
+ children: [
53417
+ "\u270D\uFE0F ",
53418
+ t12.compose
53419
+ ]
53420
+ }
53421
+ )
53422
+ ] })
53423
+ ] })
53389
53424
  ] })
53390
53425
  ] });
53391
53426
  }
53392
53427
 
53393
53428
  // src/components/modals/ConfigureGenerationStep.tsx
53394
- import { useState as useState33 } from "react";
53429
+ import { useState as useState34 } from "react";
53395
53430
  import { LOCALES as LOCALES2 } from "@semiont/api-client";
53396
53431
  import { jsx as jsx52, jsxs as jsxs43 } from "react/jsx-runtime";
53397
53432
  function ConfigureGenerationStep({
@@ -53403,12 +53438,12 @@ function ConfigureGenerationStep({
53403
53438
  onGenerate,
53404
53439
  translations: t12
53405
53440
  }) {
53406
- const [title, setTitle] = useState33(defaultTitle);
53407
- const [storagePath, setStoragePath] = useState33("");
53408
- const [prompt, setPrompt] = useState33("");
53409
- const [language2, setLanguage] = useState33(locale);
53410
- const [temperature, setTemperature] = useState33(0.7);
53411
- const [maxTokens, setMaxTokens] = useState33(500);
53441
+ const [title, setTitle] = useState34(defaultTitle);
53442
+ const [storagePath, setStoragePath] = useState34("");
53443
+ const [prompt, setPrompt] = useState34("");
53444
+ const [language2, setLanguage] = useState34(locale);
53445
+ const [temperature, setTemperature] = useState34(0.7);
53446
+ const [maxTokens, setMaxTokens] = useState34(500);
53412
53447
  const handleSubmit = (e6) => {
53413
53448
  e6.preventDefault();
53414
53449
  const trimmedPrompt = prompt.trim();
@@ -53567,7 +53602,7 @@ function ConfigureGenerationStep({
53567
53602
  }
53568
53603
 
53569
53604
  // src/components/modals/ConfigureSearchStep.tsx
53570
- import { useState as useState34 } from "react";
53605
+ import { useState as useState35 } from "react";
53571
53606
  import { jsx as jsx53, jsxs as jsxs44 } from "react/jsx-runtime";
53572
53607
  function ConfigureSearchStep({
53573
53608
  isSearching = false,
@@ -53576,8 +53611,8 @@ function ConfigureSearchStep({
53576
53611
  onSearch,
53577
53612
  translations: t12
53578
53613
  }) {
53579
- const [limit, setLimit] = useState34(10);
53580
- const [useSemanticScoring, setUseSemanticScoring] = useState34(true);
53614
+ const [limit, setLimit] = useState35(10);
53615
+ const [useSemanticScoring, setUseSemanticScoring] = useState35(true);
53581
53616
  const handleSubmit = (e6) => {
53582
53617
  e6.preventDefault();
53583
53618
  onSearch({ limit, useSemanticScoring });
@@ -53769,22 +53804,23 @@ function ReferenceWizardModal({
53769
53804
  onComposeNavigate,
53770
53805
  translations: t12
53771
53806
  }) {
53772
- const [wizardStep, setWizardStep] = useState35({ step: "gather" });
53773
- const [isSearching, setIsSearching] = useState35(false);
53774
- const [userHint, setUserHint] = useState35("");
53775
- useEffect41(() => {
53807
+ const [wizardStep, setWizardStep] = useState36({ step: "gather" });
53808
+ const [isSearching, setIsSearching] = useState36(false);
53809
+ const [userHint, setUserHint] = useState36("");
53810
+ useEffect42(() => {
53776
53811
  if (isOpen) {
53777
53812
  setWizardStep({ step: "gather" });
53778
53813
  setIsSearching(false);
53779
53814
  setUserHint("");
53780
53815
  }
53781
53816
  }, [isOpen]);
53782
- useEffect41(() => {
53817
+ useEffect42(() => {
53783
53818
  if (!isOpen) return;
53784
- const subscription = eventBus.get("bind:search-results").subscribe((event) => {
53785
- if (annotationId4 && event.referenceId === annotationId4) {
53819
+ const subscription = eventBus.get("match:search-results").subscribe((event) => {
53820
+ const e6 = event;
53821
+ if (annotationId4 && e6.referenceId === annotationId4) {
53786
53822
  setIsSearching(false);
53787
- setWizardStep({ step: "search-results", results: event.results });
53823
+ setWizardStep({ step: "search-results", results: e6.results });
53788
53824
  }
53789
53825
  });
53790
53826
  return () => subscription.unsubscribe();
@@ -53808,7 +53844,7 @@ function ReferenceWizardModal({
53808
53844
  if (!annotationId4 || !context) return;
53809
53845
  setIsSearching(true);
53810
53846
  const contextWithHint = userHint ? { ...context, userHint } : context;
53811
- eventBus.get("bind:search-requested").next({
53847
+ eventBus.get("match:search-requested").next({
53812
53848
  referenceId: annotationId4,
53813
53849
  context: contextWithHint,
53814
53850
  limit: config.limit,
@@ -53848,7 +53884,7 @@ function ReferenceWizardModal({
53848
53884
  leave: "ease-in duration-150",
53849
53885
  leaveFrom: "opacity-100 scale-100",
53850
53886
  leaveTo: "opacity-0 scale-95",
53851
- children: /* @__PURE__ */ jsxs46(ze, { className: `semiont-search-modal__panel semiont-search-modal__panel--with-border${wizardStep.step === "search-results" ? " semiont-search-modal__panel--wide" : ""}`, children: [
53887
+ children: /* @__PURE__ */ jsxs46(ze, { className: `semiont-search-modal__panel semiont-search-modal__panel--with-border${wizardStep.step === "search-results" ? " semiont-search-modal__panel--wide" : ""}${wizardStep.step === "gather" ? " semiont-search-modal__panel--gather" : ""}`, children: [
53852
53888
  /* @__PURE__ */ jsxs46("div", { className: "semiont-search-modal__header", children: [
53853
53889
  /* @__PURE__ */ jsx55(Qe, { className: "semiont-search-modal__title", children: stepTitle }),
53854
53890
  /* @__PURE__ */ jsx55(
@@ -53869,29 +53905,22 @@ function ReferenceWizardModal({
53869
53905
  contextError,
53870
53906
  userHint,
53871
53907
  onUserHintChange: setUserHint,
53872
- onCancel: onClose,
53873
53908
  onBind: handleBind,
53874
53909
  onGenerate: handleGenerate,
53875
53910
  onCompose: handleCompose,
53876
53911
  translations: {
53877
53912
  title: t12.gatherTitle,
53878
- annotationLabel: t12.annotationLabel,
53879
- sourceResourceLabel: t12.sourceResourceLabel,
53880
- motivationLabel: t12.motivationLabel,
53881
53913
  sourceContextLabel: t12.sourceContextLabel,
53882
- entityTypesLabel: t12.entityTypesLabel,
53883
- graphContextLabel: t12.graphContextLabel,
53884
53914
  connectionsLabel: t12.connectionsLabel,
53885
53915
  citedByLabel: t12.citedByLabel,
53886
- siblingTypesLabel: t12.siblingTypesLabel,
53887
53916
  userHintLabel: t12.userHintLabel,
53888
53917
  userHintPlaceholder: t12.userHintPlaceholder,
53889
53918
  loadingContext: t12.loadingContext,
53890
53919
  failedContext: t12.failedContext,
53891
- cancel: t12.cancel,
53892
53920
  search: t12.search,
53893
53921
  generate: t12.generate,
53894
- compose: t12.compose
53922
+ compose: t12.compose,
53923
+ resolutionStrategyLabel: t12.resolutionStrategyLabel
53895
53924
  }
53896
53925
  }
53897
53926
  ),
@@ -53954,15 +53983,9 @@ function ReferenceWizardModal({
53954
53983
  back: t12.back,
53955
53984
  cancel: t12.cancel,
53956
53985
  score: t12.score,
53957
- annotationLabel: t12.annotationLabel,
53958
- sourceResourceLabel: t12.sourceResourceLabel,
53959
- motivationLabel: t12.motivationLabel,
53960
53986
  sourceContextLabel: t12.sourceContextLabel,
53961
- entityTypesLabel: t12.entityTypesLabel,
53962
- graphContextLabel: t12.graphContextLabel,
53963
53987
  connectionsLabel: t12.connectionsLabel,
53964
53988
  citedByLabel: t12.citedByLabel,
53965
- siblingTypesLabel: t12.siblingTypesLabel,
53966
53989
  userHintLabel: t12.userHintLabel,
53967
53990
  userHintPlaceholder: t12.userHintPlaceholder
53968
53991
  }
@@ -53975,7 +53998,7 @@ function ReferenceWizardModal({
53975
53998
  }
53976
53999
 
53977
54000
  // src/components/modals/SearchModal.tsx
53978
- import { useState as useState36, useEffect as useEffect42 } from "react";
54001
+ import { useState as useState37, useEffect as useEffect43 } from "react";
53979
54002
 
53980
54003
  // src/hooks/useSearchAnnouncements.ts
53981
54004
  import { useCallback as useCallback32 } from "react";
@@ -54017,10 +54040,10 @@ function SearchModal({
54017
54040
  translations = {}
54018
54041
  }) {
54019
54042
  const { announceSearchResults, announceSearching } = useSearchAnnouncements2();
54020
- const [query, setQuery] = useState36("");
54021
- const [debouncedQuery, setDebouncedQuery] = useState36("");
54022
- const [results, setResults] = useState36([]);
54023
- const [selectedIndex, setSelectedIndex] = useState36(0);
54043
+ const [query, setQuery] = useState37("");
54044
+ const [debouncedQuery, setDebouncedQuery] = useState37("");
54045
+ const [results, setResults] = useState37([]);
54046
+ const [selectedIndex, setSelectedIndex] = useState37(0);
54024
54047
  const t12 = {
54025
54048
  placeholder: translations.placeholder || "Search resources, entities...",
54026
54049
  searching: translations.searching || "Searching...",
@@ -54032,7 +54055,7 @@ function SearchModal({
54032
54055
  enter: translations.enter || "Enter",
54033
54056
  esc: translations.esc || "ESC"
54034
54057
  };
54035
- useEffect42(() => {
54058
+ useEffect43(() => {
54036
54059
  const timer = setTimeout(() => {
54037
54060
  setDebouncedQuery(query);
54038
54061
  }, 300);
@@ -54040,7 +54063,7 @@ function SearchModal({
54040
54063
  }, [query]);
54041
54064
  const searchData = { resources: [], entities: [] };
54042
54065
  const loading = false;
54043
- useEffect42(() => {
54066
+ useEffect43(() => {
54044
54067
  if (isOpen) {
54045
54068
  setQuery("");
54046
54069
  setDebouncedQuery("");
@@ -54048,7 +54071,7 @@ function SearchModal({
54048
54071
  setSelectedIndex(0);
54049
54072
  }
54050
54073
  }, [isOpen]);
54051
- useEffect42(() => {
54074
+ useEffect43(() => {
54052
54075
  if (!debouncedQuery.trim()) {
54053
54076
  setResults([]);
54054
54077
  return;
@@ -54177,7 +54200,7 @@ function SearchModal({
54177
54200
  }
54178
54201
 
54179
54202
  // src/components/modals/ResourceSearchModal.tsx
54180
- import { useState as useState37, useEffect as useEffect43 } from "react";
54203
+ import { useState as useState38, useEffect as useEffect44 } from "react";
54181
54204
  import { jsx as jsx57, jsxs as jsxs48 } from "react/jsx-runtime";
54182
54205
  function ResourceSearchModal({
54183
54206
  isOpen,
@@ -54187,8 +54210,8 @@ function ResourceSearchModal({
54187
54210
  translations = {}
54188
54211
  }) {
54189
54212
  const { announceSearchResults, announceSearching, announceNavigation } = useSearchAnnouncements2();
54190
- const [search2, setSearch] = useState37(searchTerm);
54191
- const [debouncedSearch, setDebouncedSearch] = useState37(searchTerm);
54213
+ const [search2, setSearch] = useState38(searchTerm);
54214
+ const [debouncedSearch, setDebouncedSearch] = useState38(searchTerm);
54192
54215
  const t12 = {
54193
54216
  title: translations.title || "Search Resources",
54194
54217
  placeholder: translations.placeholder || "Search for resources...",
@@ -54196,7 +54219,7 @@ function ResourceSearchModal({
54196
54219
  noResults: translations.noResults || "No documents found",
54197
54220
  close: translations.close || "\u2715"
54198
54221
  };
54199
- useEffect43(() => {
54222
+ useEffect44(() => {
54200
54223
  const timer = setTimeout(() => {
54201
54224
  setDebouncedSearch(search2);
54202
54225
  }, 300);
@@ -54218,17 +54241,17 @@ function ResourceSearchModal({
54218
54241
  mediaType
54219
54242
  };
54220
54243
  }) || [];
54221
- useEffect43(() => {
54244
+ useEffect44(() => {
54222
54245
  if (!loading && debouncedSearch) {
54223
54246
  announceSearchResults(results.length, debouncedSearch);
54224
54247
  }
54225
54248
  }, [loading, results.length, debouncedSearch]);
54226
- useEffect43(() => {
54249
+ useEffect44(() => {
54227
54250
  if (loading && debouncedSearch) {
54228
54251
  announceSearching();
54229
54252
  }
54230
54253
  }, [loading, debouncedSearch]);
54231
- useEffect43(() => {
54254
+ useEffect44(() => {
54232
54255
  if (isOpen && searchTerm) {
54233
54256
  setSearch(searchTerm);
54234
54257
  setDebouncedSearch(searchTerm);
@@ -54430,11 +54453,11 @@ function SessionTimer() {
54430
54453
  }
54431
54454
 
54432
54455
  // src/components/SessionExpiryBanner.tsx
54433
- import { useState as useState38 } from "react";
54456
+ import { useState as useState39 } from "react";
54434
54457
  import { jsx as jsx60, jsxs as jsxs52 } from "react/jsx-runtime";
54435
54458
  function SessionExpiryBanner() {
54436
54459
  const { timeRemaining, isExpiringSoon } = useSessionExpiry();
54437
- const [dismissed, setDismissed] = useState38(false);
54460
+ const [dismissed, setDismissed] = useState39(false);
54438
54461
  const formattedTime = formatTime(timeRemaining);
54439
54462
  if (!isExpiringSoon || dismissed || !formattedTime) {
54440
54463
  return null;
@@ -54655,7 +54678,7 @@ function UnifiedHeader({
54655
54678
  }
54656
54679
 
54657
54680
  // src/components/layout/LeftSidebar.tsx
54658
- import { useState as useState39, useEffect as useEffect44 } from "react";
54681
+ import { useState as useState40, useEffect as useEffect45 } from "react";
54659
54682
  import { jsx as jsx64, jsxs as jsxs55 } from "react/jsx-runtime";
54660
54683
  function LeftSidebar({
54661
54684
  Link,
@@ -54670,7 +54693,7 @@ function LeftSidebar({
54670
54693
  isModerator = false,
54671
54694
  currentPath
54672
54695
  }) {
54673
- const [isCollapsed, setIsCollapsed] = useState39(false);
54696
+ const [isCollapsed, setIsCollapsed] = useState40(false);
54674
54697
  const { width, setWidth, minWidth, maxWidth } = usePanelWidth({
54675
54698
  defaultWidth: 256,
54676
54699
  // 16rem
@@ -54680,7 +54703,7 @@ function LeftSidebar({
54680
54703
  // 25rem
54681
54704
  storageKey: "semiont-left-sidebar-width"
54682
54705
  });
54683
- useEffect44(() => {
54706
+ useEffect45(() => {
54684
54707
  if (collapsible) {
54685
54708
  const saved = localStorage.getItem(storageKey);
54686
54709
  if (saved === "true") {
@@ -55724,21 +55747,21 @@ var ForwardRef17 = /* @__PURE__ */ React44.forwardRef(UserCircleIcon);
55724
55747
  var UserCircleIcon_default = ForwardRef17;
55725
55748
 
55726
55749
  // src/hooks/usePanelBrowse.ts
55727
- import { useState as useState40, useCallback as useCallback33, useEffect as useEffect45 } from "react";
55750
+ import { useState as useState41, useCallback as useCallback33, useEffect as useEffect46 } from "react";
55728
55751
  var COMMON_PANELS = ["user", "settings"];
55729
55752
  var RESOURCE_PANELS = ["history", "info", "annotations", "collaboration", "jsonld"];
55730
55753
  var tabGenerationCounter = 0;
55731
55754
  function usePanelBrowse() {
55732
- const [activePanel, setActivePanel] = useState40(() => {
55755
+ const [activePanel, setActivePanel] = useState41(() => {
55733
55756
  if (typeof window !== "undefined") {
55734
55757
  const saved = localStorage.getItem("activeToolbarPanel");
55735
55758
  return saved || null;
55736
55759
  }
55737
55760
  return null;
55738
55761
  });
55739
- const [scrollToAnnotationId, setScrollToAnnotationId] = useState40(null);
55740
- const [panelInitialTab, setPanelInitialTab] = useState40(null);
55741
- useEffect45(() => {
55762
+ const [scrollToAnnotationId, setScrollToAnnotationId] = useState41(null);
55763
+ const [panelInitialTab, setPanelInitialTab] = useState41(null);
55764
+ useEffect46(() => {
55742
55765
  if (typeof window === "undefined") return;
55743
55766
  if (activePanel) {
55744
55767
  localStorage.setItem("activeToolbarPanel", activePanel);
@@ -55876,7 +55899,7 @@ function ExportCard({ onExport, isExporting, translations: t12 }) {
55876
55899
  }
55877
55900
 
55878
55901
  // src/features/admin-exchange/components/ImportCard.tsx
55879
- import { useRef as useRef32, useState as useState41, useCallback as useCallback34 } from "react";
55902
+ import { useRef as useRef33, useState as useState42, useCallback as useCallback34 } from "react";
55880
55903
  import { jsx as jsx73, jsxs as jsxs62 } from "react/jsx-runtime";
55881
55904
  function ImportCard({
55882
55905
  onFileSelected,
@@ -55887,9 +55910,9 @@ function ImportCard({
55887
55910
  isImporting,
55888
55911
  translations: t12
55889
55912
  }) {
55890
- const fileInputRef = useRef32(null);
55891
- const [isDragActive, setIsDragActive] = useState41(false);
55892
- const [showConfirm, setShowConfirm] = useState41(false);
55913
+ const fileInputRef = useRef33(null);
55914
+ const [isDragActive, setIsDragActive] = useState42(false);
55915
+ const [showConfirm, setShowConfirm] = useState42(false);
55893
55916
  const handleDragOver = useCallback34((e6) => {
55894
55917
  e6.preventDefault();
55895
55918
  setIsDragActive(true);
@@ -56300,7 +56323,7 @@ function LinkedDataPage({
56300
56323
  }
56301
56324
 
56302
56325
  // src/features/admin-users/components/AdminUsersPage.tsx
56303
- import { useState as useState42 } from "react";
56326
+ import { useState as useState43 } from "react";
56304
56327
  import { Fragment as Fragment15, jsx as jsx78, jsxs as jsxs67 } from "react/jsx-runtime";
56305
56328
  function UserTableRow({
56306
56329
  user,
@@ -56382,9 +56405,9 @@ function AdminUsersPage({
56382
56405
  Toolbar: Toolbar2,
56383
56406
  buttonStyles: buttonStyles2
56384
56407
  }) {
56385
- const [searchTerm, setSearchTerm] = useState42("");
56386
- const [selectedRole, setSelectedRole] = useState42("all");
56387
- const [selectedStatus, setSelectedStatus] = useState42("all");
56408
+ const [searchTerm, setSearchTerm] = useState43("");
56409
+ const [selectedRole, setSelectedRole] = useState43("all");
56410
+ const [selectedStatus, setSelectedStatus] = useState43("all");
56388
56411
  const filteredUsers = users.filter((user) => {
56389
56412
  const matchesSearch = (user.name || "").toLowerCase().includes(searchTerm.toLowerCase()) || user.email.toLowerCase().includes(searchTerm.toLowerCase());
56390
56413
  const userRole = user.isAdmin ? "admin" : "user";
@@ -56699,7 +56722,7 @@ function SignInForm({
56699
56722
  }
56700
56723
 
56701
56724
  // src/features/auth/components/SignUpForm.tsx
56702
- import { useState as useState43 } from "react";
56725
+ import { useState as useState44 } from "react";
56703
56726
  import { jsx as jsx80, jsxs as jsxs69 } from "react/jsx-runtime";
56704
56727
  function GoogleIcon2() {
56705
56728
  return /* @__PURE__ */ jsxs69("svg", { className: "semiont-icon semiont-icon--small semiont-icon--inline", viewBox: "0 0 24 24", children: [
@@ -56734,7 +56757,7 @@ function GoogleIcon2() {
56734
56757
  ] });
56735
56758
  }
56736
56759
  function SignUpForm({ onSignUp, Link, translations: t12 }) {
56737
- const [isLoading, setIsLoading] = useState43(false);
56760
+ const [isLoading, setIsLoading] = useState44(false);
56738
56761
  const handleSignUp = async () => {
56739
56762
  setIsLoading(true);
56740
56763
  try {
@@ -57191,7 +57214,7 @@ function TagSchemasPage({
57191
57214
  }
57192
57215
 
57193
57216
  // src/features/resource-compose/components/ResourceComposePage.tsx
57194
- import { useState as useState44, useEffect as useEffect46 } from "react";
57217
+ import { useState as useState45, useEffect as useEffect47 } from "react";
57195
57218
  import { isImageMimeType, isPdfMimeType as isPdfMimeType4, LOCALES as LOCALES3 } from "@semiont/api-client";
57196
57219
  import { jsx as jsx86, jsxs as jsxs75 } from "react/jsx-runtime";
57197
57220
  function ResourceComposePage({
@@ -57212,20 +57235,20 @@ function ResourceComposePage({
57212
57235
  Toolbar: Toolbar2
57213
57236
  }) {
57214
57237
  const { announceFormSubmitting, announceFormSuccess, announceFormError } = useFormAnnouncements();
57215
- const [newResourceName, setNewResourceName] = useState44("");
57216
- const [newResourceContent, setNewResourceContent] = useState44("");
57217
- const [selectedEntityTypes, setSelectedEntityTypes] = useState44([]);
57218
- const [isCreating, setIsCreating] = useState44(false);
57219
- const [inputMethod, setInputMethod] = useState44("write");
57220
- const [uploadedFile, setUploadedFile] = useState44(null);
57221
- const [fileMimeType, setFileMimeType] = useState44("text/markdown");
57222
- const [filePreviewUrl, setFilePreviewUrl] = useState44(null);
57223
- const [selectedFormat, setSelectedFormat] = useState44("text/markdown");
57224
- const [selectedLanguage, setSelectedLanguage] = useState44(initialLocale);
57225
- const [selectedCharset, setSelectedCharset] = useState44("");
57226
- const [storagePath, setStoragePath] = useState44("");
57227
- const [archiveOriginal, setArchiveOriginal] = useState44(true);
57228
- useEffect46(() => {
57238
+ const [newResourceName, setNewResourceName] = useState45("");
57239
+ const [newResourceContent, setNewResourceContent] = useState45("");
57240
+ const [selectedEntityTypes, setSelectedEntityTypes] = useState45([]);
57241
+ const [isCreating, setIsCreating] = useState45(false);
57242
+ const [inputMethod, setInputMethod] = useState45("write");
57243
+ const [uploadedFile, setUploadedFile] = useState45(null);
57244
+ const [fileMimeType, setFileMimeType] = useState45("text/markdown");
57245
+ const [filePreviewUrl, setFilePreviewUrl] = useState45(null);
57246
+ const [selectedFormat, setSelectedFormat] = useState45("text/markdown");
57247
+ const [selectedLanguage, setSelectedLanguage] = useState45(initialLocale);
57248
+ const [selectedCharset, setSelectedCharset] = useState45("");
57249
+ const [storagePath, setStoragePath] = useState45("");
57250
+ const [archiveOriginal, setArchiveOriginal] = useState45(true);
57251
+ useEffect47(() => {
57229
57252
  if (mode === "clone" && cloneData) {
57230
57253
  setNewResourceName(cloneData.sourceResource.name);
57231
57254
  setNewResourceContent(cloneData.sourceContent);
@@ -57258,7 +57281,7 @@ function ResourceComposePage({
57258
57281
  reader.readAsText(file);
57259
57282
  }
57260
57283
  };
57261
- useEffect46(() => {
57284
+ useEffect47(() => {
57262
57285
  return () => {
57263
57286
  if (filePreviewUrl) {
57264
57287
  URL.revokeObjectURL(filePreviewUrl);
@@ -57662,7 +57685,7 @@ function ResourceComposePage({
57662
57685
  }
57663
57686
 
57664
57687
  // src/features/resource-discovery/components/ResourceDiscoveryPage.tsx
57665
- import { useState as useState45, useCallback as useCallback35, useRef as useRef33 } from "react";
57688
+ import { useState as useState46, useCallback as useCallback35, useRef as useRef34 } from "react";
57666
57689
  import { getResourceId as getResourceId2 } from "@semiont/api-client";
57667
57690
 
57668
57691
  // src/features/resource-discovery/components/ResourceCard.tsx
@@ -57735,8 +57758,8 @@ function ResourceDiscoveryPage({
57735
57758
  translations: t12,
57736
57759
  ToolbarPanels
57737
57760
  }) {
57738
- const [searchQuery2, setSearchQuery] = useState45("");
57739
- const [selectedEntityType, setSelectedEntityType] = useState45("");
57761
+ const [searchQuery2, setSearchQuery] = useState46("");
57762
+ const [selectedEntityType, setSelectedEntityType] = useState46("");
57740
57763
  const hasSearchQuery = searchQuery2.trim() !== "";
57741
57764
  const hasSearchResults = searchDocuments.length > 0;
57742
57765
  const baseDocuments = hasSearchResults ? searchDocuments : recentDocuments;
@@ -57753,7 +57776,7 @@ function ResourceDiscoveryPage({
57753
57776
  { orientation: "grid", cols: 2 }
57754
57777
  // 2 columns on medium+ screens
57755
57778
  );
57756
- const onNavigateToResourceRef = useRef33(onNavigateToResource);
57779
+ const onNavigateToResourceRef = useRef34(onNavigateToResource);
57757
57780
  onNavigateToResourceRef.current = onNavigateToResource;
57758
57781
  const handleEntityTypeFilter = useCallback35((entityType3) => {
57759
57782
  setSelectedEntityType(entityType3);
@@ -57896,13 +57919,13 @@ function ResourceDiscoveryPage({
57896
57919
  }
57897
57920
 
57898
57921
  // src/features/resource-viewer/components/ResourceViewerPage.tsx
57899
- import { useState as useState49, useEffect as useEffect51, useCallback as useCallback38, useMemo as useMemo14 } from "react";
57922
+ import { useState as useState50, useEffect as useEffect52, useCallback as useCallback38, useMemo as useMemo14 } from "react";
57900
57923
  import { useQueryClient as useQueryClient3 } from "@tanstack/react-query";
57901
57924
  import { annotationId as annotationId3 } from "@semiont/core";
57902
57925
  import { getLanguage, getPrimaryRepresentation, getPrimaryMediaType as getPrimaryMediaType2 } from "@semiont/api-client";
57903
57926
 
57904
57927
  // src/hooks/useBindFlow.ts
57905
- import { useEffect as useEffect47, useRef as useRef34 } from "react";
57928
+ import { useEffect as useEffect48, useRef as useRef35 } from "react";
57906
57929
  import { accessToken as accessToken4 } from "@semiont/core";
57907
57930
  function toAccessToken2(token) {
57908
57931
  return token ? accessToken4(token) : void 0;
@@ -57912,19 +57935,19 @@ function useBindFlow(rUri) {
57912
57935
  const client = useApiClient();
57913
57936
  const token = useAuthToken();
57914
57937
  const { showError } = useToast();
57915
- const rUriRef = useRef34(rUri);
57916
- useEffect47(() => {
57938
+ const rUriRef = useRef35(rUri);
57939
+ useEffect48(() => {
57917
57940
  rUriRef.current = rUri;
57918
57941
  });
57919
- const clientRef = useRef34(client);
57920
- useEffect47(() => {
57942
+ const clientRef = useRef35(client);
57943
+ useEffect48(() => {
57921
57944
  clientRef.current = client;
57922
57945
  });
57923
- const tokenRef = useRef34(token);
57924
- useEffect47(() => {
57946
+ const tokenRef = useRef35(token);
57947
+ useEffect48(() => {
57925
57948
  tokenRef.current = token;
57926
57949
  });
57927
- useEffect47(() => {
57950
+ useEffect48(() => {
57928
57951
  const handleAnnotationUpdateBody = (event) => {
57929
57952
  const annotationId4 = event.annotationId;
57930
57953
  const finishedSub = eventBus.get("bind:finished").subscribe((finishedEvent) => {
@@ -57955,7 +57978,7 @@ function useBindFlow(rUri) {
57955
57978
  }, { auth: toAccessToken2(tokenRef.current), eventBus });
57956
57979
  };
57957
57980
  const updateSub = eventBus.get("bind:update-body").subscribe(handleAnnotationUpdateBody);
57958
- const searchSub = eventBus.get("bind:search-requested").subscribe(handleSearchRequested);
57981
+ const searchSub = eventBus.get("match:search-requested").subscribe(handleSearchRequested);
57959
57982
  return () => {
57960
57983
  updateSub.unsubscribe();
57961
57984
  searchSub.unsubscribe();
@@ -57967,7 +57990,7 @@ function useBindFlow(rUri) {
57967
57990
  }
57968
57991
 
57969
57992
  // src/hooks/useMarkFlow.ts
57970
- import { useState as useState46, useRef as useRef35, useEffect as useEffect48, useCallback as useCallback36 } from "react";
57993
+ import { useState as useState47, useRef as useRef36, useEffect as useEffect49, useCallback as useCallback36 } from "react";
57971
57994
  import { accessToken as accessToken5, entityType as entityType2, annotationId as annotationId2 } from "@semiont/core";
57972
57995
  function toAccessToken3(token) {
57973
57996
  return token ? accessToken5(token) : void 0;
@@ -57977,19 +58000,19 @@ function useMarkFlow(rUri) {
57977
58000
  const client = useApiClient();
57978
58001
  const token = useAuthToken();
57979
58002
  const { showSuccess, showError, showInfo } = useToast();
57980
- const clientRef = useRef35(client);
57981
- const rUriRef = useRef35(rUri);
57982
- const tokenRef = useRef35(token);
57983
- useEffect48(() => {
58003
+ const clientRef = useRef36(client);
58004
+ const rUriRef = useRef36(rUri);
58005
+ const tokenRef = useRef36(token);
58006
+ useEffect49(() => {
57984
58007
  clientRef.current = client;
57985
58008
  });
57986
- useEffect48(() => {
58009
+ useEffect49(() => {
57987
58010
  rUriRef.current = rUri;
57988
58011
  });
57989
- useEffect48(() => {
58012
+ useEffect49(() => {
57990
58013
  tokenRef.current = token;
57991
58014
  });
57992
- const [pendingAnnotation, setPendingAnnotation] = useState46(null);
58015
+ const [pendingAnnotation, setPendingAnnotation] = useState47(null);
57993
58016
  const handleAnnotationRequested = useCallback36((pending) => {
57994
58017
  const MOTIVATION_TO_TAB = {
57995
58018
  highlighting: "annotations",
@@ -58048,10 +58071,10 @@ function useMarkFlow(rUri) {
58048
58071
  const handleAnnotationCancelPending = useCallback36(() => {
58049
58072
  setPendingAnnotation(null);
58050
58073
  }, []);
58051
- const [assistingMotivation, setAssistingMotivation] = useState46(null);
58052
- const [progress, setProgress] = useState46(null);
58053
- const assistStreamRef = useRef35(null);
58054
- const progressDismissTimeoutRef = useRef35(null);
58074
+ const [assistingMotivation, setAssistingMotivation] = useState47(null);
58075
+ const [progress, setProgress] = useState47(null);
58076
+ const assistStreamRef = useRef36(null);
58077
+ const progressDismissTimeoutRef = useRef36(null);
58055
58078
  const handleMarkProgress = useCallback36((chunk) => {
58056
58079
  setProgress(chunk);
58057
58080
  }, []);
@@ -58086,7 +58109,7 @@ function useMarkFlow(rUri) {
58086
58109
  }
58087
58110
  setProgress(null);
58088
58111
  }, []);
58089
- useEffect48(() => {
58112
+ useEffect49(() => {
58090
58113
  const handleAnnotationSubmit = async (event) => {
58091
58114
  const currentClient = clientRef.current;
58092
58115
  const currentRUri = rUriRef.current;
@@ -58157,13 +58180,15 @@ function useMarkFlow(rUri) {
58157
58180
  currentClient.sse.markAssessments(currentRUri, {
58158
58181
  instructions: event.options.instructions,
58159
58182
  tone: event.options.tone,
58160
- density: event.options.density
58183
+ density: event.options.density,
58184
+ language: event.options.language
58161
58185
  }, sseOptions);
58162
58186
  } else if (event.motivation === "commenting") {
58163
58187
  currentClient.sse.markComments(currentRUri, {
58164
58188
  instructions: event.options.instructions,
58165
58189
  tone: event.options.tone,
58166
- density: event.options.density
58190
+ density: event.options.density,
58191
+ language: event.options.language
58167
58192
  }, sseOptions);
58168
58193
  }
58169
58194
  } catch (error) {
@@ -58212,7 +58237,7 @@ function useMarkFlow(rUri) {
58212
58237
  "mark:create-failed": ({ error }) => showError(`Failed to create annotation: ${error.message}`),
58213
58238
  "mark:delete-failed": ({ error }) => showError(`Failed to delete annotation: ${error.message}`)
58214
58239
  });
58215
- useEffect48(() => {
58240
+ useEffect49(() => {
58216
58241
  return () => {
58217
58242
  if (progressDismissTimeoutRef.current) {
58218
58243
  clearTimeout(progressDismissTimeoutRef.current);
@@ -58228,7 +58253,7 @@ function useMarkFlow(rUri) {
58228
58253
  }
58229
58254
 
58230
58255
  // src/hooks/useYieldFlow.ts
58231
- import { useState as useState47, useCallback as useCallback37, useEffect as useEffect49, useRef as useRef36 } from "react";
58256
+ import { useState as useState48, useCallback as useCallback37, useEffect as useEffect50, useRef as useRef37 } from "react";
58232
58257
  import { annotationId as makeAnnotationId, resourceId as makeResourceId, accessToken as accessToken6 } from "@semiont/core";
58233
58258
  function toAccessToken4(token) {
58234
58259
  return token ? accessToken6(token) : void 0;
@@ -58238,17 +58263,17 @@ function useYieldFlow(locale, resourceId2, clearNewAnnotationId) {
58238
58263
  const client = useApiClient();
58239
58264
  const token = useAuthToken();
58240
58265
  const { showSuccess, showError } = useToast();
58241
- const clientRef = useRef36(client);
58242
- const tokenRef = useRef36(token);
58243
- useEffect49(() => {
58266
+ const clientRef = useRef37(client);
58267
+ const tokenRef = useRef37(token);
58268
+ useEffect50(() => {
58244
58269
  clientRef.current = client;
58245
58270
  });
58246
- useEffect49(() => {
58271
+ useEffect50(() => {
58247
58272
  tokenRef.current = token;
58248
58273
  });
58249
- const generationStreamRef = useRef36(null);
58250
- const [isGenerating, setIsGenerating] = useState47(false);
58251
- const [generationProgress, setYieldProgress] = useState47(null);
58274
+ const generationStreamRef = useRef37(null);
58275
+ const [isGenerating, setIsGenerating] = useState48(false);
58276
+ const [generationProgress, setYieldProgress] = useState48(null);
58252
58277
  const handleProgressEvent = useCallback37((chunk) => {
58253
58278
  setYieldProgress(chunk);
58254
58279
  setIsGenerating(true);
@@ -58284,7 +58309,7 @@ function useYieldFlow(locale, resourceId2, clearNewAnnotationId) {
58284
58309
  setIsGenerating(false);
58285
58310
  showError(`Resource generation failed: ${error.message}`);
58286
58311
  }, [showError]);
58287
- useEffect49(() => {
58312
+ useEffect50(() => {
58288
58313
  const handleGenerationStart = async (event) => {
58289
58314
  try {
58290
58315
  generationStreamRef.current?.abort();
@@ -58330,26 +58355,26 @@ function useYieldFlow(locale, resourceId2, clearNewAnnotationId) {
58330
58355
  }
58331
58356
 
58332
58357
  // src/hooks/useContextGatherFlow.ts
58333
- import { useState as useState48, useEffect as useEffect50, useRef as useRef37 } from "react";
58358
+ import { useState as useState49, useEffect as useEffect51, useRef as useRef38 } from "react";
58334
58359
  import { accessToken as accessToken7 } from "@semiont/core";
58335
58360
  function toAccessToken5(token) {
58336
58361
  return token ? accessToken7(token) : void 0;
58337
58362
  }
58338
58363
  function useContextGatherFlow(eventBus, config) {
58339
58364
  const token = useAuthToken();
58340
- const [gatherContext, setCorrelationContext] = useState48(null);
58341
- const [gatherLoading, setCorrelationLoading] = useState48(false);
58342
- const [gatherError, setCorrelationError] = useState48(null);
58343
- const [gatherAnnotationId, setCorrelationAnnotationId] = useState48(null);
58344
- const configRef = useRef37(config);
58345
- const tokenRef = useRef37(token);
58346
- useEffect50(() => {
58365
+ const [gatherContext, setCorrelationContext] = useState49(null);
58366
+ const [gatherLoading, setCorrelationLoading] = useState49(false);
58367
+ const [gatherError, setCorrelationError] = useState49(null);
58368
+ const [gatherAnnotationId, setCorrelationAnnotationId] = useState49(null);
58369
+ const configRef = useRef38(config);
58370
+ const tokenRef = useRef38(token);
58371
+ useEffect51(() => {
58347
58372
  configRef.current = config;
58348
58373
  });
58349
- useEffect50(() => {
58374
+ useEffect51(() => {
58350
58375
  tokenRef.current = token;
58351
58376
  });
58352
- useEffect50(() => {
58377
+ useEffect51(() => {
58353
58378
  const handleGatherRequested = (event) => {
58354
58379
  setCorrelationLoading(true);
58355
58380
  setCorrelationError(null);
@@ -58431,12 +58456,12 @@ function ResourceViewerPage({
58431
58456
  onGenerateDocument
58432
58457
  } = useYieldFlow(locale, rUri, clearNewAnnotationId);
58433
58458
  const { gatherContext, gatherLoading, gatherError } = useContextGatherFlow(eventBus, { client, resourceId: rUri });
58434
- const [wizardOpen, setWizardOpen] = useState49(false);
58435
- const [wizardAnnotationId, setWizardAnnotationId] = useState49(null);
58436
- const [wizardResourceId, setWizardResourceId] = useState49(null);
58437
- const [wizardDefaultTitle, setWizardDefaultTitle] = useState49("");
58438
- const [wizardEntityTypes, setWizardEntityTypes] = useState49([]);
58439
- useEffect51(() => {
58459
+ const [wizardOpen, setWizardOpen] = useState50(false);
58460
+ const [wizardAnnotationId, setWizardAnnotationId] = useState50(null);
58461
+ const [wizardResourceId, setWizardResourceId] = useState50(null);
58462
+ const [wizardDefaultTitle, setWizardDefaultTitle] = useState50("");
58463
+ const [wizardEntityTypes, setWizardEntityTypes] = useState50([]);
58464
+ useEffect52(() => {
58440
58465
  const subscription = eventBus.get("bind:initiate").subscribe((event) => {
58441
58466
  setWizardAnnotationId(event.annotationId);
58442
58467
  setWizardResourceId(event.resourceId);
@@ -58496,7 +58521,7 @@ function ResourceViewerPage({
58496
58521
  },
58497
58522
  500
58498
58523
  );
58499
- useEffect51(() => {
58524
+ useEffect52(() => {
58500
58525
  if (resource && rUri) {
58501
58526
  const mediaType = getPrimaryMediaType2(resource);
58502
58527
  addResource(rUri, resource.name, mediaType || void 0, resource.storageUri);
@@ -58629,12 +58654,12 @@ function ResourceViewerPage({
58629
58654
  }, []);
58630
58655
  const handleGenerationFailed = useCallback38(() => {
58631
58656
  }, []);
58632
- const handleReferenceNavigate = useCallback38(({ documentId }) => {
58633
- if (routes.resource) {
58634
- const path2 = routes.resource.replace("[resourceId]", encodeURIComponent(documentId));
58657
+ const handleReferenceNavigate = useCallback38(({ resourceId: resourceId2 }) => {
58658
+ if (routes.resourceDetail) {
58659
+ const path2 = routes.resourceDetail(resourceId2);
58635
58660
  eventBus.get("browse:router-push").next({ path: path2, reason: "reference-link" });
58636
58661
  }
58637
- }, [routes.resource]);
58662
+ }, [routes.resourceDetail]);
58638
58663
  const handleEntityTypeClicked = useCallback38(({ entityType: entityType3 }) => {
58639
58664
  if (routes.know) {
58640
58665
  const path2 = `${routes.know}?entityType=${encodeURIComponent(entityType3)}`;
@@ -58669,7 +58694,7 @@ function ResourceViewerPage({
58669
58694
  announceResourceLoading,
58670
58695
  announceResourceLoaded
58671
58696
  } = useResourceLoadingAnnouncements();
58672
- useEffect51(() => {
58697
+ useEffect52(() => {
58673
58698
  if (contentLoading) {
58674
58699
  announceResourceLoading(resource.name);
58675
58700
  } else if (content4) {
@@ -58680,7 +58705,7 @@ function ResourceViewerPage({
58680
58705
  const primaryRep = getPrimaryRepresentation(resource);
58681
58706
  const primaryMediaType = primaryRep?.mediaType;
58682
58707
  const primaryByteSize = primaryRep?.byteSize;
58683
- const [annotateMode, setAnnotateMode] = useState49(() => {
58708
+ const [annotateMode, setAnnotateMode] = useState50(() => {
58684
58709
  if (typeof window !== "undefined") {
58685
58710
  return localStorage.getItem("annotateMode") === "true";
58686
58711
  }
@@ -58770,6 +58795,7 @@ function ResourceViewerPage({
58770
58795
  referencedBy,
58771
58796
  referencedByLoading,
58772
58797
  resourceId: rUri,
58798
+ locale,
58773
58799
  scrollToAnnotationId,
58774
58800
  hoveredAnnotationId,
58775
58801
  onScrollCompleted,
@@ -58797,7 +58823,13 @@ function ResourceViewerPage({
58797
58823
  documentLocale: getLanguage(resource),
58798
58824
  primaryMediaType,
58799
58825
  primaryByteSize,
58800
- isArchived: resource.archived ?? false
58826
+ isArchived: resource.archived ?? false,
58827
+ dateCreated: resource.dateCreated,
58828
+ dateModified: resource.dateModified,
58829
+ creationMethod: resource.creationMethod,
58830
+ wasAttributedTo: resource.wasAttributedTo,
58831
+ wasDerivedFrom: resource.wasDerivedFrom,
58832
+ generator: resource.generator
58801
58833
  }
58802
58834
  ),
58803
58835
  activePanel === "collaboration" && /* @__PURE__ */ jsx89(
@@ -58843,15 +58875,9 @@ function ResourceViewerPage({
58843
58875
  configureGenerationTitle: tw("configureGenerationTitle"),
58844
58876
  configureSearchTitle: tw("configureSearchTitle"),
58845
58877
  searchResultsTitle: tw("searchResultsTitle"),
58846
- annotationLabel: tw("annotationLabel"),
58847
- sourceResourceLabel: tw("sourceResourceLabel"),
58848
- motivationLabel: tw("motivationLabel"),
58849
58878
  sourceContextLabel: tw("sourceContextLabel"),
58850
- entityTypesLabel: tw("entityTypesLabel"),
58851
- graphContextLabel: tw("graphContextLabel"),
58852
58879
  connectionsLabel: tw("connectionsLabel"),
58853
58880
  citedByLabel: tw("citedByLabel"),
58854
- siblingTypesLabel: tw("siblingTypesLabel"),
58855
58881
  userHintLabel: tw("userHintLabel"),
58856
58882
  userHintPlaceholder: tw("userHintPlaceholder"),
58857
58883
  loadingContext: tw("loadingContext"),
@@ -58861,6 +58887,7 @@ function ResourceViewerPage({
58861
58887
  searching: tw("searching"),
58862
58888
  generate: tw("generate"),
58863
58889
  compose: tw("compose"),
58890
+ resolutionStrategyLabel: tw("resolutionStrategyLabel"),
58864
58891
  back: tw("back"),
58865
58892
  link: tw("link"),
58866
58893
  score: tw("score"),