@semiont/react-ui 0.2.34-build.89 → 0.2.34-build.91

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.d.mts CHANGED
@@ -3586,10 +3586,6 @@ interface ResourceViewerPageProps {
3586
3586
  * Current locale
3587
3587
  */
3588
3588
  locale: string;
3589
- /**
3590
- * Cache manager for detection
3591
- */
3592
- cacheManager: any;
3593
3589
  /**
3594
3590
  * Link component for routing
3595
3591
  */
@@ -3636,7 +3632,7 @@ interface ResourceViewerPageProps {
3636
3632
  * @subscribes navigation:reference-navigate - Navigate to a referenced document
3637
3633
  * @subscribes navigation:entity-type-clicked - Navigate filtered by entity type
3638
3634
  */
3639
- declare function ResourceViewerPage({ resource, rUri, locale, cacheManager, Link, routes, ToolbarPanels, SearchResourcesModal, GenerationConfigModal, refetchDocument, }: ResourceViewerPageProps): react_jsx_runtime.JSX.Element;
3635
+ declare function ResourceViewerPage({ resource, rUri, locale, Link, routes, ToolbarPanels, SearchResourcesModal, GenerationConfigModal, refetchDocument, }: ResourceViewerPageProps): react_jsx_runtime.JSX.Element;
3640
3636
 
3641
3637
  /**
3642
3638
  * useAttentionFlow — Annotation attention / pointer coordination hook
@@ -3817,7 +3813,6 @@ interface GenerationFlowState {
3817
3813
  * @param resourceId - Resource ID for generation
3818
3814
  * @param showSuccess - Success toast callback
3819
3815
  * @param showError - Error toast callback
3820
- * @param cacheManager - Cache manager for invalidation
3821
3816
  * @param clearNewAnnotationId - Clear animation callback
3822
3817
  * @emits generation:start - Start document generation (consumed internally by this hook)
3823
3818
  * @emits generation:progress - SSE progress chunk from generation stream
@@ -3831,7 +3826,7 @@ interface GenerationFlowState {
3831
3826
  * @subscribes generation:failed - Error during generation
3832
3827
  * @returns Generation flow state
3833
3828
  */
3834
- declare function useGenerationFlow(locale: string, resourceId: string, showSuccess: (message: string) => void, showError: (message: string) => void, cacheManager: any, clearNewAnnotationId: (annotationId: AnnotationUri) => void): GenerationFlowState;
3829
+ declare function useGenerationFlow(locale: string, resourceId: string, showSuccess: (message: string) => void, showError: (message: string) => void, clearNewAnnotationId: (annotationId: AnnotationUri) => void): GenerationFlowState;
3835
3830
 
3836
3831
  /**
3837
3832
  * useContextRetrievalFlow - Context retrieval capability hook
package/dist/index.mjs CHANGED
@@ -18443,11 +18443,12 @@ function useResourceEvents({
18443
18443
  }
18444
18444
  setStatus("connecting");
18445
18445
  try {
18446
- const stream = client.sse.resourceEvents(rUri, {
18446
+ const sseOptions = {
18447
18447
  ...token ? { auth: accessToken2(token) } : {},
18448
18448
  eventBus
18449
18449
  // ← Stream auto-emits to EventBus
18450
- });
18450
+ };
18451
+ const stream = client.sse.resourceEvents(rUri, sseOptions);
18451
18452
  streamRef.current = stream;
18452
18453
  setStatus("connected");
18453
18454
  reconnectAttemptsRef.current = 0;
@@ -48203,7 +48204,6 @@ function UnifiedAnnotationsPanel(props) {
48203
48204
  const annotations = grouped[activeTab] || [];
48204
48205
  const isDetecting = props.detectingMotivation === annotator.motivation;
48205
48206
  const detectionProgress = props.detectionProgress;
48206
- console.log("[UnifiedAnnotationsPanel] activeTab:", activeTab, "annotator.motivation:", annotator.motivation, "props.detectingMotivation:", props.detectingMotivation, "isDetecting:", isDetecting, "detectionProgress:", detectionProgress);
48207
48207
  const commonProps = {
48208
48208
  annotations,
48209
48209
  pendingAnnotation: props.pendingAnnotation,
@@ -56598,7 +56598,6 @@ function useDetectionFlow(rUri) {
56598
56598
  const handleDetectionStart = async (event) => {
56599
56599
  const currentClient = clientRef.current;
56600
56600
  const currentRUri = rUriRef.current;
56601
- console.log("[useDetectionFlow] handleDetectionStart called", { motivation: event.motivation, options: event.options });
56602
56601
  try {
56603
56602
  if (detectionStreamRef.current) {
56604
56603
  detectionStreamRef.current.abort();
@@ -56610,13 +56609,13 @@ function useDetectionFlow(rUri) {
56610
56609
  }
56611
56610
  setDetectingMotivation(event.motivation);
56612
56611
  setDetectionProgress(null);
56613
- const auth = { auth: toAccessToken3(tokenRef.current), eventBus };
56612
+ const sseOptions = { auth: toAccessToken3(tokenRef.current), eventBus };
56614
56613
  if (event.motivation === "tagging") {
56615
56614
  const { schemaId, categories } = event.options;
56616
56615
  if (!schemaId || !categories || categories.length === 0) {
56617
56616
  throw new Error("Tag detection requires schemaId and categories");
56618
56617
  }
56619
- currentClient.sse.detectTags(currentRUri, { schemaId, categories }, auth);
56618
+ currentClient.sse.detectTags(currentRUri, { schemaId, categories }, sseOptions);
56620
56619
  } else if (event.motivation === "linking") {
56621
56620
  const { entityTypes, includeDescriptiveReferences } = event.options;
56622
56621
  if (!entityTypes || entityTypes.length === 0) {
@@ -56625,24 +56624,24 @@ function useDetectionFlow(rUri) {
56625
56624
  currentClient.sse.detectReferences(currentRUri, {
56626
56625
  entityTypes: entityTypes.map((et) => entityType2(et)),
56627
56626
  includeDescriptiveReferences: includeDescriptiveReferences || false
56628
- }, auth);
56627
+ }, sseOptions);
56629
56628
  } else if (event.motivation === "highlighting") {
56630
56629
  currentClient.sse.detectHighlights(currentRUri, {
56631
56630
  instructions: event.options.instructions,
56632
56631
  density: event.options.density
56633
- }, auth);
56632
+ }, sseOptions);
56634
56633
  } else if (event.motivation === "assessing") {
56635
56634
  currentClient.sse.detectAssessments(currentRUri, {
56636
56635
  instructions: event.options.instructions,
56637
56636
  tone: event.options.tone,
56638
56637
  density: event.options.density
56639
- }, auth);
56638
+ }, sseOptions);
56640
56639
  } else if (event.motivation === "commenting") {
56641
56640
  currentClient.sse.detectComments(currentRUri, {
56642
56641
  instructions: event.options.instructions,
56643
56642
  tone: event.options.tone,
56644
56643
  density: event.options.density
56645
- }, auth);
56644
+ }, sseOptions);
56646
56645
  }
56647
56646
  } catch (error) {
56648
56647
  if (error instanceof Error && error.name === "AbortError") {
@@ -56766,7 +56765,7 @@ import { annotationUri, accessToken as accessToken5 } from "@semiont/core";
56766
56765
  function toAccessToken4(token) {
56767
56766
  return token ? accessToken5(token) : void 0;
56768
56767
  }
56769
- function useGenerationFlow(locale, resourceId, showSuccess, showError, cacheManager, clearNewAnnotationId) {
56768
+ function useGenerationFlow(locale, resourceId, showSuccess, showError, clearNewAnnotationId) {
56770
56769
  const eventBus = useEventBus();
56771
56770
  const client = useApiClient();
56772
56771
  const token = useAuthToken();
@@ -56821,7 +56820,7 @@ function useGenerationFlow(locale, resourceId, showSuccess, showError, cacheMana
56821
56820
  setGenerationModalOpen(true);
56822
56821
  eventBus.get("context:retrieval-requested").next({ annotationUri: annUri, resourceUri: resourceUri2 });
56823
56822
  }, []);
56824
- const handleGenerationComplete = useCallback34(({ progress }) => {
56823
+ const handleGenerationComplete = useCallback34((progress) => {
56825
56824
  setGenerationProgress(progress);
56826
56825
  setIsGenerating(false);
56827
56826
  if (progress.resourceName) {
@@ -56829,11 +56828,8 @@ function useGenerationFlow(locale, resourceId, showSuccess, showError, cacheMana
56829
56828
  } else {
56830
56829
  showSuccess("Resource created successfully!");
56831
56830
  }
56832
- if (cacheManager) {
56833
- cacheManager.invalidate("annotations");
56834
- }
56835
56831
  setTimeout(() => clearProgress(), 2e3);
56836
- }, [showSuccess, cacheManager, clearProgress]);
56832
+ }, [showSuccess, clearProgress]);
56837
56833
  const handleGenerationFailed = useCallback34(({ error }) => {
56838
56834
  setGenerationProgress(null);
56839
56835
  setIsGenerating(false);
@@ -56841,20 +56837,18 @@ function useGenerationFlow(locale, resourceId, showSuccess, showError, cacheMana
56841
56837
  }, [showError]);
56842
56838
  useEffect47(() => {
56843
56839
  const handleGenerationStart = async (event) => {
56844
- console.log("[useGenerationFlow] handleGenerationStart called", { annotationUri: event.annotationUri, options: event.options });
56845
56840
  try {
56846
56841
  generationStreamRef.current?.abort();
56847
56842
  generationStreamRef.current = new AbortController();
56843
+ const sseOptions = { auth: toAccessToken4(tokenRef.current), eventBus };
56848
56844
  clientRef.current.sse.generateResourceFromAnnotation(
56849
56845
  event.resourceUri,
56850
56846
  event.annotationUri,
56851
56847
  event.options,
56852
- { auth: toAccessToken4(tokenRef.current), eventBus }
56848
+ sseOptions
56853
56849
  );
56854
56850
  } catch (error) {
56855
- if (error.name === "AbortError") {
56856
- console.log("[useGenerationFlow] Generation cancelled");
56857
- } else {
56851
+ if (error.name !== "AbortError") {
56858
56852
  console.error("[useGenerationFlow] Generation failed:", error);
56859
56853
  eventBus.get("generation:failed").next({ error });
56860
56854
  }
@@ -56968,7 +56962,6 @@ function ResourceViewerPage({
56968
56962
  resource,
56969
56963
  rUri,
56970
56964
  locale,
56971
- cacheManager,
56972
56965
  Link,
56973
56966
  routes,
56974
56967
  ToolbarPanels,
@@ -57007,7 +57000,7 @@ function ResourceViewerPage({
57007
57000
  generationDefaultTitle,
57008
57001
  onGenerateDocument,
57009
57002
  onCloseGenerationModal
57010
- } = useGenerationFlow(locale, rUri.split("/").pop() || "", showSuccess, showError, cacheManager, clearNewAnnotationId);
57003
+ } = useGenerationFlow(locale, rUri.split("/").pop() || "", showSuccess, showError, clearNewAnnotationId);
57011
57004
  const { retrievalContext, retrievalLoading, retrievalError } = useContextRetrievalFlow(eventBus, { client, resourceUri: rUri });
57012
57005
  const debouncedInvalidateAnnotations = useDebouncedCallback(
57013
57006
  () => {