@semiont/react-ui 0.4.21 → 0.4.22
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/{PdfAnnotationCanvas.client-6ZGFEN2N.mjs → PdfAnnotationCanvas.client-5QESNO5H.mjs} +10 -9
- package/dist/PdfAnnotationCanvas.client-5QESNO5H.mjs.map +1 -0
- package/dist/{chunk-KEDFYI6N.mjs → chunk-4NOUO3W6.mjs} +2 -2
- package/dist/{chunk-KEDFYI6N.mjs.map → chunk-4NOUO3W6.mjs.map} +1 -1
- package/dist/index.d.mts +54 -79
- package/dist/index.mjs +255 -254
- package/dist/index.mjs.map +1 -1
- package/dist/test-utils.d.mts +3 -1
- package/dist/test-utils.mjs +14 -8
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +2 -1
- package/src/components/AnnotateReferencesProgressWidget.tsx +1 -1
- package/src/components/CodeMirrorRenderer.tsx +5 -3
- package/src/components/LiveRegion.tsx +1 -2
- package/src/components/StatusDisplay.tsx +1 -1
- package/src/components/__tests__/StatusDisplay.test.tsx +3 -1
- package/src/components/annotation/AnnotateToolbar.tsx +5 -7
- package/src/components/annotation-popups/JsonLdView.tsx +1 -2
- package/src/components/annotation-popups/__tests__/JsonLdView.test.tsx +1 -1
- package/src/components/image-annotation/AnnotationOverlay.tsx +12 -14
- package/src/components/image-annotation/SvgDrawingCanvas.tsx +8 -13
- package/src/components/modals/ConfigureGenerationStep.tsx +1 -2
- package/src/components/modals/ReferenceWizardModal.tsx +1 -1
- package/src/components/modals/ResourceSearchModal.tsx +3 -3
- package/src/components/modals/SearchModal.tsx +2 -1
- package/src/components/modals/SearchResultsStep.tsx +1 -3
- package/src/components/modals/__tests__/SearchModal.accessibility.test.tsx +6 -2
- package/src/components/modals/__tests__/SearchModal.basic.test.tsx +6 -2
- package/src/components/modals/__tests__/SearchModal.keyboard.test.tsx +6 -2
- package/src/components/modals/__tests__/SearchModal.visual.test.tsx +6 -2
- package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +11 -12
- package/src/components/pdf-annotation/__tests__/PdfAnnotationCanvas.test.tsx +1 -1
- package/src/components/resource/AnnotateView.tsx +2 -5
- package/src/components/resource/BrowseView.tsx +6 -4
- package/src/components/resource/ResourceViewer.tsx +7 -11
- package/src/components/resource/__tests__/BrowseView.test.tsx +4 -4
- package/src/components/resource/__tests__/ResourceViewer.mode-switch.test.tsx +1 -0
- package/src/components/resource/__tests__/event-formatting.test.ts +6 -2
- package/src/components/resource/event-formatting.ts +2 -3
- package/src/components/resource/panels/AssessmentEntry.tsx +3 -5
- package/src/components/resource/panels/AssessmentPanel.tsx +5 -5
- package/src/components/resource/panels/AssistSection.tsx +6 -10
- package/src/components/resource/panels/CollaborationPanel.tsx +1 -1
- package/src/components/resource/panels/CommentEntry.tsx +3 -5
- package/src/components/resource/panels/CommentsPanel.tsx +5 -5
- package/src/components/resource/panels/HighlightEntry.tsx +3 -5
- package/src/components/resource/panels/HighlightPanel.tsx +3 -3
- package/src/components/resource/panels/ReferenceEntry.tsx +7 -9
- package/src/components/resource/panels/ReferencesPanel.tsx +8 -11
- package/src/components/resource/panels/ResourceInfoPanel.tsx +5 -5
- package/src/components/resource/panels/StatisticsPanel.tsx +2 -3
- package/src/components/resource/panels/TagEntry.tsx +3 -5
- package/src/components/resource/panels/TaggingPanel.tsx +8 -11
- package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +1 -1
- package/src/components/resource/panels/__tests__/AssessmentEntry.test.tsx +4 -4
- package/src/components/resource/panels/__tests__/AssessmentPanel.test.tsx +4 -5
- package/src/components/resource/panels/__tests__/CommentEntry.test.tsx +4 -4
- package/src/components/resource/panels/__tests__/CommentsPanel.test.tsx +4 -5
- package/src/components/resource/panels/__tests__/HighlightEntry.test.tsx +4 -4
- package/src/components/resource/panels/__tests__/HighlightPanel.annotationProgress.test.tsx +1 -1
- package/src/components/resource/panels/__tests__/ReferenceEntry.test.tsx +4 -4
- package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +21 -14
- package/src/components/resource/panels/__tests__/StatisticsPanel.test.tsx +3 -3
- package/src/components/resource/panels/__tests__/TagEntry.test.tsx +4 -4
- package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +4 -5
- package/src/components/settings/SettingsPanel.tsx +1 -1
- package/src/components/settings/__tests__/SettingsPanel.test.tsx +3 -3
- package/src/features/admin-devops/components/AdminDevOpsPage.tsx +1 -2
- package/src/features/admin-exchange/components/AdminExchangePage.tsx +1 -1
- package/src/features/admin-exchange/components/ImportCard.tsx +1 -2
- package/src/features/admin-security/components/AdminSecurityPage.tsx +1 -2
- package/src/features/admin-users/components/AdminUsersPage.tsx +1 -1
- package/src/features/moderate-entity-tags/components/EntityTagsPage.tsx +1 -2
- package/src/features/moderate-recent/components/RecentDocumentsPage.tsx +1 -2
- package/src/features/moderate-tag-schemas/components/TagSchemasPage.tsx +1 -1
- package/src/features/moderation-linked-data/components/LinkedDataPage.tsx +1 -1
- package/src/features/resource-compose/components/ResourceComposePage.tsx +3 -2
- package/src/features/resource-discovery/components/ResourceCard.tsx +1 -2
- package/src/features/resource-discovery/components/ResourceDiscoveryPage.tsx +3 -4
- package/src/features/resource-viewer/__tests__/ResourceViewerPage.test.tsx +4 -5
- package/src/features/resource-viewer/components/ResourceViewerPage.tsx +12 -11
- package/dist/PdfAnnotationCanvas.client-6ZGFEN2N.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -123,7 +123,7 @@ import {
|
|
|
123
123
|
useSemiont,
|
|
124
124
|
useToast,
|
|
125
125
|
useTranslations
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-4NOUO3W6.mjs";
|
|
127
127
|
import "./chunk-NOD3NCXE.mjs";
|
|
128
128
|
import {
|
|
129
129
|
__commonJS,
|
|
@@ -982,7 +982,7 @@ var require_operators = __commonJS({
|
|
|
982
982
|
});
|
|
983
983
|
|
|
984
984
|
// src/lib/annotation-registry.ts
|
|
985
|
-
import { isHighlight, isComment, isReference, isTag } from "@semiont/
|
|
985
|
+
import { isHighlight, isComment, isReference, isTag } from "@semiont/core";
|
|
986
986
|
var ANNOTATORS = {
|
|
987
987
|
highlight: {
|
|
988
988
|
motivation: "highlighting",
|
|
@@ -17350,7 +17350,7 @@ var jsonLightHighlightStyle = HighlightStyle.define([
|
|
|
17350
17350
|
]);
|
|
17351
17351
|
|
|
17352
17352
|
// src/lib/codemirror-widgets.ts
|
|
17353
|
-
import { isResolvedReference, getBodySource } from "@semiont/
|
|
17353
|
+
import { isResolvedReference, getBodySource } from "@semiont/core";
|
|
17354
17354
|
var ReferenceResolutionWidget = class extends WidgetType {
|
|
17355
17355
|
constructor(annotation, targetDocumentName, isGenerating) {
|
|
17356
17356
|
super();
|
|
@@ -17482,7 +17482,7 @@ function hideWidgetPreview(container) {
|
|
|
17482
17482
|
}
|
|
17483
17483
|
|
|
17484
17484
|
// src/lib/media-shapes.ts
|
|
17485
|
-
import { isPdfMimeType } from "@semiont/
|
|
17485
|
+
import { isPdfMimeType } from "@semiont/core";
|
|
17486
17486
|
function getSupportedShapes(mediaType) {
|
|
17487
17487
|
if (!mediaType) {
|
|
17488
17488
|
return ["rectangle", "circle", "polygon"];
|
|
@@ -17532,10 +17532,10 @@ function saveSelectedShapeForSelectorType(selectorType, shape) {
|
|
|
17532
17532
|
}
|
|
17533
17533
|
|
|
17534
17534
|
// src/index.ts
|
|
17535
|
-
import { createSearchPipeline as createSearchPipeline3 } from "@semiont/
|
|
17535
|
+
import { createSearchPipeline as createSearchPipeline3 } from "@semiont/sdk";
|
|
17536
17536
|
|
|
17537
17537
|
// src/lib/annotation-overlay.ts
|
|
17538
|
-
import { getTextPositionSelector, getTargetSelector, getExactText, getBodySource as getBodySource2 } from "@semiont/
|
|
17538
|
+
import { getTextPositionSelector, getTargetSelector, getExactText, getBodySource as getBodySource2 } from "@semiont/core";
|
|
17539
17539
|
function buildSourceToRenderedMap(markdownSource, container) {
|
|
17540
17540
|
const walker = document.createTreeWalker(container, NodeFilter.SHOW_TEXT);
|
|
17541
17541
|
let renderedText = "";
|
|
@@ -17915,7 +17915,7 @@ function getTagSchemaId(annotation) {
|
|
|
17915
17915
|
}
|
|
17916
17916
|
|
|
17917
17917
|
// src/lib/validation.ts
|
|
17918
|
-
import { isValidEmail } from "@semiont/
|
|
17918
|
+
import { isValidEmail } from "@semiont/core";
|
|
17919
17919
|
var ImageURLSchema = {
|
|
17920
17920
|
parse(url) {
|
|
17921
17921
|
if (typeof url !== "string") {
|
|
@@ -18215,7 +18215,7 @@ import { useState as useState5, useCallback as useCallback5 } from "react";
|
|
|
18215
18215
|
|
|
18216
18216
|
// src/hooks/useHoverEmitter.ts
|
|
18217
18217
|
import { useRef as useRef3, useCallback as useCallback4, useEffect as useEffect5 } from "react";
|
|
18218
|
-
import { HOVER_DELAY_MS } from "@semiont/
|
|
18218
|
+
import { HOVER_DELAY_MS } from "@semiont/sdk";
|
|
18219
18219
|
|
|
18220
18220
|
// src/hooks/useObservable.ts
|
|
18221
18221
|
import { useState as useState4, useEffect as useEffect4 } from "react";
|
|
@@ -18234,22 +18234,22 @@ function useObservable(obs$) {
|
|
|
18234
18234
|
}
|
|
18235
18235
|
|
|
18236
18236
|
// src/hooks/useHoverEmitter.ts
|
|
18237
|
-
import { HOVER_DELAY_MS as HOVER_DELAY_MS2 } from "@semiont/
|
|
18238
|
-
function useHoverEmitter(
|
|
18237
|
+
import { HOVER_DELAY_MS as HOVER_DELAY_MS2 } from "@semiont/sdk";
|
|
18238
|
+
function useHoverEmitter(annotationId2, hoverDelayMs = HOVER_DELAY_MS) {
|
|
18239
18239
|
const session = useObservable(useSemiont().activeSession$);
|
|
18240
18240
|
const currentHoverRef = useRef3(null);
|
|
18241
18241
|
const timerRef = useRef3(null);
|
|
18242
18242
|
const onMouseEnter = useCallback4(() => {
|
|
18243
|
-
if (currentHoverRef.current ===
|
|
18243
|
+
if (currentHoverRef.current === annotationId2) return;
|
|
18244
18244
|
if (timerRef.current !== null) {
|
|
18245
18245
|
clearTimeout(timerRef.current);
|
|
18246
18246
|
}
|
|
18247
18247
|
timerRef.current = setTimeout(() => {
|
|
18248
18248
|
timerRef.current = null;
|
|
18249
|
-
currentHoverRef.current =
|
|
18250
|
-
session?.client.
|
|
18249
|
+
currentHoverRef.current = annotationId2;
|
|
18250
|
+
session?.client.beckon.hover(annotationId2);
|
|
18251
18251
|
}, hoverDelayMs);
|
|
18252
|
-
}, [
|
|
18252
|
+
}, [annotationId2, hoverDelayMs, session]);
|
|
18253
18253
|
const onMouseLeave = useCallback4(() => {
|
|
18254
18254
|
if (timerRef.current !== null) {
|
|
18255
18255
|
clearTimeout(timerRef.current);
|
|
@@ -18257,7 +18257,7 @@ function useHoverEmitter(annotationId3, hoverDelayMs = HOVER_DELAY_MS) {
|
|
|
18257
18257
|
}
|
|
18258
18258
|
if (currentHoverRef.current !== null) {
|
|
18259
18259
|
currentHoverRef.current = null;
|
|
18260
|
-
session?.client.
|
|
18260
|
+
session?.client.beckon.hover(null);
|
|
18261
18261
|
}
|
|
18262
18262
|
}, [session]);
|
|
18263
18263
|
useEffect5(() => {
|
|
@@ -18655,7 +18655,8 @@ function useLocalStorage(key, initialValue) {
|
|
|
18655
18655
|
|
|
18656
18656
|
// src/hooks/useResourceContent.ts
|
|
18657
18657
|
import { useEffect as useEffect11, useState as useState10 } from "react";
|
|
18658
|
-
import { getPrimaryMediaType
|
|
18658
|
+
import { getPrimaryMediaType } from "@semiont/core";
|
|
18659
|
+
import { decodeWithCharset } from "@semiont/core";
|
|
18659
18660
|
function useResourceContent(rUri, resource, enabled = true) {
|
|
18660
18661
|
const { showError } = useToast();
|
|
18661
18662
|
const semiont = useObservable(useSemiont().activeSession$)?.client;
|
|
@@ -18664,17 +18665,23 @@ function useResourceContent(rUri, resource, enabled = true) {
|
|
|
18664
18665
|
const [loading, setLoading] = useState10(false);
|
|
18665
18666
|
useEffect11(() => {
|
|
18666
18667
|
if (!semiont || !enabled || !mediaType) return;
|
|
18668
|
+
let cancelled = false;
|
|
18667
18669
|
setLoading(true);
|
|
18668
|
-
semiont.
|
|
18670
|
+
semiont.browse.resourceRepresentation(rUri, {
|
|
18669
18671
|
accept: mediaType
|
|
18670
18672
|
}).then(({ data: data2 }) => {
|
|
18673
|
+
if (cancelled) return;
|
|
18671
18674
|
setContent(decodeWithCharset(data2, mediaType));
|
|
18672
18675
|
setLoading(false);
|
|
18673
18676
|
}).catch((error) => {
|
|
18677
|
+
if (cancelled) return;
|
|
18674
18678
|
console.error("Failed to fetch representation:", error);
|
|
18675
18679
|
showError("Failed to load resource representation");
|
|
18676
18680
|
setLoading(false);
|
|
18677
18681
|
});
|
|
18682
|
+
return () => {
|
|
18683
|
+
cancelled = true;
|
|
18684
|
+
};
|
|
18678
18685
|
}, [semiont, rUri, mediaType, enabled, showError]);
|
|
18679
18686
|
return { content: content4, loading };
|
|
18680
18687
|
}
|
|
@@ -18707,7 +18714,7 @@ function useEventSubscription(eventName, handler) {
|
|
|
18707
18714
|
const unsubs = [];
|
|
18708
18715
|
unsubs.push(semiont.on(eventName, (payload) => handlerRef.current(payload)));
|
|
18709
18716
|
if (session) {
|
|
18710
|
-
unsubs.push(session.
|
|
18717
|
+
unsubs.push(session.subscribe(eventName, (payload) => handlerRef.current(payload)));
|
|
18711
18718
|
}
|
|
18712
18719
|
return () => {
|
|
18713
18720
|
for (const u12 of unsubs) u12();
|
|
@@ -18736,7 +18743,7 @@ function useEventSubscriptions(subscriptions) {
|
|
|
18736
18743
|
};
|
|
18737
18744
|
unsubs.push(semiont.on(channel, fan));
|
|
18738
18745
|
if (session) {
|
|
18739
|
-
unsubs.push(session.
|
|
18746
|
+
unsubs.push(session.subscribe(channel, fan));
|
|
18740
18747
|
}
|
|
18741
18748
|
}
|
|
18742
18749
|
return () => {
|
|
@@ -18923,7 +18930,7 @@ function ResourceAnnotationsProvider({ children }) {
|
|
|
18923
18930
|
},
|
|
18924
18931
|
body
|
|
18925
18932
|
};
|
|
18926
|
-
const result = await semiont.
|
|
18933
|
+
const result = await semiont.mark.annotation(rUri, createData);
|
|
18927
18934
|
if (result.annotationId) {
|
|
18928
18935
|
setNewAnnotationIds((prev) => new Set(prev).add(result.annotationId));
|
|
18929
18936
|
setTimeout(() => {
|
|
@@ -18949,12 +18956,12 @@ function ResourceAnnotationsProvider({ children }) {
|
|
|
18949
18956
|
return next;
|
|
18950
18957
|
});
|
|
18951
18958
|
}, []);
|
|
18952
|
-
const triggerSparkleAnimation = useCallback10((
|
|
18953
|
-
setNewAnnotationIds((prev) => new Set(prev).add(
|
|
18959
|
+
const triggerSparkleAnimation = useCallback10((annotationId2) => {
|
|
18960
|
+
setNewAnnotationIds((prev) => new Set(prev).add(annotationId2));
|
|
18954
18961
|
setTimeout(() => {
|
|
18955
18962
|
setNewAnnotationIds((prev) => {
|
|
18956
18963
|
const next = new Set(prev);
|
|
18957
|
-
next.delete(
|
|
18964
|
+
next.delete(annotationId2);
|
|
18958
18965
|
return next;
|
|
18959
18966
|
});
|
|
18960
18967
|
}, 6e3);
|
|
@@ -26314,11 +26321,11 @@ var pasteURLAsLink = /* @__PURE__ */ EditorView.domEventHandlers({
|
|
|
26314
26321
|
});
|
|
26315
26322
|
|
|
26316
26323
|
// src/lib/scroll-utils.ts
|
|
26317
|
-
function scrollAnnotationIntoView(
|
|
26318
|
-
if (!
|
|
26324
|
+
function scrollAnnotationIntoView(annotationId2, rootElement, options = {}) {
|
|
26325
|
+
if (!annotationId2) return false;
|
|
26319
26326
|
const { pulse = false, behavior = "smooth" } = options;
|
|
26320
26327
|
const element2 = rootElement.querySelector(
|
|
26321
|
-
`[data-annotation-id="${CSS.escape(
|
|
26328
|
+
`[data-annotation-id="${CSS.escape(annotationId2)}"]`
|
|
26322
26329
|
);
|
|
26323
26330
|
if (!element2) return false;
|
|
26324
26331
|
const scrollContainer = element2.closest(".semiont-browse-view__content") || element2.closest(".semiont-annotate-view__content") || element2.closest(".semiont-document-viewer__scrollable-body");
|
|
@@ -26344,10 +26351,12 @@ function scrollAnnotationIntoView(annotationId3, rootElement, options = {}) {
|
|
|
26344
26351
|
}
|
|
26345
26352
|
|
|
26346
26353
|
// src/components/CodeMirrorRenderer.tsx
|
|
26347
|
-
import {
|
|
26354
|
+
import { annotationId as toAnnotationId2 } from "@semiont/core";
|
|
26355
|
+
import { isReference as isReference3 } from "@semiont/core";
|
|
26356
|
+
import { createHoverHandlers } from "@semiont/sdk";
|
|
26348
26357
|
|
|
26349
26358
|
// src/lib/codemirror-logic.ts
|
|
26350
|
-
import { isHighlight as isHighlight2, isReference as isReference2, isResolvedReference as isResolvedReference2, isComment as isComment2, isAssessment, isTag as isTag3, getBodySource as getBodySource3 } from "@semiont/
|
|
26359
|
+
import { isHighlight as isHighlight2, isReference as isReference2, isResolvedReference as isResolvedReference2, isComment as isComment2, isAssessment, isTag as isTag3, getBodySource as getBodySource3 } from "@semiont/core";
|
|
26351
26360
|
function convertSegmentPositions(segments, content4) {
|
|
26352
26361
|
if (!content4.includes("\r\n")) {
|
|
26353
26362
|
return segments;
|
|
@@ -26445,16 +26454,14 @@ function computeWidgetDecorations(segments, generatingReferenceId, getTargetReso
|
|
|
26445
26454
|
}
|
|
26446
26455
|
|
|
26447
26456
|
// src/lib/codemirror-handlers.ts
|
|
26457
|
+
import { annotationId as toAnnotationId, resourceId as toResourceId } from "@semiont/core";
|
|
26448
26458
|
function handleAnnotationClick(target, segmentsById, session) {
|
|
26449
26459
|
const annotationElement = target.closest("[data-annotation-id]");
|
|
26450
|
-
const
|
|
26451
|
-
if (!
|
|
26452
|
-
const segment = segmentsById.get(
|
|
26460
|
+
const annotationId2 = annotationElement?.getAttribute("data-annotation-id");
|
|
26461
|
+
if (!annotationId2) return false;
|
|
26462
|
+
const segment = segmentsById.get(annotationId2);
|
|
26453
26463
|
if (!segment?.annotation) return false;
|
|
26454
|
-
session.client.
|
|
26455
|
-
annotationId: annotationId3,
|
|
26456
|
-
motivation: segment.annotation.motivation
|
|
26457
|
-
});
|
|
26464
|
+
session.client.browse.click(toAnnotationId(annotationId2), segment.annotation.motivation);
|
|
26458
26465
|
return true;
|
|
26459
26466
|
}
|
|
26460
26467
|
function handleWidgetClick(target) {
|
|
@@ -26462,34 +26469,31 @@ function handleWidgetClick(target) {
|
|
|
26462
26469
|
if (!widget || widget.dataset.widgetGenerating === "true") {
|
|
26463
26470
|
return { handled: false };
|
|
26464
26471
|
}
|
|
26465
|
-
const
|
|
26472
|
+
const annotationId2 = widget.dataset.widgetAnnotationId;
|
|
26466
26473
|
const bodySource = widget.dataset.widgetBodySource;
|
|
26467
26474
|
const isResolved = widget.dataset.widgetResolved === "true";
|
|
26468
|
-
if (!
|
|
26475
|
+
if (!annotationId2) return { handled: false };
|
|
26469
26476
|
if (isResolved && bodySource) {
|
|
26470
26477
|
return {
|
|
26471
26478
|
handled: true,
|
|
26472
26479
|
action: "navigate",
|
|
26473
26480
|
resourceId: bodySource,
|
|
26474
|
-
annotationId:
|
|
26481
|
+
annotationId: annotationId2
|
|
26475
26482
|
};
|
|
26476
26483
|
}
|
|
26477
26484
|
return {
|
|
26478
26485
|
handled: true,
|
|
26479
26486
|
action: "browse-click",
|
|
26480
|
-
annotationId:
|
|
26487
|
+
annotationId: annotationId2,
|
|
26481
26488
|
motivation: widget.dataset.widgetMotivation || "linking"
|
|
26482
26489
|
};
|
|
26483
26490
|
}
|
|
26484
26491
|
function dispatchWidgetClick(result, session) {
|
|
26485
26492
|
if (!result.handled) return;
|
|
26486
26493
|
if (result.action === "navigate" && result.resourceId) {
|
|
26487
|
-
session.client.
|
|
26494
|
+
session.client.browse.navigateReference(toResourceId(result.resourceId));
|
|
26488
26495
|
} else if (result.action === "browse-click" && result.annotationId) {
|
|
26489
|
-
session.client.
|
|
26490
|
-
annotationId: result.annotationId,
|
|
26491
|
-
motivation: result.motivation || "linking"
|
|
26492
|
-
});
|
|
26496
|
+
session.client.browse.click(toAnnotationId(result.annotationId), result.motivation || "linking");
|
|
26493
26497
|
}
|
|
26494
26498
|
}
|
|
26495
26499
|
function handleWidgetMouseEnter(target) {
|
|
@@ -26713,14 +26717,14 @@ function CodeMirrorRenderer({
|
|
|
26713
26717
|
containerRef.current.__cmView = view;
|
|
26714
26718
|
const container = view.dom;
|
|
26715
26719
|
const { handleMouseEnter, handleMouseLeave, cleanup: cleanupHover } = createHoverHandlers(
|
|
26716
|
-
(
|
|
26720
|
+
(id2) => sessionRef.current?.client.beckon.hover(id2),
|
|
26717
26721
|
hoverDelayMs
|
|
26718
26722
|
);
|
|
26719
26723
|
const handleMouseOver = (e6) => {
|
|
26720
26724
|
const target = e6.target;
|
|
26721
26725
|
const annotationElement = target.closest("[data-annotation-id]");
|
|
26722
|
-
const
|
|
26723
|
-
if (
|
|
26726
|
+
const annotationId2 = annotationElement?.getAttribute("data-annotation-id");
|
|
26727
|
+
if (annotationId2) handleMouseEnter(toAnnotationId2(annotationId2));
|
|
26724
26728
|
};
|
|
26725
26729
|
const handleMouseOut = (e6) => {
|
|
26726
26730
|
const target = e6.target;
|
|
@@ -26848,7 +26852,7 @@ function AnnotateReferencesProgressWidget({ progress, annotationType = "referenc
|
|
|
26848
26852
|
const t12 = useTranslations("ReferencesPanel");
|
|
26849
26853
|
const session = useObservable(useSemiont().activeSession$);
|
|
26850
26854
|
const handleCancel = () => {
|
|
26851
|
-
session?.client.
|
|
26855
|
+
session?.client.job.cancelRequest("annotation");
|
|
26852
26856
|
};
|
|
26853
26857
|
if (!progress) return null;
|
|
26854
26858
|
return /* @__PURE__ */ jsxs2(
|
|
@@ -27310,7 +27314,7 @@ function Toolbar({
|
|
|
27310
27314
|
|
|
27311
27315
|
// src/components/settings/SettingsPanel.tsx
|
|
27312
27316
|
import React5, { useEffect as useEffect15 } from "react";
|
|
27313
|
-
import { LOCALES } from "@semiont/
|
|
27317
|
+
import { LOCALES } from "@semiont/core";
|
|
27314
27318
|
import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
27315
27319
|
function SettingsPanel({
|
|
27316
27320
|
showLineNumbers,
|
|
@@ -27569,27 +27573,25 @@ function AnnotateToolbar({
|
|
|
27569
27573
|
}, []);
|
|
27570
27574
|
const handleSelectionClick = (motivation) => {
|
|
27571
27575
|
if (motivation === null) {
|
|
27572
|
-
session?.client.
|
|
27576
|
+
session?.client.mark.changeSelection(null);
|
|
27573
27577
|
} else {
|
|
27574
|
-
session?.client.
|
|
27575
|
-
motivation: selectedMotivation === motivation ? null : motivation
|
|
27576
|
-
});
|
|
27578
|
+
session?.client.mark.changeSelection(selectedMotivation === motivation ? null : motivation);
|
|
27577
27579
|
}
|
|
27578
27580
|
setSelectionPinned(false);
|
|
27579
27581
|
setSelectionHovered(false);
|
|
27580
27582
|
};
|
|
27581
27583
|
const handleClickClick = (action) => {
|
|
27582
|
-
session?.client.
|
|
27584
|
+
session?.client.mark.changeClick(action);
|
|
27583
27585
|
setClickPinned(false);
|
|
27584
27586
|
setClickHovered(false);
|
|
27585
27587
|
};
|
|
27586
27588
|
const handleShapeClick = (shape) => {
|
|
27587
|
-
session?.client.
|
|
27589
|
+
session?.client.mark.changeShape(shape);
|
|
27588
27590
|
setShapePinned(false);
|
|
27589
27591
|
setShapeHovered(false);
|
|
27590
27592
|
};
|
|
27591
27593
|
const handleModeToggle = () => {
|
|
27592
|
-
session?.client.
|
|
27594
|
+
session?.client.mark.toggleMode();
|
|
27593
27595
|
setModePinned(false);
|
|
27594
27596
|
setModeHovered(false);
|
|
27595
27597
|
};
|
|
@@ -29622,8 +29624,9 @@ function PopupContainer({ children, position: position3, onClose, isOpen, wide =
|
|
|
29622
29624
|
|
|
29623
29625
|
// src/components/image-annotation/AnnotationOverlay.tsx
|
|
29624
29626
|
import { useMemo as useMemo3 } from "react";
|
|
29625
|
-
import {
|
|
29626
|
-
import {
|
|
29627
|
+
import { getSvgSelector, isHighlight as isHighlight3, isReference as isReference4, isAssessment as isAssessment2, isComment as isComment3, isTag as isTag4, isBodyResolved, isResolvedReference as isResolvedReference3 } from "@semiont/core";
|
|
29628
|
+
import { createHoverHandlers as createHoverHandlers2 } from "@semiont/sdk";
|
|
29629
|
+
import { parseSvgSelector } from "@semiont/core";
|
|
29627
29630
|
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
29628
29631
|
function getAnnotationColor(annotation) {
|
|
29629
29632
|
if (isHighlight3(annotation)) {
|
|
@@ -29669,7 +29672,7 @@ function AnnotationOverlay({
|
|
|
29669
29672
|
const scaleX = displayWidth / imageWidth;
|
|
29670
29673
|
const scaleY = displayHeight / imageHeight;
|
|
29671
29674
|
const { handleMouseEnter, handleMouseLeave } = useMemo3(
|
|
29672
|
-
() => createHoverHandlers2((
|
|
29675
|
+
() => createHoverHandlers2((id2) => session?.client.beckon.hover(id2), hoverDelayMs),
|
|
29673
29676
|
[session, hoverDelayMs]
|
|
29674
29677
|
);
|
|
29675
29678
|
return /* @__PURE__ */ jsx17(
|
|
@@ -29710,7 +29713,7 @@ function AnnotationOverlay({
|
|
|
29710
29713
|
className: "semiont-annotation-overlay__shape",
|
|
29711
29714
|
"data-hovered": isHovered ? "true" : "false",
|
|
29712
29715
|
"data-selected": isSelected ? "true" : "false",
|
|
29713
|
-
onClick: () => session?.client.
|
|
29716
|
+
onClick: () => session?.client.browse.click(annotation.id, annotation.motivation),
|
|
29714
29717
|
onMouseEnter: () => handleMouseEnter(annotation.id),
|
|
29715
29718
|
onMouseLeave: handleMouseLeave
|
|
29716
29719
|
}
|
|
@@ -29725,7 +29728,7 @@ function AnnotationOverlay({
|
|
|
29725
29728
|
style: { userSelect: "none" },
|
|
29726
29729
|
onClick: (e6) => {
|
|
29727
29730
|
e6.stopPropagation();
|
|
29728
|
-
session?.client.
|
|
29731
|
+
session?.client.browse.click(annotation.id, annotation.motivation);
|
|
29729
29732
|
},
|
|
29730
29733
|
onMouseEnter: () => handleMouseEnter(annotation.id),
|
|
29731
29734
|
onMouseLeave: handleMouseLeave,
|
|
@@ -29755,7 +29758,7 @@ function AnnotationOverlay({
|
|
|
29755
29758
|
className: "semiont-annotation-overlay__shape",
|
|
29756
29759
|
"data-hovered": isHovered ? "true" : "false",
|
|
29757
29760
|
"data-selected": isSelected ? "true" : "false",
|
|
29758
|
-
onClick: () => session?.client.
|
|
29761
|
+
onClick: () => session?.client.browse.click(annotation.id, annotation.motivation),
|
|
29759
29762
|
onMouseEnter: () => handleMouseEnter(annotation.id),
|
|
29760
29763
|
onMouseLeave: handleMouseLeave
|
|
29761
29764
|
}
|
|
@@ -29770,7 +29773,7 @@ function AnnotationOverlay({
|
|
|
29770
29773
|
style: { userSelect: "none" },
|
|
29771
29774
|
onClick: (e6) => {
|
|
29772
29775
|
e6.stopPropagation();
|
|
29773
|
-
session?.client.
|
|
29776
|
+
session?.client.browse.click(annotation.id, annotation.motivation);
|
|
29774
29777
|
},
|
|
29775
29778
|
onMouseEnter: () => handleMouseEnter(annotation.id),
|
|
29776
29779
|
onMouseLeave: handleMouseLeave,
|
|
@@ -29804,7 +29807,7 @@ function AnnotationOverlay({
|
|
|
29804
29807
|
className: "semiont-annotation-overlay__shape",
|
|
29805
29808
|
"data-hovered": isHovered ? "true" : "false",
|
|
29806
29809
|
"data-selected": isSelected ? "true" : "false",
|
|
29807
|
-
onClick: () => session?.client.
|
|
29810
|
+
onClick: () => session?.client.browse.click(annotation.id, annotation.motivation),
|
|
29808
29811
|
onMouseEnter: () => handleMouseEnter(annotation.id),
|
|
29809
29812
|
onMouseLeave: handleMouseLeave
|
|
29810
29813
|
}
|
|
@@ -29819,7 +29822,7 @@ function AnnotationOverlay({
|
|
|
29819
29822
|
style: { userSelect: "none" },
|
|
29820
29823
|
onClick: (e6) => {
|
|
29821
29824
|
e6.stopPropagation();
|
|
29822
|
-
session?.client.
|
|
29825
|
+
session?.client.browse.click(annotation.id, annotation.motivation);
|
|
29823
29826
|
},
|
|
29824
29827
|
onMouseEnter: () => handleMouseEnter(annotation.id),
|
|
29825
29828
|
onMouseLeave: handleMouseLeave,
|
|
@@ -29838,7 +29841,7 @@ function AnnotationOverlay({
|
|
|
29838
29841
|
|
|
29839
29842
|
// src/components/image-annotation/SvgDrawingCanvas.tsx
|
|
29840
29843
|
import { useRef as useRef12, useState as useState16, useEffect as useEffect19, useCallback as useCallback12 } from "react";
|
|
29841
|
-
import { createRectangleSvg, createCircleSvg, createPolygonSvg, scaleSvgToNative, parseSvgSelector as parseSvgSelector2 } from "@semiont/
|
|
29844
|
+
import { createRectangleSvg, createCircleSvg, createPolygonSvg, scaleSvgToNative, parseSvgSelector as parseSvgSelector2 } from "@semiont/core";
|
|
29842
29845
|
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
29843
29846
|
function getMotivationColor(motivation) {
|
|
29844
29847
|
if (!motivation) {
|
|
@@ -29972,7 +29975,7 @@ function SvgDrawingCanvas({
|
|
|
29972
29975
|
return false;
|
|
29973
29976
|
});
|
|
29974
29977
|
if (clickedAnnotation) {
|
|
29975
|
-
session?.client.
|
|
29978
|
+
session?.client.browse.click(clickedAnnotation.id, clickedAnnotation.motivation);
|
|
29976
29979
|
setIsDrawing(false);
|
|
29977
29980
|
setStartPoint(null);
|
|
29978
29981
|
setCurrentPoint(null);
|
|
@@ -30024,13 +30027,10 @@ function SvgDrawingCanvas({
|
|
|
30024
30027
|
imageDimensions.height
|
|
30025
30028
|
);
|
|
30026
30029
|
if (session && selectedMotivation) {
|
|
30027
|
-
session.client.
|
|
30028
|
-
|
|
30029
|
-
|
|
30030
|
-
|
|
30031
|
-
},
|
|
30032
|
-
motivation: selectedMotivation
|
|
30033
|
-
});
|
|
30030
|
+
session.client.mark.request(
|
|
30031
|
+
{ type: "SvgSelector", value: nativeSvg },
|
|
30032
|
+
selectedMotivation
|
|
30033
|
+
);
|
|
30034
30034
|
}
|
|
30035
30035
|
setIsDrawing(false);
|
|
30036
30036
|
setStartPoint(null);
|
|
@@ -30503,10 +30503,11 @@ function SessionExpiredModal() {
|
|
|
30503
30503
|
|
|
30504
30504
|
// src/components/resource/AnnotateView.tsx
|
|
30505
30505
|
import { useRef as useRef13, useEffect as useEffect20, useCallback as useCallback13, lazy, Suspense } from "react";
|
|
30506
|
-
import { getMimeCategory, isPdfMimeType as isPdfMimeType2 } from "@semiont/
|
|
30506
|
+
import { getMimeCategory, isPdfMimeType as isPdfMimeType2 } from "@semiont/core";
|
|
30507
30507
|
|
|
30508
30508
|
// src/lib/text-segmentation.ts
|
|
30509
|
-
import { getTextPositionSelector as getTextPositionSelector2, getTextQuoteSelector, getTargetSelector as getTargetSelector2
|
|
30509
|
+
import { getTextPositionSelector as getTextPositionSelector2, getTextQuoteSelector, getTargetSelector as getTargetSelector2 } from "@semiont/core";
|
|
30510
|
+
import { findTextWithContext, buildContentCache } from "@semiont/core";
|
|
30510
30511
|
function segmentTextWithAnnotations(content4, annotations) {
|
|
30511
30512
|
if (!content4) {
|
|
30512
30513
|
return [{ exact: "", start: 0, end: 0 }];
|
|
@@ -30568,7 +30569,7 @@ function segmentTextWithAnnotations(content4, annotations) {
|
|
|
30568
30569
|
}
|
|
30569
30570
|
|
|
30570
30571
|
// src/lib/text-selection-handler.ts
|
|
30571
|
-
import { extractContext } from "@semiont/
|
|
30572
|
+
import { extractContext } from "@semiont/core";
|
|
30572
30573
|
function buildTextSelectors(content4, selectedText, start2, end) {
|
|
30573
30574
|
if (!selectedText || start2 < 0 || end <= start2 || end > content4.length) {
|
|
30574
30575
|
return null;
|
|
@@ -30596,7 +30597,7 @@ function fallbackTextPosition(content4, selectedText) {
|
|
|
30596
30597
|
|
|
30597
30598
|
// src/components/resource/AnnotateView.tsx
|
|
30598
30599
|
import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
30599
|
-
var PdfAnnotationCanvas = lazy(() => import("./PdfAnnotationCanvas.client-
|
|
30600
|
+
var PdfAnnotationCanvas = lazy(() => import("./PdfAnnotationCanvas.client-5QESNO5H.mjs").then((mod) => ({ default: mod.PdfAnnotationCanvas })));
|
|
30600
30601
|
function AnnotateView({
|
|
30601
30602
|
content: content4,
|
|
30602
30603
|
mimeType = "text/plain",
|
|
@@ -30630,8 +30631,8 @@ function AnnotateView({
|
|
|
30630
30631
|
const handleToolbarShapeChanged = useCallback13(({ shape }) => {
|
|
30631
30632
|
onUIStateChangeRef.current?.({ selectedShape: shape });
|
|
30632
30633
|
}, []);
|
|
30633
|
-
const handleAnnotationHover = useCallback13(({ annotationId:
|
|
30634
|
-
onUIStateChangeRef.current?.({ hoveredAnnotationId:
|
|
30634
|
+
const handleAnnotationHover = useCallback13(({ annotationId: annotationId2 }) => {
|
|
30635
|
+
onUIStateChangeRef.current?.({ hoveredAnnotationId: annotationId2 });
|
|
30635
30636
|
}, []);
|
|
30636
30637
|
useEventSubscriptions({
|
|
30637
30638
|
"mark:selection-changed": handleToolbarSelectionChanged,
|
|
@@ -30682,10 +30683,7 @@ function AnnotateView({
|
|
|
30682
30683
|
if (start2 >= 0 && selectedMotivation) {
|
|
30683
30684
|
const selectors = buildTextSelectors(content4, text7, start2, end);
|
|
30684
30685
|
if (!selectors) return;
|
|
30685
|
-
session?.client.
|
|
30686
|
-
selector: selectors,
|
|
30687
|
-
motivation: selectedMotivation
|
|
30688
|
-
});
|
|
30686
|
+
session?.client.mark.request(selectors, selectedMotivation);
|
|
30689
30687
|
selection2.removeAllRanges();
|
|
30690
30688
|
}
|
|
30691
30689
|
};
|
|
@@ -30812,7 +30810,7 @@ import { useRef as useRef14, useCallback as useCallback14, useEffect as useEffec
|
|
|
30812
30810
|
import { getAnnotationUriFromEvent } from "@semiont/core";
|
|
30813
30811
|
|
|
30814
30812
|
// src/components/resource/event-formatting.ts
|
|
30815
|
-
import { getExactText as getExactText2, getTargetSelector as getTargetSelector3 } from "@semiont/
|
|
30813
|
+
import { getExactText as getExactText2, getTargetSelector as getTargetSelector3 } from "@semiont/core";
|
|
30816
30814
|
function formatUserId(userId) {
|
|
30817
30815
|
if (!userId.startsWith("did:")) return userId;
|
|
30818
30816
|
const systemMatch = userId.match(/^did:web:system:(.+)$/);
|
|
@@ -31227,11 +31225,11 @@ function AnnotationHistory({ rUri, hoveredAnnotationId, onEventHover, onEventCli
|
|
|
31227
31225
|
t: t12,
|
|
31228
31226
|
Link,
|
|
31229
31227
|
routes,
|
|
31230
|
-
onEventRef: (
|
|
31231
|
-
if (el &&
|
|
31232
|
-
eventRefs.current.set(
|
|
31233
|
-
} else if (!el &&
|
|
31234
|
-
eventRefs.current.delete(
|
|
31228
|
+
onEventRef: (annotationId2, el) => {
|
|
31229
|
+
if (el && annotationId2) {
|
|
31230
|
+
eventRefs.current.set(annotationId2, el);
|
|
31231
|
+
} else if (!el && annotationId2) {
|
|
31232
|
+
eventRefs.current.delete(annotationId2);
|
|
31235
31233
|
}
|
|
31236
31234
|
},
|
|
31237
31235
|
...onEventClick && { onEventClick },
|
|
@@ -45760,7 +45758,9 @@ function remarkGfm(options) {
|
|
|
45760
45758
|
}
|
|
45761
45759
|
|
|
45762
45760
|
// src/components/resource/BrowseView.tsx
|
|
45763
|
-
import {
|
|
45761
|
+
import { annotationId as toAnnotationId3 } from "@semiont/core";
|
|
45762
|
+
import { getMimeCategory as getMimeCategory2, isPdfMimeType as isPdfMimeType3 } from "@semiont/core";
|
|
45763
|
+
import { createHoverHandlers as createHoverHandlers3 } from "@semiont/sdk";
|
|
45764
45764
|
|
|
45765
45765
|
// src/components/viewers/ImageViewer.tsx
|
|
45766
45766
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
@@ -45778,7 +45778,7 @@ function ImageViewer({ imageUrl, alt = "Resource image" }) {
|
|
|
45778
45778
|
|
|
45779
45779
|
// src/components/resource/BrowseView.tsx
|
|
45780
45780
|
import { jsx as jsx27, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
45781
|
-
var PdfAnnotationCanvas2 = lazy2(() => import("./PdfAnnotationCanvas.client-
|
|
45781
|
+
var PdfAnnotationCanvas2 = lazy2(() => import("./PdfAnnotationCanvas.client-5QESNO5H.mjs").then((mod) => ({ default: mod.PdfAnnotationCanvas })));
|
|
45782
45782
|
var MemoizedMarkdown = memo(function MemoizedMarkdown2({
|
|
45783
45783
|
content: content4
|
|
45784
45784
|
}) {
|
|
@@ -45833,24 +45833,24 @@ var BrowseView = memo(function BrowseView2({
|
|
|
45833
45833
|
const target = e6.target;
|
|
45834
45834
|
const annotationElement = target.closest("[data-annotation-id]");
|
|
45835
45835
|
if (!annotationElement) return;
|
|
45836
|
-
const
|
|
45836
|
+
const annotationId2 = annotationElement.getAttribute("data-annotation-id");
|
|
45837
45837
|
const annotationType = annotationElement.getAttribute("data-annotation-type");
|
|
45838
|
-
if (
|
|
45839
|
-
const annotation = allAnnotations.find((a15) => a15.id ===
|
|
45838
|
+
if (annotationId2 && annotationType === "reference") {
|
|
45839
|
+
const annotation = allAnnotations.find((a15) => a15.id === annotationId2);
|
|
45840
45840
|
if (annotation) {
|
|
45841
|
-
session.client.
|
|
45841
|
+
session.client.browse.click(annotation.id, annotation.motivation);
|
|
45842
45842
|
}
|
|
45843
45843
|
}
|
|
45844
45844
|
};
|
|
45845
45845
|
const { handleMouseEnter, handleMouseLeave, cleanup: cleanupHover } = createHoverHandlers3(
|
|
45846
|
-
(
|
|
45846
|
+
(id2) => session.client.beckon.hover(id2),
|
|
45847
45847
|
hoverDelayMs
|
|
45848
45848
|
);
|
|
45849
45849
|
const handleMouseOver = (e6) => {
|
|
45850
45850
|
const target = e6.target;
|
|
45851
45851
|
const annotationElement = target.closest("[data-annotation-id]");
|
|
45852
|
-
const
|
|
45853
|
-
if (
|
|
45852
|
+
const annotationId2 = annotationElement?.getAttribute("data-annotation-id");
|
|
45853
|
+
if (annotationId2) handleMouseEnter(toAnnotationId3(annotationId2));
|
|
45854
45854
|
};
|
|
45855
45855
|
const handleMouseOut = (e6) => {
|
|
45856
45856
|
const target = e6.target;
|
|
@@ -45860,8 +45860,8 @@ var BrowseView = memo(function BrowseView2({
|
|
|
45860
45860
|
if (newAnnotationIds) {
|
|
45861
45861
|
const annotationSpans = container.querySelectorAll("[data-annotation-id]");
|
|
45862
45862
|
annotationSpans.forEach((span) => {
|
|
45863
|
-
const
|
|
45864
|
-
if (
|
|
45863
|
+
const annotationId2 = span.getAttribute("data-annotation-id");
|
|
45864
|
+
if (annotationId2 && newAnnotationIds.has(annotationId2)) {
|
|
45865
45865
|
span.classList.add("annotation-sparkle");
|
|
45866
45866
|
}
|
|
45867
45867
|
});
|
|
@@ -45876,15 +45876,15 @@ var BrowseView = memo(function BrowseView2({
|
|
|
45876
45876
|
cleanupHover();
|
|
45877
45877
|
};
|
|
45878
45878
|
}, [content4, allAnnotations, newAnnotationIds, hoverDelayMs, session]);
|
|
45879
|
-
const scrollToAnnotation = useCallback15((
|
|
45879
|
+
const scrollToAnnotation = useCallback15((annotationId2, removePulse = false) => {
|
|
45880
45880
|
if (!containerRef.current) return;
|
|
45881
|
-
scrollAnnotationIntoView(
|
|
45881
|
+
scrollAnnotationIntoView(annotationId2, containerRef.current, { pulse: removePulse });
|
|
45882
45882
|
}, []);
|
|
45883
|
-
const handleAnnotationHover = useCallback15(({ annotationId:
|
|
45884
|
-
scrollToAnnotation(
|
|
45883
|
+
const handleAnnotationHover = useCallback15(({ annotationId: annotationId2 }) => {
|
|
45884
|
+
scrollToAnnotation(annotationId2);
|
|
45885
45885
|
}, [scrollToAnnotation]);
|
|
45886
|
-
const handleAnnotationFocus = useCallback15(({ annotationId:
|
|
45887
|
-
scrollToAnnotation(
|
|
45886
|
+
const handleAnnotationFocus = useCallback15(({ annotationId: annotationId2 }) => {
|
|
45887
|
+
scrollToAnnotation(annotationId2 ?? null, true);
|
|
45888
45888
|
}, [scrollToAnnotation]);
|
|
45889
45889
|
useEventSubscriptions({
|
|
45890
45890
|
"beckon:hover": handleAnnotationHover,
|
|
@@ -45973,8 +45973,7 @@ var BrowseView = memo(function BrowseView2({
|
|
|
45973
45973
|
|
|
45974
45974
|
// src/components/resource/ResourceViewer.tsx
|
|
45975
45975
|
import { useState as useState18, useEffect as useEffect25, useCallback as useCallback16, useRef as useRef17, useMemo as useMemo5 } from "react";
|
|
45976
|
-
import {
|
|
45977
|
-
import { getExactText as getExactText3, getTargetSelector as getTargetSelector4, isHighlight as isHighlight4, isAssessment as isAssessment3, isReference as isReference5, isComment as isComment4, isTag as isTag5, getBodySource as getBodySource4 } from "@semiont/api-client";
|
|
45976
|
+
import { getExactText as getExactText3, getTargetSelector as getTargetSelector4, isHighlight as isHighlight4, isAssessment as isAssessment3, isReference as isReference5, isComment as isComment4, isTag as isTag5, getBodySource as getBodySource4 } from "@semiont/core";
|
|
45978
45977
|
import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
45979
45978
|
function ResourceViewer({
|
|
45980
45979
|
resource,
|
|
@@ -45993,7 +45992,7 @@ function ResourceViewer({
|
|
|
45993
45992
|
if (!resource["@id"]) {
|
|
45994
45993
|
throw new Error("Resource has no @id");
|
|
45995
45994
|
}
|
|
45996
|
-
const rUri =
|
|
45995
|
+
const rUri = resource["@id"];
|
|
45997
45996
|
const getMimeType = () => {
|
|
45998
45997
|
const reps = resource.representations;
|
|
45999
45998
|
if (Array.isArray(reps) && reps.length > 0 && reps[0]) {
|
|
@@ -46084,9 +46083,9 @@ function ResourceViewer({
|
|
|
46084
46083
|
const hoveredAnnotationId = hoveredAnnotationIdProp ?? null;
|
|
46085
46084
|
const [scrollToAnnotationId, setScrollToAnnotationId] = useState18(null);
|
|
46086
46085
|
const [_focusedAnnotationId, setFocusedAnnotationId] = useState18(null);
|
|
46087
|
-
const focusAnnotation = useCallback16((
|
|
46088
|
-
setFocusedAnnotationId(
|
|
46089
|
-
setScrollToAnnotationId(
|
|
46086
|
+
const focusAnnotation = useCallback16((annotationId2) => {
|
|
46087
|
+
setFocusedAnnotationId(annotationId2);
|
|
46088
|
+
setScrollToAnnotationId(annotationId2);
|
|
46090
46089
|
setTimeout(() => setFocusedAnnotationId(null), 3e3);
|
|
46091
46090
|
}, []);
|
|
46092
46091
|
const getJsonLdModalPosition = () => {
|
|
@@ -46099,8 +46098,8 @@ function ResourceViewer({
|
|
|
46099
46098
|
};
|
|
46100
46099
|
};
|
|
46101
46100
|
const handleDeleteAnnotation = useCallback16((id2) => {
|
|
46102
|
-
session?.client.
|
|
46103
|
-
}, [session]);
|
|
46101
|
+
session?.client.mark.delete(rUri, id2);
|
|
46102
|
+
}, [session, rUri]);
|
|
46104
46103
|
const handleAnnotationClick2 = useCallback16((annotation, event) => {
|
|
46105
46104
|
const metadata = Object.values(ANNOTATORS).find((a15) => a15.matchesAnnotation(annotation));
|
|
46106
46105
|
if (metadata?.hasSidePanel) {
|
|
@@ -46132,11 +46131,11 @@ function ResourceViewer({
|
|
|
46132
46131
|
return;
|
|
46133
46132
|
}
|
|
46134
46133
|
}, [annotateMode, selectedClick, focusAnnotation]);
|
|
46135
|
-
const handleAnnotationClickEvent = useCallback16(({ annotationId:
|
|
46134
|
+
const handleAnnotationClickEvent = useCallback16(({ annotationId: annotationId2, motivation }) => {
|
|
46136
46135
|
const metadata = Object.values(ANNOTATORS).find((a15) => a15.matchesAnnotation({ motivation }));
|
|
46137
46136
|
if (!metadata?.hasSidePanel) {
|
|
46138
46137
|
const allAnnotations = [...highlights, ...references, ...assessments, ...comments, ...tags3];
|
|
46139
|
-
const annotation = allAnnotations.find((a15) => a15.id ===
|
|
46138
|
+
const annotation = allAnnotations.find((a15) => a15.id === annotationId2);
|
|
46140
46139
|
if (annotation) {
|
|
46141
46140
|
handleAnnotationClick2(annotation);
|
|
46142
46141
|
}
|
|
@@ -46144,13 +46143,13 @@ function ResourceViewer({
|
|
|
46144
46143
|
}
|
|
46145
46144
|
if (selectedClick !== "detail") {
|
|
46146
46145
|
const allAnnotations = [...highlights, ...references, ...assessments, ...comments, ...tags3];
|
|
46147
|
-
const annotation = allAnnotations.find((a15) => a15.id ===
|
|
46146
|
+
const annotation = allAnnotations.find((a15) => a15.id === annotationId2);
|
|
46148
46147
|
if (annotation) {
|
|
46149
46148
|
handleAnnotationClick2(annotation);
|
|
46150
46149
|
}
|
|
46151
46150
|
return;
|
|
46152
46151
|
}
|
|
46153
|
-
browser2.emit("panel:open", { panel: "annotations", scrollToAnnotationId:
|
|
46152
|
+
browser2.emit("panel:open", { panel: "annotations", scrollToAnnotationId: annotationId2, motivation });
|
|
46154
46153
|
}, [highlights, references, assessments, comments, tags3, handleAnnotationClick2, selectedClick, session]);
|
|
46155
46154
|
useEventSubscriptions({
|
|
46156
46155
|
// View mode
|
|
@@ -46285,7 +46284,7 @@ function ResourceViewer({
|
|
|
46285
46284
|
}
|
|
46286
46285
|
|
|
46287
46286
|
// src/components/resource/panels/AssessmentEntry.tsx
|
|
46288
|
-
import { getAnnotationExactText } from "@semiont/
|
|
46287
|
+
import { getAnnotationExactText } from "@semiont/core";
|
|
46289
46288
|
import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
46290
46289
|
function formatRelativeTime2(isoString) {
|
|
46291
46290
|
const date = new Date(isoString);
|
|
@@ -46333,7 +46332,7 @@ function AssessmentEntry({
|
|
|
46333
46332
|
"data-type": "assessment",
|
|
46334
46333
|
"data-focused": isFocused ? "true" : "false",
|
|
46335
46334
|
onClick: () => {
|
|
46336
|
-
session?.client.
|
|
46335
|
+
session?.client.browse.click(assessment.id, assessment.motivation);
|
|
46337
46336
|
},
|
|
46338
46337
|
...hoverProps,
|
|
46339
46338
|
children: [
|
|
@@ -46361,7 +46360,7 @@ function AssessmentEntry({
|
|
|
46361
46360
|
|
|
46362
46361
|
// src/components/resource/panels/AssessmentPanel.tsx
|
|
46363
46362
|
import { useState as useState20, useEffect as useEffect27, useRef as useRef18, useCallback as useCallback18, useMemo as useMemo6 } from "react";
|
|
46364
|
-
import { getTextPositionSelector as getTextPositionSelector3, getTargetSelector as getTargetSelector5 } from "@semiont/
|
|
46363
|
+
import { getTextPositionSelector as getTextPositionSelector3, getTargetSelector as getTargetSelector5 } from "@semiont/core";
|
|
46365
46364
|
|
|
46366
46365
|
// src/components/resource/panels/AssistSection.tsx
|
|
46367
46366
|
import { useState as useState19, useEffect as useEffect26, useCallback as useCallback17 } from "react";
|
|
@@ -46391,20 +46390,17 @@ function AssistSection({
|
|
|
46391
46390
|
}, [isExpanded, annotationType]);
|
|
46392
46391
|
const handleAssist = useCallback17(() => {
|
|
46393
46392
|
const motivation = annotationType === "highlight" ? "highlighting" : annotationType === "assessment" ? "assessing" : "commenting";
|
|
46394
|
-
session?.client.
|
|
46395
|
-
|
|
46396
|
-
|
|
46397
|
-
|
|
46398
|
-
|
|
46399
|
-
density: (annotationType === "comment" || annotationType === "assessment" || annotationType === "highlight") && useDensity ? density : void 0,
|
|
46400
|
-
language: annotationType === "comment" || annotationType === "assessment" ? locale : void 0
|
|
46401
|
-
}
|
|
46393
|
+
session?.client.mark.requestAssist(motivation, {
|
|
46394
|
+
instructions: instructions.trim() || void 0,
|
|
46395
|
+
tone: (annotationType === "comment" || annotationType === "assessment") && tone ? tone : void 0,
|
|
46396
|
+
density: (annotationType === "comment" || annotationType === "assessment" || annotationType === "highlight") && useDensity ? density : void 0,
|
|
46397
|
+
language: annotationType === "comment" || annotationType === "assessment" ? locale : void 0
|
|
46402
46398
|
});
|
|
46403
46399
|
setInstructions("");
|
|
46404
46400
|
setTone("");
|
|
46405
46401
|
}, [annotationType, instructions, tone, useDensity, density, locale, session]);
|
|
46406
46402
|
const handleDismissProgress = useCallback17(() => {
|
|
46407
|
-
session?.client.
|
|
46403
|
+
session?.client.mark.dismissProgress();
|
|
46408
46404
|
}, [session]);
|
|
46409
46405
|
return /* @__PURE__ */ jsxs22("div", { className: "semiont-panel__section", children: [
|
|
46410
46406
|
/* @__PURE__ */ jsxs22(
|
|
@@ -46663,7 +46659,7 @@ function AssessmentPanel({
|
|
|
46663
46659
|
if (pendingAnnotation) {
|
|
46664
46660
|
const trimmed = newAssessmentText.trim();
|
|
46665
46661
|
const body = trimmed ? { type: "TextualBody", value: trimmed, purpose: "assessing" } : void 0;
|
|
46666
|
-
session?.client.
|
|
46662
|
+
session?.client.mark.submit({
|
|
46667
46663
|
motivation: "assessing",
|
|
46668
46664
|
selector: pendingAnnotation.selector,
|
|
46669
46665
|
...body !== void 0 ? { body } : {}
|
|
@@ -46675,15 +46671,15 @@ function AssessmentPanel({
|
|
|
46675
46671
|
if (!pendingAnnotation) return;
|
|
46676
46672
|
const handleEscape = (e6) => {
|
|
46677
46673
|
if (e6.key === "Escape") {
|
|
46678
|
-
session?.client.
|
|
46674
|
+
session?.client.mark.cancelPending();
|
|
46679
46675
|
setNewAssessmentText("");
|
|
46680
46676
|
}
|
|
46681
46677
|
};
|
|
46682
46678
|
document.addEventListener("keydown", handleEscape);
|
|
46683
46679
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
46684
46680
|
}, [pendingAnnotation, session]);
|
|
46685
|
-
const handleAnnotationClick2 = useCallback18(({ annotationId:
|
|
46686
|
-
setFocusedAnnotationId(
|
|
46681
|
+
const handleAnnotationClick2 = useCallback18(({ annotationId: annotationId2 }) => {
|
|
46682
|
+
setFocusedAnnotationId(annotationId2);
|
|
46687
46683
|
setTimeout(() => setFocusedAnnotationId(null), 3e3);
|
|
46688
46684
|
}, []);
|
|
46689
46685
|
useEventSubscriptions({
|
|
@@ -46721,7 +46717,7 @@ function AssessmentPanel({
|
|
|
46721
46717
|
"button",
|
|
46722
46718
|
{
|
|
46723
46719
|
onClick: () => {
|
|
46724
|
-
session?.client.
|
|
46720
|
+
session?.client.mark.cancelPending();
|
|
46725
46721
|
setNewAssessmentText("");
|
|
46726
46722
|
},
|
|
46727
46723
|
className: "semiont-button semiont-button--secondary",
|
|
@@ -46848,7 +46844,7 @@ function CollaborationPanel({
|
|
|
46848
46844
|
|
|
46849
46845
|
// src/components/resource/panels/CommentEntry.tsx
|
|
46850
46846
|
import { useState as useState21, useEffect as useEffect28, useRef as useRef19, useImperativeHandle } from "react";
|
|
46851
|
-
import { getAnnotationExactText as getAnnotationExactText2, getCommentText } from "@semiont/
|
|
46847
|
+
import { getAnnotationExactText as getAnnotationExactText2, getCommentText } from "@semiont/core";
|
|
46852
46848
|
import { jsx as jsx34, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
46853
46849
|
function formatRelativeTime3(isoString) {
|
|
46854
46850
|
const date = new Date(isoString);
|
|
@@ -46907,7 +46903,7 @@ function CommentEntry({
|
|
|
46907
46903
|
"data-type": "comment",
|
|
46908
46904
|
"data-focused": isFocused ? "true" : "false",
|
|
46909
46905
|
onClick: () => {
|
|
46910
|
-
session?.client.
|
|
46906
|
+
session?.client.browse.click(comment2.id, comment2.motivation);
|
|
46911
46907
|
},
|
|
46912
46908
|
...hoverProps,
|
|
46913
46909
|
children: [
|
|
@@ -46983,7 +46979,7 @@ function CommentEntry({
|
|
|
46983
46979
|
|
|
46984
46980
|
// src/components/resource/panels/CommentsPanel.tsx
|
|
46985
46981
|
import { useState as useState22, useEffect as useEffect29, useRef as useRef20, useCallback as useCallback19, useMemo as useMemo7 } from "react";
|
|
46986
|
-
import { getTextPositionSelector as getTextPositionSelector4, getTargetSelector as getTargetSelector6 } from "@semiont/
|
|
46982
|
+
import { getTextPositionSelector as getTextPositionSelector4, getTargetSelector as getTargetSelector6 } from "@semiont/core";
|
|
46987
46983
|
import { jsx as jsx35, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
46988
46984
|
function getSelectorDisplayText2(selector) {
|
|
46989
46985
|
if (Array.isArray(selector)) {
|
|
@@ -47063,8 +47059,8 @@ function CommentsPanel({
|
|
|
47063
47059
|
container.scrollTo({ top: scrollTo, behavior: "smooth" });
|
|
47064
47060
|
}
|
|
47065
47061
|
}, [hoveredAnnotationId]);
|
|
47066
|
-
const handleAnnotationClick2 = useCallback19(({ annotationId:
|
|
47067
|
-
setFocusedAnnotationId(
|
|
47062
|
+
const handleAnnotationClick2 = useCallback19(({ annotationId: annotationId2 }) => {
|
|
47063
|
+
setFocusedAnnotationId(annotationId2);
|
|
47068
47064
|
setTimeout(() => setFocusedAnnotationId(null), 3e3);
|
|
47069
47065
|
}, []);
|
|
47070
47066
|
useEventSubscriptions({
|
|
@@ -47072,7 +47068,7 @@ function CommentsPanel({
|
|
|
47072
47068
|
});
|
|
47073
47069
|
const handleSaveNewComment = () => {
|
|
47074
47070
|
if (newCommentText.trim() && pendingAnnotation) {
|
|
47075
|
-
session?.client.
|
|
47071
|
+
session?.client.mark.submit({
|
|
47076
47072
|
motivation: "commenting",
|
|
47077
47073
|
selector: pendingAnnotation.selector,
|
|
47078
47074
|
body: [{ type: "TextualBody", value: newCommentText, purpose: "commenting" }]
|
|
@@ -47084,7 +47080,7 @@ function CommentsPanel({
|
|
|
47084
47080
|
if (!pendingAnnotation) return;
|
|
47085
47081
|
const handleEscape = (e6) => {
|
|
47086
47082
|
if (e6.key === "Escape") {
|
|
47087
|
-
session?.client.
|
|
47083
|
+
session?.client.mark.cancelPending();
|
|
47088
47084
|
setNewCommentText("");
|
|
47089
47085
|
}
|
|
47090
47086
|
};
|
|
@@ -47123,7 +47119,7 @@ function CommentsPanel({
|
|
|
47123
47119
|
"button",
|
|
47124
47120
|
{
|
|
47125
47121
|
onClick: () => {
|
|
47126
|
-
session?.client.
|
|
47122
|
+
session?.client.mark.cancelPending();
|
|
47127
47123
|
setNewCommentText("");
|
|
47128
47124
|
},
|
|
47129
47125
|
className: "semiont-button semiont-button--secondary",
|
|
@@ -47170,7 +47166,7 @@ function CommentsPanel({
|
|
|
47170
47166
|
}
|
|
47171
47167
|
|
|
47172
47168
|
// src/components/resource/panels/HighlightEntry.tsx
|
|
47173
|
-
import { getAnnotationExactText as getAnnotationExactText3 } from "@semiont/
|
|
47169
|
+
import { getAnnotationExactText as getAnnotationExactText3 } from "@semiont/core";
|
|
47174
47170
|
import { jsxs as jsxs28 } from "react/jsx-runtime";
|
|
47175
47171
|
function formatRelativeTime4(isoString) {
|
|
47176
47172
|
const date = new Date(isoString);
|
|
@@ -47203,7 +47199,7 @@ function HighlightEntry({
|
|
|
47203
47199
|
"data-type": "highlight",
|
|
47204
47200
|
"data-focused": isFocused ? "true" : "false",
|
|
47205
47201
|
onClick: () => {
|
|
47206
|
-
session?.client.
|
|
47202
|
+
session?.client.browse.click(highlight.id, highlight.motivation);
|
|
47207
47203
|
},
|
|
47208
47204
|
...hoverProps,
|
|
47209
47205
|
children: [
|
|
@@ -47230,7 +47226,7 @@ function HighlightEntry({
|
|
|
47230
47226
|
|
|
47231
47227
|
// src/components/resource/panels/HighlightPanel.tsx
|
|
47232
47228
|
import { useEffect as useEffect30, useState as useState23, useRef as useRef21, useCallback as useCallback20, useMemo as useMemo8 } from "react";
|
|
47233
|
-
import { getTextPositionSelector as getTextPositionSelector5, getTargetSelector as getTargetSelector7 } from "@semiont/
|
|
47229
|
+
import { getTextPositionSelector as getTextPositionSelector5, getTargetSelector as getTargetSelector7 } from "@semiont/core";
|
|
47234
47230
|
import { jsx as jsx36, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
47235
47231
|
function HighlightPanel({
|
|
47236
47232
|
annotations,
|
|
@@ -47293,8 +47289,8 @@ function HighlightPanel({
|
|
|
47293
47289
|
container.scrollTo({ top: scrollTo, behavior: "smooth" });
|
|
47294
47290
|
}
|
|
47295
47291
|
}, [hoveredAnnotationId]);
|
|
47296
|
-
const handleAnnotationClick2 = useCallback20(({ annotationId:
|
|
47297
|
-
setFocusedAnnotationId(
|
|
47292
|
+
const handleAnnotationClick2 = useCallback20(({ annotationId: annotationId2 }) => {
|
|
47293
|
+
setFocusedAnnotationId(annotationId2);
|
|
47298
47294
|
setTimeout(() => setFocusedAnnotationId(null), 3e3);
|
|
47299
47295
|
}, []);
|
|
47300
47296
|
useEventSubscriptions({
|
|
@@ -47302,7 +47298,7 @@ function HighlightPanel({
|
|
|
47302
47298
|
});
|
|
47303
47299
|
useEffect30(() => {
|
|
47304
47300
|
if (pendingAnnotation && pendingAnnotation.motivation === "highlighting") {
|
|
47305
|
-
session?.client.
|
|
47301
|
+
session?.client.mark.submit({
|
|
47306
47302
|
motivation: "highlighting",
|
|
47307
47303
|
selector: pendingAnnotation.selector
|
|
47308
47304
|
});
|
|
@@ -47403,8 +47399,8 @@ function JsonLdPanel({ resource: semiontResource }) {
|
|
|
47403
47399
|
}
|
|
47404
47400
|
|
|
47405
47401
|
// src/components/resource/panels/ReferenceEntry.tsx
|
|
47406
|
-
import {
|
|
47407
|
-
import { getAnnotationExactText as getAnnotationExactText4, isBodyResolved as isBodyResolved2, getBodySource as getBodySource5, getFragmentSelector, getSvgSelector as getSvgSelector2, getTargetSelector as getTargetSelector8 } from "@semiont/
|
|
47402
|
+
import { resourceId } from "@semiont/core";
|
|
47403
|
+
import { getAnnotationExactText as getAnnotationExactText4, isBodyResolved as isBodyResolved2, getBodySource as getBodySource5, getFragmentSelector, getSvgSelector as getSvgSelector2, getTargetSelector as getTargetSelector8 } from "@semiont/core";
|
|
47408
47404
|
import { jsx as jsx38, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
47409
47405
|
function ReferenceEntry({
|
|
47410
47406
|
reference,
|
|
@@ -47442,15 +47438,15 @@ function ReferenceEntry({
|
|
|
47442
47438
|
if (source && resolvedResourceUri && semiont) {
|
|
47443
47439
|
semiont.bind.body(
|
|
47444
47440
|
resourceId(source),
|
|
47445
|
-
|
|
47441
|
+
reference.id,
|
|
47446
47442
|
[{ op: "remove", item: { type: "SpecificResource", source: resolvedResourceUri, purpose: "linking" } }]
|
|
47447
47443
|
).catch(() => {
|
|
47448
47444
|
});
|
|
47449
47445
|
}
|
|
47450
47446
|
};
|
|
47451
47447
|
const handleInitiateWizard = () => {
|
|
47452
|
-
session?.client.
|
|
47453
|
-
annotationId:
|
|
47448
|
+
session?.client.bind.initiate({
|
|
47449
|
+
annotationId: reference.id,
|
|
47454
47450
|
resourceId: resourceId(source),
|
|
47455
47451
|
defaultTitle: selectedText,
|
|
47456
47452
|
entityTypes
|
|
@@ -47473,7 +47469,7 @@ function ReferenceEntry({
|
|
|
47473
47469
|
"data-type": "reference",
|
|
47474
47470
|
"data-focused": isFocused ? "true" : "false",
|
|
47475
47471
|
onClick: () => {
|
|
47476
|
-
session?.client.
|
|
47472
|
+
session?.client.browse.click(reference.id, reference.motivation);
|
|
47477
47473
|
},
|
|
47478
47474
|
...hoverProps,
|
|
47479
47475
|
children: [
|
|
@@ -47539,7 +47535,7 @@ function ReferenceEntry({
|
|
|
47539
47535
|
|
|
47540
47536
|
// src/components/resource/panels/ReferencesPanel.tsx
|
|
47541
47537
|
import { useState as useState24, useRef as useRef23, useEffect as useEffect32, useCallback as useCallback21, useMemo as useMemo9 } from "react";
|
|
47542
|
-
import { getTextPositionSelector as getTextPositionSelector6, getTargetSelector as getTargetSelector9 } from "@semiont/
|
|
47538
|
+
import { getTextPositionSelector as getTextPositionSelector6, getTargetSelector as getTargetSelector9 } from "@semiont/core";
|
|
47543
47539
|
import { Fragment as Fragment6, jsx as jsx39, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
47544
47540
|
function getSelectorDisplayText3(selector) {
|
|
47545
47541
|
if (Array.isArray(selector)) {
|
|
@@ -47638,8 +47634,8 @@ function ReferencesPanel({
|
|
|
47638
47634
|
container.scrollTo({ top: scrollTo, behavior: "smooth" });
|
|
47639
47635
|
}
|
|
47640
47636
|
}, [hoveredAnnotationId]);
|
|
47641
|
-
const handleAnnotationClick2 = useCallback21(({ annotationId:
|
|
47642
|
-
setFocusedAnnotationId(
|
|
47637
|
+
const handleAnnotationClick2 = useCallback21(({ annotationId: annotationId2 }) => {
|
|
47638
|
+
setFocusedAnnotationId(annotationId2);
|
|
47643
47639
|
setTimeout(() => setFocusedAnnotationId(null), 3e3);
|
|
47644
47640
|
}, []);
|
|
47645
47641
|
useEventSubscriptions({
|
|
@@ -47647,12 +47643,9 @@ function ReferencesPanel({
|
|
|
47647
47643
|
});
|
|
47648
47644
|
const handleAssist = () => {
|
|
47649
47645
|
setLastDetectionLog(null);
|
|
47650
|
-
session?.client.
|
|
47651
|
-
|
|
47652
|
-
|
|
47653
|
-
entityTypes: selectedEntityTypes,
|
|
47654
|
-
includeDescriptiveReferences
|
|
47655
|
-
}
|
|
47646
|
+
session?.client.mark.requestAssist("linking", {
|
|
47647
|
+
entityTypes: selectedEntityTypes,
|
|
47648
|
+
includeDescriptiveReferences
|
|
47656
47649
|
});
|
|
47657
47650
|
};
|
|
47658
47651
|
const hasSavedLogRef = useRef23(false);
|
|
@@ -47675,7 +47668,7 @@ function ReferencesPanel({
|
|
|
47675
47668
|
const handleCreateReference = () => {
|
|
47676
47669
|
if (pendingAnnotation) {
|
|
47677
47670
|
const entityType = pendingEntityTypes.join(",") || void 0;
|
|
47678
|
-
session?.client.
|
|
47671
|
+
session?.client.mark.submit({
|
|
47679
47672
|
motivation: "linking",
|
|
47680
47673
|
selector: pendingAnnotation.selector,
|
|
47681
47674
|
body: entityType ? [{ type: "TextualBody", value: entityType, purpose: "tagging" }] : []
|
|
@@ -47687,7 +47680,7 @@ function ReferencesPanel({
|
|
|
47687
47680
|
if (!pendingAnnotation) return;
|
|
47688
47681
|
const handleEscape = (e6) => {
|
|
47689
47682
|
if (e6.key === "Escape") {
|
|
47690
|
-
session?.client.
|
|
47683
|
+
session?.client.mark.cancelPending();
|
|
47691
47684
|
setPendingEntityTypes([]);
|
|
47692
47685
|
}
|
|
47693
47686
|
};
|
|
@@ -47722,7 +47715,7 @@ function ReferencesPanel({
|
|
|
47722
47715
|
"button",
|
|
47723
47716
|
{
|
|
47724
47717
|
onClick: () => {
|
|
47725
|
-
session?.client.
|
|
47718
|
+
session?.client.mark.cancelPending();
|
|
47726
47719
|
setPendingEntityTypes([]);
|
|
47727
47720
|
},
|
|
47728
47721
|
className: "semiont-button semiont-button--secondary",
|
|
@@ -47890,7 +47883,7 @@ function ReferencesPanel({
|
|
|
47890
47883
|
}
|
|
47891
47884
|
|
|
47892
47885
|
// src/components/resource/panels/ResourceInfoPanel.tsx
|
|
47893
|
-
import { formatLocaleDisplay } from "@semiont/
|
|
47886
|
+
import { formatLocaleDisplay } from "@semiont/core";
|
|
47894
47887
|
import { resourceId as makeResourceId } from "@semiont/core";
|
|
47895
47888
|
import { Fragment as Fragment7, jsx as jsx40, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
47896
47889
|
function ResourceInfoPanel({
|
|
@@ -47961,7 +47954,7 @@ function ResourceInfoPanel({
|
|
|
47961
47954
|
"button",
|
|
47962
47955
|
{
|
|
47963
47956
|
className: "semiont-resource-info-panel__link",
|
|
47964
|
-
onClick: () => session?.client.
|
|
47957
|
+
onClick: () => session?.client.browse.navigateReference(makeResourceId(id2)),
|
|
47965
47958
|
children: [
|
|
47966
47959
|
i12 > 0 && ", ",
|
|
47967
47960
|
id2
|
|
@@ -47992,7 +47985,7 @@ function ResourceInfoPanel({
|
|
|
47992
47985
|
/* @__PURE__ */ jsxs33(
|
|
47993
47986
|
"button",
|
|
47994
47987
|
{
|
|
47995
|
-
onClick: () => session?.client.
|
|
47988
|
+
onClick: () => session?.client.yield.clone(),
|
|
47996
47989
|
className: "semiont-resource-button semiont-resource-button--secondary",
|
|
47997
47990
|
children: [
|
|
47998
47991
|
"\u{1F517} ",
|
|
@@ -48006,7 +47999,7 @@ function ResourceInfoPanel({
|
|
|
48006
47999
|
/* @__PURE__ */ jsxs33(
|
|
48007
48000
|
"button",
|
|
48008
48001
|
{
|
|
48009
|
-
onClick: () => session?.client.
|
|
48002
|
+
onClick: () => session?.client.mark.unarchive(makeResourceId(resourceId2)),
|
|
48010
48003
|
className: "semiont-resource-button semiont-resource-button--secondary",
|
|
48011
48004
|
children: [
|
|
48012
48005
|
"\u{1F4E4} ",
|
|
@@ -48019,7 +48012,7 @@ function ResourceInfoPanel({
|
|
|
48019
48012
|
/* @__PURE__ */ jsxs33(
|
|
48020
48013
|
"button",
|
|
48021
48014
|
{
|
|
48022
|
-
onClick: () => session?.client.
|
|
48015
|
+
onClick: () => session?.client.mark.archive(makeResourceId(resourceId2)),
|
|
48023
48016
|
className: "semiont-resource-button semiont-resource-button--archive",
|
|
48024
48017
|
children: [
|
|
48025
48018
|
"\u{1F4E6} ",
|
|
@@ -48033,7 +48026,7 @@ function ResourceInfoPanel({
|
|
|
48033
48026
|
}
|
|
48034
48027
|
|
|
48035
48028
|
// src/components/resource/panels/StatisticsPanel.tsx
|
|
48036
|
-
import { isBodyResolved as isBodyResolved3 } from "@semiont/
|
|
48029
|
+
import { isBodyResolved as isBodyResolved3 } from "@semiont/core";
|
|
48037
48030
|
import { jsx as jsx41, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
48038
48031
|
function StatisticsPanel({
|
|
48039
48032
|
highlights,
|
|
@@ -48105,7 +48098,7 @@ function StatisticsPanel({
|
|
|
48105
48098
|
}
|
|
48106
48099
|
|
|
48107
48100
|
// src/components/resource/panels/TagEntry.tsx
|
|
48108
|
-
import { getAnnotationExactText as getAnnotationExactText5 } from "@semiont/
|
|
48101
|
+
import { getAnnotationExactText as getAnnotationExactText5 } from "@semiont/core";
|
|
48109
48102
|
import { jsx as jsx42, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
48110
48103
|
function TagEntry({
|
|
48111
48104
|
tag,
|
|
@@ -48124,7 +48117,7 @@ function TagEntry({
|
|
|
48124
48117
|
{
|
|
48125
48118
|
ref,
|
|
48126
48119
|
onClick: () => {
|
|
48127
|
-
session?.client.
|
|
48120
|
+
session?.client.browse.click(tag.id, tag.motivation);
|
|
48128
48121
|
},
|
|
48129
48122
|
...hoverProps,
|
|
48130
48123
|
className: `semiont-annotation-entry${isHovered ? " semiont-annotation-pulse" : ""}`,
|
|
@@ -48152,7 +48145,7 @@ function TagEntry({
|
|
|
48152
48145
|
|
|
48153
48146
|
// src/components/resource/panels/TaggingPanel.tsx
|
|
48154
48147
|
import { useState as useState25, useEffect as useEffect33, useRef as useRef24, useCallback as useCallback22, useMemo as useMemo10 } from "react";
|
|
48155
|
-
import { getTextPositionSelector as getTextPositionSelector7, getTargetSelector as getTargetSelector10 } from "@semiont/
|
|
48148
|
+
import { getTextPositionSelector as getTextPositionSelector7, getTargetSelector as getTargetSelector10 } from "@semiont/core";
|
|
48156
48149
|
import { Fragment as Fragment8, jsx as jsx43, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
48157
48150
|
function getSelectorDisplayText4(selector) {
|
|
48158
48151
|
if (Array.isArray(selector)) {
|
|
@@ -48192,8 +48185,8 @@ function TaggingPanel({
|
|
|
48192
48185
|
if (typeof window === "undefined") return;
|
|
48193
48186
|
localStorage.setItem("assist-section-expanded-tag", String(isAssistExpanded));
|
|
48194
48187
|
}, [isAssistExpanded]);
|
|
48195
|
-
const handleAnnotationClick2 = useCallback22(({ annotationId:
|
|
48196
|
-
setFocusedAnnotationId(
|
|
48188
|
+
const handleAnnotationClick2 = useCallback22(({ annotationId: annotationId2 }) => {
|
|
48189
|
+
setFocusedAnnotationId(annotationId2);
|
|
48197
48190
|
setTimeout(() => setFocusedAnnotationId(null), 3e3);
|
|
48198
48191
|
}, []);
|
|
48199
48192
|
useEventSubscriptions({
|
|
@@ -48271,12 +48264,9 @@ function TaggingPanel({
|
|
|
48271
48264
|
};
|
|
48272
48265
|
const handleAssist = () => {
|
|
48273
48266
|
if (selectedCategories.size > 0) {
|
|
48274
|
-
session?.client.
|
|
48275
|
-
|
|
48276
|
-
|
|
48277
|
-
schemaId: selectedSchemaId,
|
|
48278
|
-
categories: Array.from(selectedCategories)
|
|
48279
|
-
}
|
|
48267
|
+
session?.client.mark.requestAssist("tagging", {
|
|
48268
|
+
schemaId: selectedSchemaId,
|
|
48269
|
+
categories: Array.from(selectedCategories)
|
|
48280
48270
|
});
|
|
48281
48271
|
setSelectedCategories(/* @__PURE__ */ new Set());
|
|
48282
48272
|
}
|
|
@@ -48285,7 +48275,7 @@ function TaggingPanel({
|
|
|
48285
48275
|
if (!pendingAnnotation) return;
|
|
48286
48276
|
const handleEscape = (e6) => {
|
|
48287
48277
|
if (e6.key === "Escape") {
|
|
48288
|
-
session?.client.
|
|
48278
|
+
session?.client.mark.cancelPending();
|
|
48289
48279
|
}
|
|
48290
48280
|
};
|
|
48291
48281
|
document.addEventListener("keydown", handleEscape);
|
|
@@ -48323,7 +48313,7 @@ function TaggingPanel({
|
|
|
48323
48313
|
className: "semiont-select",
|
|
48324
48314
|
onChange: (e6) => {
|
|
48325
48315
|
if (e6.target.value && pendingAnnotation) {
|
|
48326
|
-
session?.client.
|
|
48316
|
+
session?.client.mark.submit({
|
|
48327
48317
|
motivation: "tagging",
|
|
48328
48318
|
selector: pendingAnnotation.selector,
|
|
48329
48319
|
body: [
|
|
@@ -48352,7 +48342,7 @@ function TaggingPanel({
|
|
|
48352
48342
|
/* @__PURE__ */ jsx43("div", { className: "semiont-annotation-prompt__footer", children: /* @__PURE__ */ jsx43(
|
|
48353
48343
|
"button",
|
|
48354
48344
|
{
|
|
48355
|
-
onClick: () => session?.client.
|
|
48345
|
+
onClick: () => session?.client.mark.cancelPending(),
|
|
48356
48346
|
className: "semiont-button semiont-button--secondary",
|
|
48357
48347
|
"data-type": "tag",
|
|
48358
48348
|
children: t12("cancel")
|
|
@@ -53498,7 +53488,7 @@ function GatherContextStep({
|
|
|
53498
53488
|
|
|
53499
53489
|
// src/components/modals/ConfigureGenerationStep.tsx
|
|
53500
53490
|
import { useState as useState34 } from "react";
|
|
53501
|
-
import { LOCALES as LOCALES2 } from "@semiont/
|
|
53491
|
+
import { LOCALES as LOCALES2 } from "@semiont/core";
|
|
53502
53492
|
import { jsx as jsx53, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
53503
53493
|
function ConfigureGenerationStep({
|
|
53504
53494
|
defaultTitle,
|
|
@@ -53861,7 +53851,7 @@ import { jsx as jsx56, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
|
53861
53851
|
function ReferenceWizardModal({
|
|
53862
53852
|
isOpen,
|
|
53863
53853
|
onClose,
|
|
53864
|
-
annotationId:
|
|
53854
|
+
annotationId: annotationId2,
|
|
53865
53855
|
resourceId: resourceId2,
|
|
53866
53856
|
defaultTitle,
|
|
53867
53857
|
entityTypes,
|
|
@@ -53887,7 +53877,7 @@ function ReferenceWizardModal({
|
|
|
53887
53877
|
}, [isOpen]);
|
|
53888
53878
|
useEventSubscription("match:search-results", (event) => {
|
|
53889
53879
|
if (!isOpen) return;
|
|
53890
|
-
if (
|
|
53880
|
+
if (annotationId2 && event.referenceId === annotationId2) {
|
|
53891
53881
|
setIsSearching(false);
|
|
53892
53882
|
setWizardStep({ step: "search-results", results: event.response });
|
|
53893
53883
|
}
|
|
@@ -53899,37 +53889,37 @@ function ReferenceWizardModal({
|
|
|
53899
53889
|
setWizardStep({ step: "configure-generation" });
|
|
53900
53890
|
}, []);
|
|
53901
53891
|
const handleCompose = useCallback30(() => {
|
|
53902
|
-
if (!context || !
|
|
53892
|
+
if (!context || !annotationId2 || !resourceId2) return;
|
|
53903
53893
|
const contextWithHint = userHint ? { ...context, userHint } : context;
|
|
53904
|
-
onComposeNavigate(contextWithHint,
|
|
53894
|
+
onComposeNavigate(contextWithHint, annotationId2, resourceId2, defaultTitle, entityTypes);
|
|
53905
53895
|
onClose();
|
|
53906
|
-
}, [context,
|
|
53896
|
+
}, [context, annotationId2, resourceId2, defaultTitle, entityTypes, onComposeNavigate, onClose, userHint]);
|
|
53907
53897
|
const handleBackToGather = useCallback30(() => {
|
|
53908
53898
|
setWizardStep({ step: "gather" });
|
|
53909
53899
|
}, []);
|
|
53910
53900
|
const handleSearchSubmit = useCallback30((config) => {
|
|
53911
|
-
if (!
|
|
53901
|
+
if (!annotationId2 || !context || !resourceId2) return;
|
|
53912
53902
|
setIsSearching(true);
|
|
53913
53903
|
const contextWithHint = userHint ? { ...context, userHint } : context;
|
|
53914
|
-
session?.client.
|
|
53904
|
+
session?.client.match.requestSearch({
|
|
53915
53905
|
correlationId: crypto.randomUUID(),
|
|
53916
53906
|
resourceId: resourceId2,
|
|
53917
|
-
referenceId:
|
|
53907
|
+
referenceId: annotationId2,
|
|
53918
53908
|
context: contextWithHint,
|
|
53919
53909
|
limit: config.limit,
|
|
53920
53910
|
useSemanticScoring: config.useSemanticScoring
|
|
53921
53911
|
});
|
|
53922
|
-
}, [
|
|
53912
|
+
}, [annotationId2, resourceId2, context, session, userHint]);
|
|
53923
53913
|
const handleGenerateSubmit = useCallback30((config) => {
|
|
53924
|
-
if (!
|
|
53925
|
-
onGenerateSubmit(
|
|
53914
|
+
if (!annotationId2) return;
|
|
53915
|
+
onGenerateSubmit(annotationId2, config);
|
|
53926
53916
|
onClose();
|
|
53927
|
-
}, [
|
|
53917
|
+
}, [annotationId2, onGenerateSubmit, onClose]);
|
|
53928
53918
|
const handleLink = useCallback30((targetResourceId) => {
|
|
53929
|
-
if (!
|
|
53930
|
-
onLinkResource(
|
|
53919
|
+
if (!annotationId2) return;
|
|
53920
|
+
onLinkResource(annotationId2, targetResourceId);
|
|
53931
53921
|
onClose();
|
|
53932
|
-
}, [
|
|
53922
|
+
}, [annotationId2, onLinkResource, onClose]);
|
|
53933
53923
|
const stepTitle = wizardStep.step === "gather" ? t12.gatherTitle : wizardStep.step === "configure-generation" ? t12.configureGenerationTitle : wizardStep.step === "configure-search" ? t12.configureSearchTitle : t12.searchResultsTitle;
|
|
53934
53924
|
return /* @__PURE__ */ jsx56(Ke, { appear: true, show: isOpen, children: /* @__PURE__ */ jsxs48(ht, { as: "div", className: "semiont-search-modal", onClose, children: [
|
|
53935
53925
|
/* @__PURE__ */ jsx56(
|
|
@@ -54069,7 +54059,8 @@ function ReferenceWizardModal({
|
|
|
54069
54059
|
// src/components/modals/SearchModal.tsx
|
|
54070
54060
|
import { useState as useState37, useEffect as useEffect44, useRef as useRef33 } from "react";
|
|
54071
54061
|
var import_operators = __toESM(require_operators());
|
|
54072
|
-
import { getResourceId
|
|
54062
|
+
import { getResourceId } from "@semiont/core";
|
|
54063
|
+
import { createSearchPipeline } from "@semiont/sdk";
|
|
54073
54064
|
|
|
54074
54065
|
// src/hooks/useSearchAnnouncements.ts
|
|
54075
54066
|
import { useCallback as useCallback31 } from "react";
|
|
@@ -54279,7 +54270,8 @@ function SearchModal({
|
|
|
54279
54270
|
// src/components/modals/ResourceSearchModal.tsx
|
|
54280
54271
|
import { useState as useState38, useEffect as useEffect45, useRef as useRef34 } from "react";
|
|
54281
54272
|
var import_operators2 = __toESM(require_operators());
|
|
54282
|
-
import { getResourceId as getResourceId2, getPrimaryRepresentation
|
|
54273
|
+
import { getResourceId as getResourceId2, getPrimaryRepresentation } from "@semiont/core";
|
|
54274
|
+
import { createSearchPipeline as createSearchPipeline2 } from "@semiont/sdk";
|
|
54283
54275
|
import { jsx as jsx58, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
54284
54276
|
var SEARCH_DEBOUNCE_MS2 = 300;
|
|
54285
54277
|
var SEARCH_LIMIT2 = 50;
|
|
@@ -54470,7 +54462,7 @@ function StatusDisplay({
|
|
|
54470
54462
|
return;
|
|
54471
54463
|
}
|
|
54472
54464
|
const fetchStatus = () => {
|
|
54473
|
-
semiont.
|
|
54465
|
+
semiont.admin.status().then((result) => {
|
|
54474
54466
|
setData(result);
|
|
54475
54467
|
setError(null);
|
|
54476
54468
|
setLoading(false);
|
|
@@ -55850,7 +55842,7 @@ var ForwardRef17 = /* @__PURE__ */ React42.forwardRef(UserCircleIcon);
|
|
|
55850
55842
|
var UserCircleIcon_default = ForwardRef17;
|
|
55851
55843
|
|
|
55852
55844
|
// src/features/admin-devops/components/AdminDevOpsPage.tsx
|
|
55853
|
-
import { COMMON_PANELS } from "@semiont/
|
|
55845
|
+
import { COMMON_PANELS } from "@semiont/sdk";
|
|
55854
55846
|
import { jsx as jsx72, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
55855
55847
|
function AdminDevOpsPage({
|
|
55856
55848
|
suggestedFeatures,
|
|
@@ -55923,7 +55915,7 @@ function AdminDevOpsPage({
|
|
|
55923
55915
|
}
|
|
55924
55916
|
|
|
55925
55917
|
// src/features/admin-exchange/components/AdminExchangePage.tsx
|
|
55926
|
-
import { COMMON_PANELS as COMMON_PANELS2 } from "@semiont/
|
|
55918
|
+
import { COMMON_PANELS as COMMON_PANELS2 } from "@semiont/sdk";
|
|
55927
55919
|
|
|
55928
55920
|
// src/features/admin-exchange/components/ExportCard.tsx
|
|
55929
55921
|
import { jsx as jsx73, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
@@ -56194,7 +56186,7 @@ function AdminExchangePage({
|
|
|
56194
56186
|
}
|
|
56195
56187
|
|
|
56196
56188
|
// src/features/admin-security/components/AdminSecurityPage.tsx
|
|
56197
|
-
import { COMMON_PANELS as COMMON_PANELS3 } from "@semiont/
|
|
56189
|
+
import { COMMON_PANELS as COMMON_PANELS3 } from "@semiont/sdk";
|
|
56198
56190
|
import { jsx as jsx77, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
56199
56191
|
function AdminSecurityPage({
|
|
56200
56192
|
providers,
|
|
@@ -56290,7 +56282,7 @@ function AdminSecurityPage({
|
|
|
56290
56282
|
}
|
|
56291
56283
|
|
|
56292
56284
|
// src/features/moderation-linked-data/components/LinkedDataPage.tsx
|
|
56293
|
-
import { COMMON_PANELS as COMMON_PANELS4 } from "@semiont/
|
|
56285
|
+
import { COMMON_PANELS as COMMON_PANELS4 } from "@semiont/sdk";
|
|
56294
56286
|
import { jsx as jsx78, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
56295
56287
|
function LinkedDataPage({
|
|
56296
56288
|
onExport,
|
|
@@ -56371,7 +56363,7 @@ function LinkedDataPage({
|
|
|
56371
56363
|
|
|
56372
56364
|
// src/features/admin-users/components/AdminUsersPage.tsx
|
|
56373
56365
|
import { useState as useState43 } from "react";
|
|
56374
|
-
import { COMMON_PANELS as COMMON_PANELS5 } from "@semiont/
|
|
56366
|
+
import { COMMON_PANELS as COMMON_PANELS5 } from "@semiont/sdk";
|
|
56375
56367
|
import { Fragment as Fragment15, jsx as jsx79, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
56376
56368
|
function UserTableRow({
|
|
56377
56369
|
user,
|
|
@@ -57083,7 +57075,7 @@ function WelcomePage({
|
|
|
57083
57075
|
}
|
|
57084
57076
|
|
|
57085
57077
|
// src/features/moderate-entity-tags/components/EntityTagsPage.tsx
|
|
57086
|
-
import { COMMON_PANELS as COMMON_PANELS6 } from "@semiont/
|
|
57078
|
+
import { COMMON_PANELS as COMMON_PANELS6 } from "@semiont/sdk";
|
|
57087
57079
|
import { Fragment as Fragment17, jsx as jsx84, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
57088
57080
|
function EntityTagsPage({
|
|
57089
57081
|
entityTypes,
|
|
@@ -57179,7 +57171,7 @@ function EntityTagsPage({
|
|
|
57179
57171
|
}
|
|
57180
57172
|
|
|
57181
57173
|
// src/features/moderate-recent/components/RecentDocumentsPage.tsx
|
|
57182
|
-
import { COMMON_PANELS as COMMON_PANELS7 } from "@semiont/
|
|
57174
|
+
import { COMMON_PANELS as COMMON_PANELS7 } from "@semiont/sdk";
|
|
57183
57175
|
import { jsx as jsx85, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
57184
57176
|
function RecentDocumentsPage({
|
|
57185
57177
|
isLoading,
|
|
@@ -57235,7 +57227,7 @@ function RecentDocumentsPage({
|
|
|
57235
57227
|
}
|
|
57236
57228
|
|
|
57237
57229
|
// src/features/moderate-tag-schemas/components/TagSchemasPage.tsx
|
|
57238
|
-
import { COMMON_PANELS as COMMON_PANELS8 } from "@semiont/
|
|
57230
|
+
import { COMMON_PANELS as COMMON_PANELS8 } from "@semiont/sdk";
|
|
57239
57231
|
import { jsx as jsx86, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
57240
57232
|
var domainIcons = {
|
|
57241
57233
|
legal: ScaleIcon_default,
|
|
@@ -57339,8 +57331,8 @@ function TagSchemasPage({
|
|
|
57339
57331
|
|
|
57340
57332
|
// src/features/resource-compose/components/ResourceComposePage.tsx
|
|
57341
57333
|
import { useState as useState45, useEffect as useEffect48 } from "react";
|
|
57342
|
-
import { isImageMimeType, isPdfMimeType as isPdfMimeType4, LOCALES as LOCALES3 } from "@semiont/
|
|
57343
|
-
import { COMMON_PANELS as COMMON_PANELS9 } from "@semiont/
|
|
57334
|
+
import { isImageMimeType, isPdfMimeType as isPdfMimeType4, LOCALES as LOCALES3 } from "@semiont/core";
|
|
57335
|
+
import { COMMON_PANELS as COMMON_PANELS9 } from "@semiont/sdk";
|
|
57344
57336
|
import { jsx as jsx87, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
57345
57337
|
function ResourceComposePage({
|
|
57346
57338
|
mode,
|
|
@@ -57815,8 +57807,8 @@ function ResourceComposePage({
|
|
|
57815
57807
|
|
|
57816
57808
|
// src/features/resource-discovery/components/ResourceDiscoveryPage.tsx
|
|
57817
57809
|
import { useState as useState46, useCallback as useCallback33, useRef as useRef36 } from "react";
|
|
57818
|
-
import { getResourceId as getResourceId3 } from "@semiont/
|
|
57819
|
-
import { COMMON_PANELS as COMMON_PANELS10 } from "@semiont/
|
|
57810
|
+
import { getResourceId as getResourceId3 } from "@semiont/core";
|
|
57811
|
+
import { COMMON_PANELS as COMMON_PANELS10 } from "@semiont/sdk";
|
|
57820
57812
|
|
|
57821
57813
|
// src/features/resource-discovery/components/ResourceCard.tsx
|
|
57822
57814
|
import React48 from "react";
|
|
@@ -58039,8 +58031,9 @@ function ResourceDiscoveryPage({
|
|
|
58039
58031
|
|
|
58040
58032
|
// src/features/resource-viewer/components/ResourceViewerPage.tsx
|
|
58041
58033
|
import { useState as useState48, useEffect as useEffect50, useCallback as useCallback34 } from "react";
|
|
58042
|
-
import { annotationId
|
|
58043
|
-
import { getLanguage, getPrimaryRepresentation as getPrimaryRepresentation2, getPrimaryMediaType as getPrimaryMediaType2
|
|
58034
|
+
import { annotationId } from "@semiont/core";
|
|
58035
|
+
import { getLanguage, getPrimaryRepresentation as getPrimaryRepresentation2, getPrimaryMediaType as getPrimaryMediaType2 } from "@semiont/core";
|
|
58036
|
+
import { getMimeCategory as getMimeCategory3 } from "@semiont/core";
|
|
58044
58037
|
|
|
58045
58038
|
// src/hooks/useMediaToken.ts
|
|
58046
58039
|
import { useEffect as useEffect49, useState as useState47 } from "react";
|
|
@@ -58053,27 +58046,35 @@ function useMediaToken(id2) {
|
|
|
58053
58046
|
setLoading(false);
|
|
58054
58047
|
return;
|
|
58055
58048
|
}
|
|
58049
|
+
let cancelled = false;
|
|
58056
58050
|
setLoading(true);
|
|
58057
|
-
semiont.
|
|
58051
|
+
semiont.auth.mediaToken(id2).then(({ token: t12 }) => {
|
|
58052
|
+
if (cancelled) return;
|
|
58058
58053
|
setToken(t12);
|
|
58059
58054
|
setLoading(false);
|
|
58060
58055
|
}).catch(() => {
|
|
58056
|
+
if (cancelled) return;
|
|
58061
58057
|
setLoading(false);
|
|
58062
58058
|
});
|
|
58063
58059
|
const refreshInterval = setInterval(() => {
|
|
58064
|
-
semiont.
|
|
58060
|
+
semiont.auth.mediaToken(id2).then(({ token: t12 }) => {
|
|
58061
|
+
if (!cancelled) setToken(t12);
|
|
58062
|
+
}).catch(() => {
|
|
58065
58063
|
});
|
|
58066
58064
|
}, 4 * 60 * 1e3);
|
|
58067
|
-
return () =>
|
|
58065
|
+
return () => {
|
|
58066
|
+
cancelled = true;
|
|
58067
|
+
clearInterval(refreshInterval);
|
|
58068
|
+
};
|
|
58068
58069
|
}, [semiont, id2]);
|
|
58069
58070
|
return { token, loading };
|
|
58070
58071
|
}
|
|
58071
58072
|
|
|
58072
58073
|
// src/features/resource-viewer/components/ResourceViewerPage.tsx
|
|
58073
|
-
import { createResourceViewerPageVM } from "@semiont/
|
|
58074
|
+
import { createResourceViewerPageVM } from "@semiont/sdk";
|
|
58074
58075
|
|
|
58075
58076
|
// src/hooks/useShellVM.ts
|
|
58076
|
-
import { createShellVM } from "@semiont/
|
|
58077
|
+
import { createShellVM } from "@semiont/sdk";
|
|
58077
58078
|
function readPanel() {
|
|
58078
58079
|
if (typeof window === "undefined") return null;
|
|
58079
58080
|
const saved = localStorage.getItem("activeToolbarPanel");
|
|
@@ -58151,7 +58152,7 @@ function ResourceViewerPage({
|
|
|
58151
58152
|
vm.closeWizard();
|
|
58152
58153
|
}, [vm]);
|
|
58153
58154
|
const handleWizardGenerateSubmit = useCallback34((referenceId, config) => {
|
|
58154
|
-
clearNewAnnotationId(
|
|
58155
|
+
clearNewAnnotationId(annotationId(referenceId));
|
|
58155
58156
|
vm.yield.generate(referenceId, {
|
|
58156
58157
|
title: config.title,
|
|
58157
58158
|
storageUri: config.storagePath,
|
|
@@ -58167,7 +58168,7 @@ function ResourceViewerPage({
|
|
|
58167
58168
|
try {
|
|
58168
58169
|
await semiont.bind.body(
|
|
58169
58170
|
rUri,
|
|
58170
|
-
|
|
58171
|
+
annotationId(referenceId),
|
|
58171
58172
|
[{ op: "add", item: { type: "SpecificResource", source: targetResourceId, purpose: "linking" } }]
|
|
58172
58173
|
);
|
|
58173
58174
|
showSuccess("Reference linked successfully");
|
|
@@ -58205,7 +58206,7 @@ function ResourceViewerPage({
|
|
|
58205
58206
|
const handleResourceArchive = useCallback34(async () => {
|
|
58206
58207
|
if (!semiont) return;
|
|
58207
58208
|
try {
|
|
58208
|
-
await semiont.
|
|
58209
|
+
await semiont.mark.archive(rUri);
|
|
58209
58210
|
await refetchDocument();
|
|
58210
58211
|
} catch (err) {
|
|
58211
58212
|
console.error("Failed to archive document:", err);
|
|
@@ -58215,7 +58216,7 @@ function ResourceViewerPage({
|
|
|
58215
58216
|
const handleResourceUnarchive = useCallback34(async () => {
|
|
58216
58217
|
if (!semiont) return;
|
|
58217
58218
|
try {
|
|
58218
|
-
await semiont.
|
|
58219
|
+
await semiont.mark.unarchive(rUri);
|
|
58219
58220
|
await refetchDocument();
|
|
58220
58221
|
} catch (err) {
|
|
58221
58222
|
console.error("Failed to unarchive document:", err);
|
|
@@ -58225,7 +58226,7 @@ function ResourceViewerPage({
|
|
|
58225
58226
|
const handleResourceClone = useCallback34(async () => {
|
|
58226
58227
|
if (!semiont) return;
|
|
58227
58228
|
try {
|
|
58228
|
-
const result = await semiont.
|
|
58229
|
+
const result = await semiont.yield.cloneToken(rUri);
|
|
58229
58230
|
const token = result.token;
|
|
58230
58231
|
browser2.emit("nav:push", { path: `/know/compose?mode=clone&token=${token}`, reason: "clone" });
|
|
58231
58232
|
} catch (err) {
|
|
@@ -58233,8 +58234,8 @@ function ResourceViewerPage({
|
|
|
58233
58234
|
showError("Failed to generate clone link");
|
|
58234
58235
|
}
|
|
58235
58236
|
}, [semiont, rUri, showError, session]);
|
|
58236
|
-
const handleAnnotationSparkle = useCallback34(({ annotationId:
|
|
58237
|
-
triggerSparkleAnimation(
|
|
58237
|
+
const handleAnnotationSparkle = useCallback34(({ annotationId: annotationId2 }) => {
|
|
58238
|
+
triggerSparkleAnimation(annotationId2);
|
|
58238
58239
|
}, [triggerSparkleAnimation]);
|
|
58239
58240
|
const handleAnnotationAdded = useCallback34((stored) => {
|
|
58240
58241
|
triggerSparkleAnimation(stored.payload.annotation.id);
|
|
@@ -58319,9 +58320,9 @@ function ResourceViewerPage({
|
|
|
58319
58320
|
return false;
|
|
58320
58321
|
});
|
|
58321
58322
|
const resourceWithContent = { ...resource, content: content4 };
|
|
58322
|
-
const handleEventHover = useCallback34((
|
|
58323
|
-
if (
|
|
58324
|
-
session?.client.
|
|
58323
|
+
const handleEventHover = useCallback34((id2) => {
|
|
58324
|
+
if (id2) {
|
|
58325
|
+
session?.client.beckon.sparkle(annotationId(id2));
|
|
58325
58326
|
}
|
|
58326
58327
|
}, [session]);
|
|
58327
58328
|
const handleEventClick = useCallback34((_annotationId) => {
|
|
@@ -58504,24 +58505,24 @@ function ResourceViewerPage({
|
|
|
58504
58505
|
}
|
|
58505
58506
|
|
|
58506
58507
|
// src/index.ts
|
|
58507
|
-
import { createBeckonVM, createHoverHandlers as createHoverHandlers4, HOVER_DELAY_MS as HOVER_DELAY_MS3 } from "@semiont/
|
|
58508
|
-
import { createMarkVM } from "@semiont/
|
|
58509
|
-
import { createShellVM as createShellVM2, COMMON_PANELS as COMMON_PANELS11, RESOURCE_PANELS } from "@semiont/
|
|
58510
|
-
import { createYieldVM } from "@semiont/
|
|
58511
|
-
import { createGatherVM } from "@semiont/
|
|
58512
|
-
import { createMatchVM } from "@semiont/
|
|
58513
|
-
import { createDiscoverVM } from "@semiont/
|
|
58514
|
-
import { createResourceViewerPageVM as createResourceViewerPageVM2 } from "@semiont/
|
|
58515
|
-
import { createComposePageVM } from "@semiont/
|
|
58516
|
-
import { createEntityTagsVM } from "@semiont/
|
|
58517
|
-
import { createExchangeVM } from "@semiont/
|
|
58518
|
-
import { createAdminUsersVM } from "@semiont/
|
|
58519
|
-
import { createAdminSecurityVM } from "@semiont/
|
|
58520
|
-
import { createWelcomeVM } from "@semiont/
|
|
58521
|
-
import { createResourceLoaderVM } from "@semiont/
|
|
58522
|
-
import { createSessionVM } from "@semiont/
|
|
58523
|
-
import { createJobClaimAdapter } from "@semiont/
|
|
58524
|
-
import { createJobQueueVM } from "@semiont/
|
|
58508
|
+
import { createBeckonVM, createHoverHandlers as createHoverHandlers4, HOVER_DELAY_MS as HOVER_DELAY_MS3 } from "@semiont/sdk";
|
|
58509
|
+
import { createMarkVM } from "@semiont/sdk";
|
|
58510
|
+
import { createShellVM as createShellVM2, COMMON_PANELS as COMMON_PANELS11, RESOURCE_PANELS } from "@semiont/sdk";
|
|
58511
|
+
import { createYieldVM } from "@semiont/sdk";
|
|
58512
|
+
import { createGatherVM } from "@semiont/sdk";
|
|
58513
|
+
import { createMatchVM } from "@semiont/sdk";
|
|
58514
|
+
import { createDiscoverVM } from "@semiont/sdk";
|
|
58515
|
+
import { createResourceViewerPageVM as createResourceViewerPageVM2 } from "@semiont/sdk";
|
|
58516
|
+
import { createComposePageVM } from "@semiont/sdk";
|
|
58517
|
+
import { createEntityTagsVM } from "@semiont/sdk";
|
|
58518
|
+
import { createExchangeVM } from "@semiont/sdk";
|
|
58519
|
+
import { createAdminUsersVM } from "@semiont/sdk";
|
|
58520
|
+
import { createAdminSecurityVM } from "@semiont/sdk";
|
|
58521
|
+
import { createWelcomeVM } from "@semiont/sdk";
|
|
58522
|
+
import { createResourceLoaderVM } from "@semiont/sdk";
|
|
58523
|
+
import { createSessionVM } from "@semiont/sdk";
|
|
58524
|
+
import { createJobClaimAdapter } from "@semiont/sdk";
|
|
58525
|
+
import { createJobQueueVM } from "@semiont/sdk";
|
|
58525
58526
|
export {
|
|
58526
58527
|
ANNOTATORS,
|
|
58527
58528
|
AVAILABLE_LOCALES,
|