@semiont/react-ui 0.2.30-build.58 → 0.2.30-build.59
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
|
@@ -2193,12 +2193,13 @@ interface ReferenceEntryProps {
|
|
|
2193
2193
|
title: string;
|
|
2194
2194
|
prompt?: string;
|
|
2195
2195
|
}) => void;
|
|
2196
|
+
onCreateDocument?: (annotationUri: string, title: string, entityTypes: string[]) => void;
|
|
2196
2197
|
onSearchDocuments?: (referenceId: string, searchTerm: string) => void;
|
|
2197
2198
|
onUpdateReference?: (referenceId: string, updates: Partial<Annotation$6>) => void;
|
|
2198
2199
|
annotateMode?: boolean;
|
|
2199
2200
|
isGenerating?: boolean;
|
|
2200
2201
|
}
|
|
2201
|
-
declare function ReferenceEntry({ reference, isFocused, onClick, routes, onReferenceRef, onReferenceHover, onGenerateDocument, onSearchDocuments, onUpdateReference, annotateMode, isGenerating, }: ReferenceEntryProps): react_jsx_runtime.JSX.Element;
|
|
2202
|
+
declare function ReferenceEntry({ reference, isFocused, onClick, routes, onReferenceRef, onReferenceHover, onGenerateDocument, onCreateDocument, onSearchDocuments, onUpdateReference, annotateMode, isGenerating, }: ReferenceEntryProps): react_jsx_runtime.JSX.Element;
|
|
2202
2203
|
|
|
2203
2204
|
type Annotation$5 = components['schemas']['Annotation'];
|
|
2204
2205
|
type ResponseContent<T> = T extends {
|
|
@@ -2232,6 +2233,7 @@ interface Props$1 {
|
|
|
2232
2233
|
title: string;
|
|
2233
2234
|
prompt?: string;
|
|
2234
2235
|
}) => void;
|
|
2236
|
+
onCreateDocument?: (annotationUri: string, title: string, entityTypes: string[]) => void;
|
|
2235
2237
|
generatingReferenceId?: string | null;
|
|
2236
2238
|
mediaType?: string | undefined;
|
|
2237
2239
|
referencedBy?: ReferencedBy[];
|
|
@@ -2245,7 +2247,7 @@ interface Props$1 {
|
|
|
2245
2247
|
svgSelector?: string;
|
|
2246
2248
|
} | null;
|
|
2247
2249
|
}
|
|
2248
|
-
declare function ReferencesPanel({ annotations, onAnnotationClick, focusedAnnotationId, hoveredAnnotationId, onAnnotationHover, onDetect, onCreate, isDetecting, detectionProgress, annotateMode, Link, routes, allEntityTypes, onCancelDetection, onSearchDocuments, onUpdate, onGenerateDocument, generatingReferenceId, mediaType, referencedBy, referencedByLoading, pendingSelection, }: Props$1): react_jsx_runtime.JSX.Element;
|
|
2250
|
+
declare function ReferencesPanel({ annotations, onAnnotationClick, focusedAnnotationId, hoveredAnnotationId, onAnnotationHover, onDetect, onCreate, isDetecting, detectionProgress, annotateMode, Link, routes, allEntityTypes, onCancelDetection, onSearchDocuments, onUpdate, onGenerateDocument, onCreateDocument, generatingReferenceId, mediaType, referencedBy, referencedByLoading, pendingSelection, }: Props$1): react_jsx_runtime.JSX.Element;
|
|
2249
2251
|
|
|
2250
2252
|
interface Props {
|
|
2251
2253
|
documentEntityTypes: string[];
|
|
@@ -2366,6 +2368,7 @@ interface UnifiedAnnotationsPanelProps {
|
|
|
2366
2368
|
title: string;
|
|
2367
2369
|
prompt?: string;
|
|
2368
2370
|
}) => void;
|
|
2371
|
+
onCreateDocument?: (annotationUri: string, title: string, entityTypes: string[]) => void;
|
|
2369
2372
|
onSearchDocuments?: (referenceId: string, searchTerm: string) => void;
|
|
2370
2373
|
onUpdateReference?: (referenceId: string, updates: Partial<Annotation$1>) => void;
|
|
2371
2374
|
onCancelDetection?: () => void;
|
|
@@ -3419,7 +3422,7 @@ interface ResourceComposePageProps {
|
|
|
3419
3422
|
sourceContent: string;
|
|
3420
3423
|
};
|
|
3421
3424
|
referenceData?: {
|
|
3422
|
-
|
|
3425
|
+
annotationUri: string;
|
|
3423
3426
|
sourceDocumentId: string;
|
|
3424
3427
|
name: string;
|
|
3425
3428
|
entityTypes: string[];
|
|
@@ -3480,7 +3483,7 @@ interface SaveResourceParams {
|
|
|
3480
3483
|
entityTypes?: string[];
|
|
3481
3484
|
language: string;
|
|
3482
3485
|
archiveOriginal?: boolean;
|
|
3483
|
-
|
|
3486
|
+
annotationUri?: string;
|
|
3484
3487
|
sourceDocumentId?: string;
|
|
3485
3488
|
}
|
|
3486
3489
|
declare function ResourceComposePage({ mode, cloneData, referenceData, availableEntityTypes, initialLocale, theme, onThemeChange, showLineNumbers, onLineNumbersToggle, activePanel, onPanelToggle, onSaveResource, onCancel, translations: t, ToolbarPanels, Toolbar, }: ResourceComposePageProps): react_jsx_runtime.JSX.Element;
|
package/dist/index.mjs
CHANGED
|
@@ -890,6 +890,19 @@ function useAnnotations() {
|
|
|
890
890
|
onSuccess: (_data, variables) => {
|
|
891
891
|
queryClient.invalidateQueries({ queryKey: ["annotations", variables.annotationUri] });
|
|
892
892
|
queryClient.invalidateQueries({ queryKey: ["documents"] });
|
|
893
|
+
if (variables.data.operations) {
|
|
894
|
+
for (const op of variables.data.operations) {
|
|
895
|
+
if (op.op === "add" && op.item && typeof op.item === "object") {
|
|
896
|
+
if ("type" in op.item && op.item.type === "SpecificResource" && "source" in op.item && op.item.source) {
|
|
897
|
+
const targetResourceUri = op.item.source;
|
|
898
|
+
console.log(`[API Hooks] Invalidating referencedBy cache for target resource: ${targetResourceUri}`);
|
|
899
|
+
queryClient.invalidateQueries({
|
|
900
|
+
queryKey: QUERY_KEYS.documents.referencedBy(targetResourceUri)
|
|
901
|
+
});
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
}
|
|
893
906
|
}
|
|
894
907
|
})
|
|
895
908
|
},
|
|
@@ -46974,6 +46987,7 @@ function ReferenceEntry({
|
|
|
46974
46987
|
onReferenceRef,
|
|
46975
46988
|
onReferenceHover,
|
|
46976
46989
|
onGenerateDocument,
|
|
46990
|
+
onCreateDocument,
|
|
46977
46991
|
onSearchDocuments,
|
|
46978
46992
|
onUpdateReference,
|
|
46979
46993
|
annotateMode = true,
|
|
@@ -47021,7 +47035,9 @@ function ReferenceEntry({
|
|
|
47021
47035
|
}
|
|
47022
47036
|
};
|
|
47023
47037
|
const handleComposeDocument = () => {
|
|
47024
|
-
|
|
47038
|
+
if (onCreateDocument) {
|
|
47039
|
+
onCreateDocument(reference.id, selectedText, entityTypes);
|
|
47040
|
+
}
|
|
47025
47041
|
};
|
|
47026
47042
|
const handleUnlink = () => {
|
|
47027
47043
|
if (onUpdateReference) {
|
|
@@ -47157,6 +47173,7 @@ function ReferencesPanel({
|
|
|
47157
47173
|
onSearchDocuments,
|
|
47158
47174
|
onUpdate,
|
|
47159
47175
|
onGenerateDocument,
|
|
47176
|
+
onCreateDocument,
|
|
47160
47177
|
generatingReferenceId,
|
|
47161
47178
|
mediaType,
|
|
47162
47179
|
referencedBy = [],
|
|
@@ -47355,6 +47372,7 @@ function ReferencesPanel({
|
|
|
47355
47372
|
isGenerating: reference.id === generatingReferenceId,
|
|
47356
47373
|
...onAnnotationHover && { onReferenceHover: onAnnotationHover },
|
|
47357
47374
|
...onGenerateDocument && { onGenerateDocument },
|
|
47375
|
+
...onCreateDocument && { onCreateDocument },
|
|
47358
47376
|
...onSearchDocuments && { onSearchDocuments },
|
|
47359
47377
|
...onUpdate && { onUpdateReference: onUpdate }
|
|
47360
47378
|
},
|
|
@@ -48010,6 +48028,7 @@ function UnifiedAnnotationsPanel(props) {
|
|
|
48010
48028
|
onCancelDetection: props.onCancelDetection || (() => {
|
|
48011
48029
|
}),
|
|
48012
48030
|
onGenerateDocument: props.onGenerateDocument,
|
|
48031
|
+
onCreateDocument: props.onCreateDocument,
|
|
48013
48032
|
onSearchDocuments: props.onSearchDocuments,
|
|
48014
48033
|
onUpdate: props.onUpdateReference,
|
|
48015
48034
|
generatingReferenceId: props.generatingReferenceId,
|
|
@@ -55597,8 +55616,8 @@ function ResourceComposePage({
|
|
|
55597
55616
|
if (mode === "clone") {
|
|
55598
55617
|
params.archiveOriginal = archiveOriginal;
|
|
55599
55618
|
}
|
|
55600
|
-
if (referenceData?.
|
|
55601
|
-
params.
|
|
55619
|
+
if (referenceData?.annotationUri) {
|
|
55620
|
+
params.annotationUri = referenceData.annotationUri;
|
|
55602
55621
|
}
|
|
55603
55622
|
if (referenceData?.sourceDocumentId) {
|
|
55604
55623
|
params.sourceDocumentId = referenceData.sourceDocumentId;
|
|
@@ -56310,6 +56329,20 @@ function ResourceViewerPage({
|
|
|
56310
56329
|
context: options.context
|
|
56311
56330
|
});
|
|
56312
56331
|
}, [startGeneration, resource, onClearNewAnnotationId, locale]);
|
|
56332
|
+
const handleCreateDocument = useCallback29((annotationUri2, title, entityTypes) => {
|
|
56333
|
+
if (!resource) return;
|
|
56334
|
+
const resourceId = rUri.split("/").pop() || "";
|
|
56335
|
+
const entityTypesStr = entityTypes.join(",");
|
|
56336
|
+
const params = new URLSearchParams({
|
|
56337
|
+
name: title,
|
|
56338
|
+
// Compose page expects 'name' parameter
|
|
56339
|
+
annotationUri: annotationUri2,
|
|
56340
|
+
// Pass full annotation URI, not just ID
|
|
56341
|
+
sourceDocumentId: resourceId,
|
|
56342
|
+
...entityTypes.length > 0 ? { entityTypes: entityTypesStr } : {}
|
|
56343
|
+
});
|
|
56344
|
+
window.location.href = `/know/compose?${params.toString()}`;
|
|
56345
|
+
}, [resource, rUri]);
|
|
56313
56346
|
const handleSearchDocuments = useCallback29((referenceId, searchTerm2) => {
|
|
56314
56347
|
setPendingReferenceId(referenceId);
|
|
56315
56348
|
setSearchTerm(searchTerm2);
|
|
@@ -56593,6 +56626,7 @@ function ResourceViewerPage({
|
|
|
56593
56626
|
pendingReferenceSelection,
|
|
56594
56627
|
allEntityTypes,
|
|
56595
56628
|
onGenerateDocument: handleGenerateDocument,
|
|
56629
|
+
onCreateDocument: handleCreateDocument,
|
|
56596
56630
|
generatingReferenceId: generationProgress?.referenceId ?? null,
|
|
56597
56631
|
onSearchDocuments: handleSearchDocuments,
|
|
56598
56632
|
onUpdateReference: handleUpdateReference,
|