@semiont/react-ui 0.2.34-build.90 → 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 +2 -7
- package/dist/index.mjs +5 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +0 -2
- package/src/features/resource-viewer/__tests__/GenerationFlowIntegration.test.tsx +14 -20
- package/src/features/resource-viewer/components/ResourceViewerPage.tsx +1 -7
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,
|
|
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,
|
|
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
|
@@ -48204,7 +48204,6 @@ function UnifiedAnnotationsPanel(props) {
|
|
|
48204
48204
|
const annotations = grouped[activeTab] || [];
|
|
48205
48205
|
const isDetecting = props.detectingMotivation === annotator.motivation;
|
|
48206
48206
|
const detectionProgress = props.detectionProgress;
|
|
48207
|
-
console.log("[UnifiedAnnotationsPanel] activeTab:", activeTab, "annotator.motivation:", annotator.motivation, "props.detectingMotivation:", props.detectingMotivation, "isDetecting:", isDetecting, "detectionProgress:", detectionProgress);
|
|
48208
48207
|
const commonProps = {
|
|
48209
48208
|
annotations,
|
|
48210
48209
|
pendingAnnotation: props.pendingAnnotation,
|
|
@@ -56599,7 +56598,6 @@ function useDetectionFlow(rUri) {
|
|
|
56599
56598
|
const handleDetectionStart = async (event) => {
|
|
56600
56599
|
const currentClient = clientRef.current;
|
|
56601
56600
|
const currentRUri = rUriRef.current;
|
|
56602
|
-
console.log("[useDetectionFlow] handleDetectionStart called", { motivation: event.motivation, options: event.options });
|
|
56603
56601
|
try {
|
|
56604
56602
|
if (detectionStreamRef.current) {
|
|
56605
56603
|
detectionStreamRef.current.abort();
|
|
@@ -56767,7 +56765,7 @@ import { annotationUri, accessToken as accessToken5 } from "@semiont/core";
|
|
|
56767
56765
|
function toAccessToken4(token) {
|
|
56768
56766
|
return token ? accessToken5(token) : void 0;
|
|
56769
56767
|
}
|
|
56770
|
-
function useGenerationFlow(locale, resourceId, showSuccess, showError,
|
|
56768
|
+
function useGenerationFlow(locale, resourceId, showSuccess, showError, clearNewAnnotationId) {
|
|
56771
56769
|
const eventBus = useEventBus();
|
|
56772
56770
|
const client = useApiClient();
|
|
56773
56771
|
const token = useAuthToken();
|
|
@@ -56822,7 +56820,7 @@ function useGenerationFlow(locale, resourceId, showSuccess, showError, cacheMana
|
|
|
56822
56820
|
setGenerationModalOpen(true);
|
|
56823
56821
|
eventBus.get("context:retrieval-requested").next({ annotationUri: annUri, resourceUri: resourceUri2 });
|
|
56824
56822
|
}, []);
|
|
56825
|
-
const handleGenerationComplete = useCallback34((
|
|
56823
|
+
const handleGenerationComplete = useCallback34((progress) => {
|
|
56826
56824
|
setGenerationProgress(progress);
|
|
56827
56825
|
setIsGenerating(false);
|
|
56828
56826
|
if (progress.resourceName) {
|
|
@@ -56830,11 +56828,8 @@ function useGenerationFlow(locale, resourceId, showSuccess, showError, cacheMana
|
|
|
56830
56828
|
} else {
|
|
56831
56829
|
showSuccess("Resource created successfully!");
|
|
56832
56830
|
}
|
|
56833
|
-
if (cacheManager) {
|
|
56834
|
-
cacheManager.invalidate("annotations");
|
|
56835
|
-
}
|
|
56836
56831
|
setTimeout(() => clearProgress(), 2e3);
|
|
56837
|
-
}, [showSuccess,
|
|
56832
|
+
}, [showSuccess, clearProgress]);
|
|
56838
56833
|
const handleGenerationFailed = useCallback34(({ error }) => {
|
|
56839
56834
|
setGenerationProgress(null);
|
|
56840
56835
|
setIsGenerating(false);
|
|
@@ -56842,7 +56837,6 @@ function useGenerationFlow(locale, resourceId, showSuccess, showError, cacheMana
|
|
|
56842
56837
|
}, [showError]);
|
|
56843
56838
|
useEffect47(() => {
|
|
56844
56839
|
const handleGenerationStart = async (event) => {
|
|
56845
|
-
console.log("[useGenerationFlow] handleGenerationStart called", { annotationUri: event.annotationUri, options: event.options });
|
|
56846
56840
|
try {
|
|
56847
56841
|
generationStreamRef.current?.abort();
|
|
56848
56842
|
generationStreamRef.current = new AbortController();
|
|
@@ -56854,9 +56848,7 @@ function useGenerationFlow(locale, resourceId, showSuccess, showError, cacheMana
|
|
|
56854
56848
|
sseOptions
|
|
56855
56849
|
);
|
|
56856
56850
|
} catch (error) {
|
|
56857
|
-
if (error.name
|
|
56858
|
-
console.log("[useGenerationFlow] Generation cancelled");
|
|
56859
|
-
} else {
|
|
56851
|
+
if (error.name !== "AbortError") {
|
|
56860
56852
|
console.error("[useGenerationFlow] Generation failed:", error);
|
|
56861
56853
|
eventBus.get("generation:failed").next({ error });
|
|
56862
56854
|
}
|
|
@@ -56970,7 +56962,6 @@ function ResourceViewerPage({
|
|
|
56970
56962
|
resource,
|
|
56971
56963
|
rUri,
|
|
56972
56964
|
locale,
|
|
56973
|
-
cacheManager,
|
|
56974
56965
|
Link,
|
|
56975
56966
|
routes,
|
|
56976
56967
|
ToolbarPanels,
|
|
@@ -57009,7 +57000,7 @@ function ResourceViewerPage({
|
|
|
57009
57000
|
generationDefaultTitle,
|
|
57010
57001
|
onGenerateDocument,
|
|
57011
57002
|
onCloseGenerationModal
|
|
57012
|
-
} = useGenerationFlow(locale, rUri.split("/").pop() || "", showSuccess, showError,
|
|
57003
|
+
} = useGenerationFlow(locale, rUri.split("/").pop() || "", showSuccess, showError, clearNewAnnotationId);
|
|
57013
57004
|
const { retrievalContext, retrievalLoading, retrievalError } = useContextRetrievalFlow(eventBus, { client, resourceUri: rUri });
|
|
57014
57005
|
const debouncedInvalidateAnnotations = useDebouncedCallback(
|
|
57015
57006
|
() => {
|