@semiont/react-ui 0.2.35-build.98 → 0.2.35
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/README.md +1 -0
- package/dist/{EventBusContext-DMI4uwYk.d.mts → EventBusContext-CLnb2LmB.d.mts} +5 -5
- package/dist/{PdfAnnotationCanvas.client-HNYRKFDS.mjs → PdfAnnotationCanvas.client-COQREPXU.mjs} +7 -7
- package/dist/PdfAnnotationCanvas.client-COQREPXU.mjs.map +1 -0
- package/dist/ar-7SUXNE34.mjs +376 -0
- package/dist/ar-7SUXNE34.mjs.map +1 -0
- package/dist/bn-XOET3DOI.mjs +376 -0
- package/dist/bn-XOET3DOI.mjs.map +1 -0
- package/dist/{chunk-YI5IX5ZA.mjs → chunk-2HGWOLVN.mjs} +1 -1
- package/dist/{chunk-YI5IX5ZA.mjs.map → chunk-2HGWOLVN.mjs.map} +1 -1
- package/dist/{chunk-3FIQXKQF.mjs → chunk-Q2KV6Y2J.mjs} +28 -28
- package/dist/{chunk-MWQ5CNKW.mjs → chunk-ZPV43WN2.mjs} +11 -11
- package/dist/chunk-ZPV43WN2.mjs.map +1 -0
- package/dist/cs-X63DXX7L.mjs +376 -0
- package/dist/cs-X63DXX7L.mjs.map +1 -0
- package/dist/da-OWTCV57A.mjs +376 -0
- package/dist/da-OWTCV57A.mjs.map +1 -0
- package/dist/de-77BMFDVF.mjs +376 -0
- package/dist/de-77BMFDVF.mjs.map +1 -0
- package/dist/el-FIBNLH2V.mjs +376 -0
- package/dist/el-FIBNLH2V.mjs.map +1 -0
- package/dist/fa-3N4CIWE6.mjs +376 -0
- package/dist/fa-3N4CIWE6.mjs.map +1 -0
- package/dist/fi-JOM3M7Z4.mjs +376 -0
- package/dist/fi-JOM3M7Z4.mjs.map +1 -0
- package/dist/fr-56QSXS7E.mjs +376 -0
- package/dist/fr-56QSXS7E.mjs.map +1 -0
- package/dist/he-SNAXPJEK.mjs +376 -0
- package/dist/he-SNAXPJEK.mjs.map +1 -0
- package/dist/hi-CRBRD5TB.mjs +376 -0
- package/dist/hi-CRBRD5TB.mjs.map +1 -0
- package/dist/id-BRCVLICF.mjs +376 -0
- package/dist/id-BRCVLICF.mjs.map +1 -0
- package/dist/index.d.mts +169 -165
- package/dist/index.mjs +317 -313
- package/dist/index.mjs.map +1 -1
- package/dist/it-M2Z27BNB.mjs +376 -0
- package/dist/it-M2Z27BNB.mjs.map +1 -0
- package/dist/ja-TZUKW7HD.mjs +376 -0
- package/dist/ja-TZUKW7HD.mjs.map +1 -0
- package/dist/ko-NKBGGOL6.mjs +376 -0
- package/dist/ko-NKBGGOL6.mjs.map +1 -0
- package/dist/ms-XFXPN6RX.mjs +376 -0
- package/dist/ms-XFXPN6RX.mjs.map +1 -0
- package/dist/nl-MVYXAS5C.mjs +379 -0
- package/dist/nl-MVYXAS5C.mjs.map +1 -0
- package/dist/no-XOLO4JPV.mjs +376 -0
- package/dist/no-XOLO4JPV.mjs.map +1 -0
- package/dist/pl-TRWLMMC4.mjs +376 -0
- package/dist/pl-TRWLMMC4.mjs.map +1 -0
- package/dist/pt-M3TE24UI.mjs +376 -0
- package/dist/pt-M3TE24UI.mjs.map +1 -0
- package/dist/ro-QBFG2T64.mjs +376 -0
- package/dist/ro-QBFG2T64.mjs.map +1 -0
- package/dist/sv-IUECBXWX.mjs +376 -0
- package/dist/sv-IUECBXWX.mjs.map +1 -0
- package/dist/test-utils.d.mts +2 -2
- package/dist/test-utils.mjs +2 -2
- package/dist/th-US7KIN5Q.mjs +376 -0
- package/dist/th-US7KIN5Q.mjs.map +1 -0
- package/dist/tr-DWJ2FFUK.mjs +376 -0
- package/dist/tr-DWJ2FFUK.mjs.map +1 -0
- package/dist/uk-M4ZE4DPZ.mjs +376 -0
- package/dist/uk-M4ZE4DPZ.mjs.map +1 -0
- package/dist/vi-FERZNPSH.mjs +376 -0
- package/dist/vi-FERZNPSH.mjs.map +1 -0
- package/dist/zh-3J2I3WYK.mjs +376 -0
- package/dist/zh-3J2I3WYK.mjs.map +1 -0
- package/package.json +1 -1
- package/src/components/AnnotateReferencesProgressWidget.tsx +5 -5
- package/src/components/CodeMirrorRenderer.tsx +5 -5
- package/src/components/Toolbar.tsx +2 -2
- package/src/components/annotation/AnnotateToolbar.tsx +9 -9
- package/src/components/annotation/__tests__/AnnotateToolbar.test.tsx +17 -17
- package/src/components/image-annotation/AnnotationOverlay.tsx +10 -10
- package/src/components/image-annotation/SvgDrawingCanvas.tsx +4 -4
- package/src/components/navigation/CollapsibleResourceNavigation.tsx +7 -7
- package/src/components/navigation/ObservableLink.tsx +3 -3
- package/src/components/navigation/SimpleNavigation.tsx +2 -2
- package/src/components/pdf-annotation/PdfAnnotationCanvas.tsx +8 -8
- package/src/components/resource/AnnotateView.tsx +12 -12
- package/src/components/resource/BrowseView.tsx +9 -9
- package/src/components/resource/ResourceViewer.tsx +23 -23
- package/src/components/resource/__tests__/BrowseView.test.tsx +27 -27
- package/src/components/resource/__tests__/ResourceViewer.mode-switch.test.tsx +1 -1
- package/src/components/resource/panels/AssessmentEntry.tsx +2 -2
- package/src/components/resource/panels/AssessmentPanel.tsx +7 -7
- package/src/components/resource/panels/AssistSection.tsx +5 -5
- package/src/components/resource/panels/CommentEntry.tsx +2 -2
- package/src/components/resource/panels/CommentsPanel.tsx +7 -7
- package/src/components/resource/panels/HighlightEntry.tsx +2 -2
- package/src/components/resource/panels/HighlightPanel.tsx +5 -5
- package/src/components/resource/panels/ReferenceEntry.tsx +8 -8
- package/src/components/resource/panels/ReferencesPanel.tsx +10 -10
- package/src/components/resource/panels/ResourceInfoPanel.tsx +6 -6
- package/src/components/resource/panels/TagEntry.tsx +2 -2
- package/src/components/resource/panels/TaggingPanel.tsx +8 -8
- package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +2 -2
- package/src/components/resource/panels/__tests__/AssessmentPanel.test.tsx +4 -4
- package/src/components/resource/panels/__tests__/AssistSection.test.tsx +4 -4
- package/src/components/resource/panels/__tests__/CommentEntry.test.tsx +8 -8
- package/src/components/resource/panels/__tests__/CommentsPanel.test.tsx +3 -3
- package/src/components/resource/panels/__tests__/HighlightPanel.annotationProgress.test.tsx +1 -1
- package/src/components/resource/panels/__tests__/ReferencesPanel.test.tsx +3 -3
- package/src/components/resource/panels/__tests__/ResourceInfoPanel.test.tsx +9 -9
- package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +5 -5
- package/src/features/admin-devops/components/AdminDevOpsPage.tsx +2 -1
- package/src/features/admin-security/components/AdminSecurityPage.tsx +2 -1
- package/src/features/admin-users/components/AdminUsersPage.tsx +2 -1
- package/src/features/moderate-entity-tags/components/EntityTagsPage.tsx +2 -1
- package/src/features/moderate-recent/components/RecentDocumentsPage.tsx +2 -1
- package/src/features/moderate-tag-schemas/components/TagSchemasPage.tsx +2 -1
- package/src/features/resource-compose/components/ResourceComposePage.tsx +2 -1
- package/src/features/resource-discovery/components/ResourceDiscoveryPage.tsx +2 -1
- package/src/features/resource-viewer/__tests__/AnnotationCreationPending.test.tsx +26 -26
- package/src/features/resource-viewer/__tests__/AnnotationDeletionIntegration.test.tsx +21 -21
- package/src/features/resource-viewer/__tests__/AnnotationProgressDismissal.test.tsx +23 -23
- package/src/features/resource-viewer/__tests__/{ResolutionFlowIntegration.test.tsx → BindFlowIntegration.test.tsx} +49 -49
- package/src/features/resource-viewer/__tests__/DetectionFlowBug.test.tsx +18 -18
- package/src/features/resource-viewer/__tests__/DetectionFlowIntegration.test.tsx +19 -19
- package/src/features/resource-viewer/__tests__/ResourceMutations.test.tsx +19 -19
- package/src/features/resource-viewer/__tests__/ToastNotifications.test.tsx +13 -13
- package/src/features/resource-viewer/__tests__/{GenerationFlowIntegration.test.tsx → YieldFlowIntegration.test.tsx} +34 -34
- package/src/features/resource-viewer/__tests__/annotation-progress-flow.test.tsx +11 -11
- package/src/features/resource-viewer/components/ResourceViewerPage.tsx +55 -55
- package/translations/ar.json +298 -298
- package/translations/bn.json +298 -298
- package/translations/cs.json +295 -295
- package/translations/da.json +282 -282
- package/translations/de.json +281 -281
- package/translations/el.json +298 -298
- package/translations/fa.json +298 -298
- package/translations/fi.json +298 -298
- package/translations/fr.json +279 -279
- package/translations/he.json +298 -298
- package/translations/hi.json +298 -298
- package/translations/id.json +295 -295
- package/translations/it.json +299 -299
- package/translations/ja.json +298 -298
- package/translations/ko.json +298 -298
- package/translations/ms.json +296 -296
- package/translations/nl.json +299 -296
- package/translations/no.json +292 -292
- package/translations/pl.json +297 -297
- package/translations/pt.json +294 -294
- package/translations/ro.json +298 -298
- package/translations/sv.json +293 -293
- package/translations/th.json +298 -298
- package/translations/tr.json +298 -298
- package/translations/uk.json +298 -298
- package/translations/vi.json +298 -298
- package/translations/zh.json +298 -298
- package/dist/PdfAnnotationCanvas.client-HNYRKFDS.mjs.map +0 -1
- package/dist/ar-MDB7HC5S.mjs +0 -376
- package/dist/ar-MDB7HC5S.mjs.map +0 -1
- package/dist/bn-3SAV2ZEM.mjs +0 -376
- package/dist/bn-3SAV2ZEM.mjs.map +0 -1
- package/dist/chunk-MWQ5CNKW.mjs.map +0 -1
- package/dist/cs-AWCETEUV.mjs +0 -376
- package/dist/cs-AWCETEUV.mjs.map +0 -1
- package/dist/da-UZZHXYLC.mjs +0 -376
- package/dist/da-UZZHXYLC.mjs.map +0 -1
- package/dist/de-LQFWN6S5.mjs +0 -376
- package/dist/de-LQFWN6S5.mjs.map +0 -1
- package/dist/el-IWOETBJ7.mjs +0 -376
- package/dist/el-IWOETBJ7.mjs.map +0 -1
- package/dist/fa-BVEJZT5S.mjs +0 -376
- package/dist/fa-BVEJZT5S.mjs.map +0 -1
- package/dist/fi-JBNCGGA6.mjs +0 -376
- package/dist/fi-JBNCGGA6.mjs.map +0 -1
- package/dist/fr-OLH7PNGI.mjs +0 -376
- package/dist/fr-OLH7PNGI.mjs.map +0 -1
- package/dist/he-KOJQ4HMA.mjs +0 -376
- package/dist/he-KOJQ4HMA.mjs.map +0 -1
- package/dist/hi-BKJFZXAY.mjs +0 -376
- package/dist/hi-BKJFZXAY.mjs.map +0 -1
- package/dist/id-DPLHJVNP.mjs +0 -376
- package/dist/id-DPLHJVNP.mjs.map +0 -1
- package/dist/it-JXHAM7NL.mjs +0 -376
- package/dist/it-JXHAM7NL.mjs.map +0 -1
- package/dist/ja-DQRAO3PU.mjs +0 -376
- package/dist/ja-DQRAO3PU.mjs.map +0 -1
- package/dist/ko-6IFCOP6F.mjs +0 -376
- package/dist/ko-6IFCOP6F.mjs.map +0 -1
- package/dist/ms-KF5S2TLL.mjs +0 -376
- package/dist/ms-KF5S2TLL.mjs.map +0 -1
- package/dist/nl-2GUUZLQM.mjs +0 -376
- package/dist/nl-2GUUZLQM.mjs.map +0 -1
- package/dist/no-2IBCZGEF.mjs +0 -376
- package/dist/no-2IBCZGEF.mjs.map +0 -1
- package/dist/pl-ZEUBJ7YU.mjs +0 -376
- package/dist/pl-ZEUBJ7YU.mjs.map +0 -1
- package/dist/pt-WLAFIZWQ.mjs +0 -376
- package/dist/pt-WLAFIZWQ.mjs.map +0 -1
- package/dist/ro-K56IXFGU.mjs +0 -376
- package/dist/ro-K56IXFGU.mjs.map +0 -1
- package/dist/sv-VFJLMJRY.mjs +0 -376
- package/dist/sv-VFJLMJRY.mjs.map +0 -1
- package/dist/th-RICLQ2GW.mjs +0 -376
- package/dist/th-RICLQ2GW.mjs.map +0 -1
- package/dist/tr-SALXWE2M.mjs +0 -376
- package/dist/tr-SALXWE2M.mjs.map +0 -1
- package/dist/uk-3U3T3O2E.mjs +0 -376
- package/dist/uk-3U3T3O2E.mjs.map +0 -1
- package/dist/vi-LIVNZXOB.mjs +0 -376
- package/dist/vi-LIVNZXOB.mjs.map +0 -1
- package/dist/zh-KDUAZPX3.mjs +0 -376
- package/dist/zh-KDUAZPX3.mjs.map +0 -1
- /package/dist/{chunk-3FIQXKQF.mjs.map → chunk-Q2KV6Y2J.mjs.map} +0 -0
|
@@ -110,9 +110,9 @@ function createEventTracker() {
|
|
|
110
110
|
};
|
|
111
111
|
|
|
112
112
|
const annotationEvents = [
|
|
113
|
-
'
|
|
114
|
-
'
|
|
115
|
-
'
|
|
113
|
+
'beckon:hover',
|
|
114
|
+
'browse:click',
|
|
115
|
+
'beckon:focus',
|
|
116
116
|
] as const;
|
|
117
117
|
|
|
118
118
|
annotationEvents.forEach(eventName => {
|
|
@@ -274,7 +274,7 @@ describe('BrowseView Component', () => {
|
|
|
274
274
|
// (actual handler testing requires DOM interaction)
|
|
275
275
|
});
|
|
276
276
|
|
|
277
|
-
it('should emit
|
|
277
|
+
it('should emit beckon:hover when mouse enters annotation', async () => {
|
|
278
278
|
const tracker = createEventTracker();
|
|
279
279
|
const annotations = {
|
|
280
280
|
...defaultProps.annotations,
|
|
@@ -303,12 +303,12 @@ describe('BrowseView Component', () => {
|
|
|
303
303
|
|
|
304
304
|
await waitFor(() => {
|
|
305
305
|
expect(tracker.events.some(e =>
|
|
306
|
-
e.event === '
|
|
306
|
+
e.event === 'beckon:hover' && e.payload?.annotationId === 'ref-1'
|
|
307
307
|
)).toBe(true);
|
|
308
308
|
});
|
|
309
309
|
});
|
|
310
310
|
|
|
311
|
-
it('should emit
|
|
311
|
+
it('should emit beckon:hover with null when mouse exits after dwell', async () => {
|
|
312
312
|
vi.useFakeTimers();
|
|
313
313
|
const tracker = createEventTracker();
|
|
314
314
|
const annotations = {
|
|
@@ -336,7 +336,7 @@ describe('BrowseView Component', () => {
|
|
|
336
336
|
fireEvent.mouseOut(browseContainer!, { target: mockTarget });
|
|
337
337
|
|
|
338
338
|
expect(tracker.events.some(e =>
|
|
339
|
-
e.event === '
|
|
339
|
+
e.event === 'beckon:hover' && e.payload?.annotationId === null
|
|
340
340
|
)).toBe(true);
|
|
341
341
|
|
|
342
342
|
vi.useRealTimers();
|
|
@@ -395,7 +395,7 @@ describe('BrowseView Component', () => {
|
|
|
395
395
|
|
|
396
396
|
await waitFor(() => {
|
|
397
397
|
expect(tracker.events.some(e =>
|
|
398
|
-
e.event === '
|
|
398
|
+
e.event === 'beckon:hover' && e.payload?.annotationId === 'ref-1'
|
|
399
399
|
)).toBe(true);
|
|
400
400
|
});
|
|
401
401
|
|
|
@@ -406,7 +406,7 @@ describe('BrowseView Component', () => {
|
|
|
406
406
|
|
|
407
407
|
await waitFor(() => {
|
|
408
408
|
expect(tracker.events.some(e =>
|
|
409
|
-
e.event === '
|
|
409
|
+
e.event === 'beckon:hover' && e.payload?.annotationId === null
|
|
410
410
|
)).toBe(true);
|
|
411
411
|
});
|
|
412
412
|
|
|
@@ -417,12 +417,12 @@ describe('BrowseView Component', () => {
|
|
|
417
417
|
|
|
418
418
|
await waitFor(() => {
|
|
419
419
|
expect(tracker.events.some(e =>
|
|
420
|
-
e.event === '
|
|
420
|
+
e.event === 'beckon:hover' && e.payload?.annotationId === 'ref-2'
|
|
421
421
|
)).toBe(true);
|
|
422
422
|
});
|
|
423
423
|
});
|
|
424
424
|
|
|
425
|
-
it('should emit
|
|
425
|
+
it('should emit browse:click only for reference annotations', async () => {
|
|
426
426
|
const tracker = createEventTracker();
|
|
427
427
|
const annotations = {
|
|
428
428
|
...defaultProps.annotations,
|
|
@@ -455,7 +455,7 @@ describe('BrowseView Component', () => {
|
|
|
455
455
|
|
|
456
456
|
await waitFor(() => {
|
|
457
457
|
expect(tracker.events.some(e =>
|
|
458
|
-
e.event === '
|
|
458
|
+
e.event === 'browse:click' &&
|
|
459
459
|
e.payload?.annotationId === 'ref-1' &&
|
|
460
460
|
e.payload?.motivation === 'linking'
|
|
461
461
|
)).toBe(true);
|
|
@@ -467,31 +467,31 @@ describe('BrowseView Component', () => {
|
|
|
467
467
|
fireEvent.click(browseContainer!, { target: mockHighlightTarget });
|
|
468
468
|
|
|
469
469
|
await new Promise(resolve => setTimeout(resolve, 50));
|
|
470
|
-
expect(tracker.events.filter(e => e.event === '
|
|
470
|
+
expect(tracker.events.filter(e => e.event === 'browse:click').length).toBe(0);
|
|
471
471
|
});
|
|
472
472
|
});
|
|
473
473
|
|
|
474
474
|
describe('Event Subscriptions', () => {
|
|
475
|
-
it('should subscribe to
|
|
475
|
+
it('should subscribe to beckon:hover event', () => {
|
|
476
476
|
const tracker = createEventTracker();
|
|
477
477
|
renderWithEventTracking(<BrowseView {...defaultProps} />, tracker);
|
|
478
478
|
|
|
479
|
-
expect(tracker.subscriptions.has('
|
|
479
|
+
expect(tracker.subscriptions.has('beckon:hover')).toBe(true);
|
|
480
480
|
});
|
|
481
481
|
|
|
482
|
-
it('should subscribe to
|
|
482
|
+
it('should subscribe to beckon:hover event (legacy test)', () => {
|
|
483
483
|
const tracker = createEventTracker();
|
|
484
484
|
renderWithEventTracking(<BrowseView {...defaultProps} />, tracker);
|
|
485
485
|
|
|
486
|
-
// BrowseView subscribes to
|
|
487
|
-
expect(tracker.subscriptions.has('
|
|
486
|
+
// BrowseView subscribes to beckon:hover (not annotation-entry:hover)
|
|
487
|
+
expect(tracker.subscriptions.has('beckon:hover')).toBe(true);
|
|
488
488
|
});
|
|
489
489
|
|
|
490
|
-
it('should subscribe to
|
|
490
|
+
it('should subscribe to beckon:focus event', () => {
|
|
491
491
|
const tracker = createEventTracker();
|
|
492
492
|
renderWithEventTracking(<BrowseView {...defaultProps} />, tracker);
|
|
493
493
|
|
|
494
|
-
expect(tracker.subscriptions.has('
|
|
494
|
+
expect(tracker.subscriptions.has('beckon:focus')).toBe(true);
|
|
495
495
|
});
|
|
496
496
|
});
|
|
497
497
|
|
|
@@ -525,15 +525,15 @@ describe('BrowseView Component', () => {
|
|
|
525
525
|
React.useEffect(() => {
|
|
526
526
|
// Subscribe to events like a real component would
|
|
527
527
|
const handleHover = (payload: any) => {
|
|
528
|
-
eventTracker.push({ event: '
|
|
528
|
+
eventTracker.push({ event: 'beckon:hover', annotationId: payload?.annotationId ?? null });
|
|
529
529
|
};
|
|
530
530
|
|
|
531
531
|
const handleClick = (payload: any) => {
|
|
532
|
-
eventTracker.push({ event: '
|
|
532
|
+
eventTracker.push({ event: 'browse:click', annotationId: payload?.annotationId ?? null });
|
|
533
533
|
};
|
|
534
534
|
|
|
535
|
-
const subscription1 = eventBus.get('
|
|
536
|
-
const subscription2 = eventBus.get('
|
|
535
|
+
const subscription1 = eventBus.get('beckon:hover').subscribe(handleHover);
|
|
536
|
+
const subscription2 = eventBus.get('browse:click').subscribe(handleClick);
|
|
537
537
|
|
|
538
538
|
return () => {
|
|
539
539
|
subscription1.unsubscribe();
|
|
@@ -583,12 +583,12 @@ describe('BrowseView Component', () => {
|
|
|
583
583
|
// Verify event delegation works by simulating interactions
|
|
584
584
|
fireEvent.mouseOver(browseContainer!, { target: mockRefTarget });
|
|
585
585
|
await waitFor(() => {
|
|
586
|
-
expect(eventTracker.some(e => e.event === '
|
|
586
|
+
expect(eventTracker.some(e => e.event === 'beckon:hover' && e.annotationId === 'ref-1')).toBe(true);
|
|
587
587
|
});
|
|
588
588
|
|
|
589
589
|
fireEvent.click(browseContainer!, { target: mockRefTarget });
|
|
590
590
|
await waitFor(() => {
|
|
591
|
-
expect(eventTracker.some(e => e.event === '
|
|
591
|
+
expect(eventTracker.some(e => e.event === 'browse:click' && e.annotationId === 'ref-1')).toBe(true);
|
|
592
592
|
});
|
|
593
593
|
|
|
594
594
|
// Verify highlight doesn't trigger click events
|
|
@@ -597,7 +597,7 @@ describe('BrowseView Component', () => {
|
|
|
597
597
|
|
|
598
598
|
// Should not have any click events for highlights
|
|
599
599
|
await new Promise(resolve => setTimeout(resolve, 50));
|
|
600
|
-
expect(eventTracker.some(e => e.event === '
|
|
600
|
+
expect(eventTracker.some(e => e.event === 'browse:click')).toBe(false);
|
|
601
601
|
|
|
602
602
|
// The key insight: With event delegation, we can handle 100 annotations
|
|
603
603
|
// with only container-level listeners, not 100+ individual listeners
|
|
@@ -25,7 +25,7 @@ import type { components } from '@semiont/core';
|
|
|
25
25
|
type SemiontResource = components['schemas']['ResourceDescriptor'];
|
|
26
26
|
|
|
27
27
|
// Mock dependencies
|
|
28
|
-
vi.mock('../../../hooks/
|
|
28
|
+
vi.mock('../../../hooks/useObservableBrowse', () => ({
|
|
29
29
|
useObservableExternalNavigation: () => vi.fn(),
|
|
30
30
|
}));
|
|
31
31
|
|
|
@@ -4,7 +4,7 @@ import { forwardRef } from 'react';
|
|
|
4
4
|
import type { components } from '@semiont/core';
|
|
5
5
|
import { getAnnotationExactText } from '@semiont/api-client';
|
|
6
6
|
import { useEventBus } from '../../../contexts/EventBusContext';
|
|
7
|
-
import { useHoverEmitter } from '../../../hooks/
|
|
7
|
+
import { useHoverEmitter } from '../../../hooks/useBeckonFlow';
|
|
8
8
|
|
|
9
9
|
type Annotation = components['schemas']['Annotation'];
|
|
10
10
|
|
|
@@ -89,7 +89,7 @@ export const AssessmentEntry = forwardRef<HTMLDivElement, AssessmentEntryProps>(
|
|
|
89
89
|
data-type="assessment"
|
|
90
90
|
data-focused={isFocused ? 'true' : 'false'}
|
|
91
91
|
onClick={() => {
|
|
92
|
-
eventBus.get('
|
|
92
|
+
eventBus.get('browse:click').next({ annotationId: assessment.id, motivation: assessment.motivation });
|
|
93
93
|
}}
|
|
94
94
|
{...hoverProps}
|
|
95
95
|
>
|
|
@@ -55,9 +55,9 @@ interface AssessmentPanelProps {
|
|
|
55
55
|
/**
|
|
56
56
|
* Panel for managing assessment annotations with text input
|
|
57
57
|
*
|
|
58
|
-
* @emits
|
|
59
|
-
* @emits
|
|
60
|
-
* @subscribes
|
|
58
|
+
* @emits mark:create - Create new assessment annotation. Payload: { motivation: 'assessing', selector: Selector | Selector[], body: Body[] }
|
|
59
|
+
* @emits mark:cancel-pending - Cancel pending assessment annotation. Payload: undefined
|
|
60
|
+
* @subscribes browse:click - Annotation clicked. Payload: { annotationId: string }
|
|
61
61
|
*/
|
|
62
62
|
export function AssessmentPanel({
|
|
63
63
|
annotations,
|
|
@@ -141,7 +141,7 @@ export function AssessmentPanel({
|
|
|
141
141
|
? [{ type: 'TextualBody' as const, value: newAssessmentText, purpose: 'assessing' as const }]
|
|
142
142
|
: [];
|
|
143
143
|
|
|
144
|
-
eventBus.get('
|
|
144
|
+
eventBus.get('mark:create').next({
|
|
145
145
|
motivation: 'assessing',
|
|
146
146
|
selector: pendingAnnotation.selector,
|
|
147
147
|
body,
|
|
@@ -156,7 +156,7 @@ export function AssessmentPanel({
|
|
|
156
156
|
|
|
157
157
|
const handleEscape = (e: KeyboardEvent) => {
|
|
158
158
|
if (e.key === 'Escape') {
|
|
159
|
-
eventBus.get('
|
|
159
|
+
eventBus.get('mark:cancel-pending').next(undefined);
|
|
160
160
|
setNewAssessmentText('');
|
|
161
161
|
}
|
|
162
162
|
};
|
|
@@ -173,7 +173,7 @@ export function AssessmentPanel({
|
|
|
173
173
|
|
|
174
174
|
// Subscribe to click events - update focused state
|
|
175
175
|
useEventSubscriptions({
|
|
176
|
-
'
|
|
176
|
+
'browse:click': handleAnnotationClick,
|
|
177
177
|
});
|
|
178
178
|
|
|
179
179
|
return (
|
|
@@ -209,7 +209,7 @@ export function AssessmentPanel({
|
|
|
209
209
|
<div className="semiont-annotation-prompt__actions">
|
|
210
210
|
<button
|
|
211
211
|
onClick={() => {
|
|
212
|
-
eventBus.get('
|
|
212
|
+
eventBus.get('mark:cancel-pending').next(undefined);
|
|
213
213
|
setNewAssessmentText('');
|
|
214
214
|
}}
|
|
215
215
|
className="semiont-button semiont-button--secondary"
|
|
@@ -28,8 +28,8 @@ interface AssistSectionProps {
|
|
|
28
28
|
* - Assist button with sparkle animation
|
|
29
29
|
* - Progress display during annotation assist
|
|
30
30
|
*
|
|
31
|
-
* @emits
|
|
32
|
-
* @emits
|
|
31
|
+
* @emits mark:assist-request - Start assist for annotation type. Payload: { motivation: Motivation, options: { instructions?: string, tone?: string, density?: number } }
|
|
32
|
+
* @emits mark:progress-dismiss - Dismiss the annotation progress display
|
|
33
33
|
*/
|
|
34
34
|
export function AssistSection({
|
|
35
35
|
annotationType,
|
|
@@ -70,8 +70,8 @@ export function AssistSection({
|
|
|
70
70
|
annotationType === 'assessment' ? 'assessing' :
|
|
71
71
|
'commenting';
|
|
72
72
|
|
|
73
|
-
// Emit
|
|
74
|
-
eventBus.get('
|
|
73
|
+
// Emit mark:assist-request event with options
|
|
74
|
+
eventBus.get('mark:assist-request').next({
|
|
75
75
|
motivation,
|
|
76
76
|
options: {
|
|
77
77
|
instructions: instructions.trim() || undefined,
|
|
@@ -86,7 +86,7 @@ export function AssistSection({
|
|
|
86
86
|
}, [annotationType, instructions, tone, useDensity, density]); // eventBus is stable singleton - never in deps
|
|
87
87
|
|
|
88
88
|
const handleDismissProgress = useCallback(() => {
|
|
89
|
-
eventBus.get('
|
|
89
|
+
eventBus.get('mark:progress-dismiss').next(undefined);
|
|
90
90
|
}, []); // eventBus is stable singleton - never in deps
|
|
91
91
|
|
|
92
92
|
return (
|
|
@@ -5,7 +5,7 @@ import { useTranslations } from '../../../contexts/TranslationContext';
|
|
|
5
5
|
import type { components } from '@semiont/core';
|
|
6
6
|
import { getAnnotationExactText, getCommentText } from '@semiont/api-client';
|
|
7
7
|
import { useEventBus } from '../../../contexts/EventBusContext';
|
|
8
|
-
import { useHoverEmitter } from '../../../hooks/
|
|
8
|
+
import { useHoverEmitter } from '../../../hooks/useBeckonFlow';
|
|
9
9
|
|
|
10
10
|
type Annotation = components['schemas']['Annotation'];
|
|
11
11
|
|
|
@@ -88,7 +88,7 @@ export const CommentEntry = forwardRef<HTMLDivElement, CommentEntryProps>(
|
|
|
88
88
|
data-type="comment"
|
|
89
89
|
data-focused={isFocused ? 'true' : 'false'}
|
|
90
90
|
onClick={() => {
|
|
91
|
-
eventBus.get('
|
|
91
|
+
eventBus.get('browse:click').next({ annotationId: comment.id, motivation: comment.motivation });
|
|
92
92
|
}}
|
|
93
93
|
{...hoverProps}
|
|
94
94
|
>
|
|
@@ -55,9 +55,9 @@ interface CommentsPanelProps {
|
|
|
55
55
|
/**
|
|
56
56
|
* Panel for managing comment annotations with text input
|
|
57
57
|
*
|
|
58
|
-
* @emits
|
|
59
|
-
* @emits
|
|
60
|
-
* @subscribes
|
|
58
|
+
* @emits mark:create - Create new comment annotation. Payload: { motivation: 'commenting', selector: Selector | Selector[], body: Body[] }
|
|
59
|
+
* @emits mark:cancel-pending - Cancel pending comment annotation. Payload: undefined
|
|
60
|
+
* @subscribes browse:click - Annotation clicked. Payload: { annotationId: string }
|
|
61
61
|
*/
|
|
62
62
|
export function CommentsPanel({
|
|
63
63
|
annotations,
|
|
@@ -162,12 +162,12 @@ export function CommentsPanel({
|
|
|
162
162
|
}, []);
|
|
163
163
|
|
|
164
164
|
useEventSubscriptions({
|
|
165
|
-
'
|
|
165
|
+
'browse:click': handleAnnotationClick,
|
|
166
166
|
});
|
|
167
167
|
|
|
168
168
|
const handleSaveNewComment = () => {
|
|
169
169
|
if (newCommentText.trim() && pendingAnnotation) {
|
|
170
|
-
eventBus.get('
|
|
170
|
+
eventBus.get('mark:create').next({
|
|
171
171
|
motivation: 'commenting',
|
|
172
172
|
selector: pendingAnnotation.selector,
|
|
173
173
|
body: [{ type: 'TextualBody', value: newCommentText, purpose: 'commenting' }],
|
|
@@ -182,7 +182,7 @@ export function CommentsPanel({
|
|
|
182
182
|
|
|
183
183
|
const handleEscape = (e: KeyboardEvent) => {
|
|
184
184
|
if (e.key === 'Escape') {
|
|
185
|
-
eventBus.get('
|
|
185
|
+
eventBus.get('mark:cancel-pending').next(undefined);
|
|
186
186
|
setNewCommentText('');
|
|
187
187
|
}
|
|
188
188
|
};
|
|
@@ -224,7 +224,7 @@ export function CommentsPanel({
|
|
|
224
224
|
<div className="semiont-annotation-prompt__actions">
|
|
225
225
|
<button
|
|
226
226
|
onClick={() => {
|
|
227
|
-
eventBus.get('
|
|
227
|
+
eventBus.get('mark:cancel-pending').next(undefined);
|
|
228
228
|
setNewCommentText('');
|
|
229
229
|
}}
|
|
230
230
|
className="semiont-button semiont-button--secondary"
|
|
@@ -4,7 +4,7 @@ import { forwardRef } from 'react';
|
|
|
4
4
|
import type { components } from '@semiont/core';
|
|
5
5
|
import { getAnnotationExactText } from '@semiont/api-client';
|
|
6
6
|
import { useEventBus } from '../../../contexts/EventBusContext';
|
|
7
|
-
import { useHoverEmitter } from '../../../hooks/
|
|
7
|
+
import { useHoverEmitter } from '../../../hooks/useBeckonFlow';
|
|
8
8
|
|
|
9
9
|
type Annotation = components['schemas']['Annotation'];
|
|
10
10
|
|
|
@@ -52,7 +52,7 @@ export const HighlightEntry = forwardRef<HTMLDivElement, HighlightEntryProps>(
|
|
|
52
52
|
data-type="highlight"
|
|
53
53
|
data-focused={isFocused ? 'true' : 'false'}
|
|
54
54
|
onClick={() => {
|
|
55
|
-
eventBus.get('
|
|
55
|
+
eventBus.get('browse:click').next({ annotationId: highlight.id, motivation: highlight.motivation });
|
|
56
56
|
}}
|
|
57
57
|
{...hoverProps}
|
|
58
58
|
>
|
|
@@ -38,8 +38,8 @@ interface HighlightPanelProps {
|
|
|
38
38
|
/**
|
|
39
39
|
* Panel for managing highlight annotations with auto-creation
|
|
40
40
|
*
|
|
41
|
-
* @emits
|
|
42
|
-
* @subscribes
|
|
41
|
+
* @emits mark:create - Create new highlight annotation (auto-triggered). Payload: { motivation: 'highlighting', selector: Selector | Selector[], body: Body[] }
|
|
42
|
+
* @subscribes browse:click - Annotation clicked. Payload: { annotationId: string }
|
|
43
43
|
*/
|
|
44
44
|
export function HighlightPanel({
|
|
45
45
|
annotations,
|
|
@@ -125,14 +125,14 @@ export function HighlightPanel({
|
|
|
125
125
|
}, []);
|
|
126
126
|
|
|
127
127
|
useEventSubscriptions({
|
|
128
|
-
'
|
|
128
|
+
'browse:click': handleAnnotationClick,
|
|
129
129
|
});
|
|
130
130
|
|
|
131
131
|
// Highlights auto-create: when pendingAnnotation arrives with highlighting motivation,
|
|
132
|
-
// immediately emit
|
|
132
|
+
// immediately emit mark:create event
|
|
133
133
|
useEffect(() => {
|
|
134
134
|
if (pendingAnnotation && pendingAnnotation.motivation === 'highlighting') {
|
|
135
|
-
eventBus.get('
|
|
135
|
+
eventBus.get('mark:create').next({
|
|
136
136
|
motivation: 'highlighting',
|
|
137
137
|
selector: pendingAnnotation.selector,
|
|
138
138
|
body: [],
|
|
@@ -8,8 +8,8 @@ import { getAnnotationExactText, isBodyResolved, getBodySource, getFragmentSelec
|
|
|
8
8
|
import { getEntityTypes } from '@semiont/ontology';
|
|
9
9
|
import { getResourceIcon } from '../../../lib/resource-utils';
|
|
10
10
|
import { useEventBus } from '../../../contexts/EventBusContext';
|
|
11
|
-
import { useObservableExternalNavigation } from '../../../hooks/
|
|
12
|
-
import { useHoverEmitter } from '../../../hooks/
|
|
11
|
+
import { useObservableExternalNavigation } from '../../../hooks/useObservableBrowse';
|
|
12
|
+
import { useHoverEmitter } from '../../../hooks/useBeckonFlow';
|
|
13
13
|
|
|
14
14
|
type Annotation = components['schemas']['Annotation'];
|
|
15
15
|
|
|
@@ -66,14 +66,14 @@ export const ReferenceEntry = forwardRef<HTMLDivElement, ReferenceEntryProps>(
|
|
|
66
66
|
if (resolvedResourceUri) {
|
|
67
67
|
const resourceId = resolvedResourceUri.split('/resources/')[1];
|
|
68
68
|
if (resourceId) {
|
|
69
|
-
// Use observable navigation - emits '
|
|
69
|
+
// Use observable navigation - emits 'browse:external-navigate' event
|
|
70
70
|
navigate(routes.resourceDetail(resourceId), { resourceId });
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
const handleComposeDocument = () => {
|
|
76
|
-
eventBus.get('
|
|
76
|
+
eventBus.get('bind:create-manual').next({
|
|
77
77
|
annotationUri: reference.id,
|
|
78
78
|
title: selectedText,
|
|
79
79
|
entityTypes,
|
|
@@ -86,7 +86,7 @@ export const ReferenceEntry = forwardRef<HTMLDivElement, ReferenceEntryProps>(
|
|
|
86
86
|
? reference.target.source
|
|
87
87
|
: '';
|
|
88
88
|
if (sourceUri) {
|
|
89
|
-
eventBus.get('
|
|
89
|
+
eventBus.get('bind:update-body').next({
|
|
90
90
|
annotationUri: reference.id,
|
|
91
91
|
resourceId: sourceUri.split('/resources/')[1] || '',
|
|
92
92
|
operations: [{ op: 'remove' }], // Remove all body items
|
|
@@ -100,7 +100,7 @@ export const ReferenceEntry = forwardRef<HTMLDivElement, ReferenceEntryProps>(
|
|
|
100
100
|
: '';
|
|
101
101
|
|
|
102
102
|
// Emit request to open generation modal
|
|
103
|
-
eventBus.get('
|
|
103
|
+
eventBus.get('yield:modal-open').next({
|
|
104
104
|
annotationUri: reference.id,
|
|
105
105
|
resourceUri,
|
|
106
106
|
defaultTitle: selectedText,
|
|
@@ -108,7 +108,7 @@ export const ReferenceEntry = forwardRef<HTMLDivElement, ReferenceEntryProps>(
|
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
const handleSearch = () => {
|
|
111
|
-
eventBus.get('
|
|
111
|
+
eventBus.get('bind:link').next({
|
|
112
112
|
annotationUri: reference.id,
|
|
113
113
|
searchTerm: selectedText,
|
|
114
114
|
});
|
|
@@ -121,7 +121,7 @@ export const ReferenceEntry = forwardRef<HTMLDivElement, ReferenceEntryProps>(
|
|
|
121
121
|
data-type="reference"
|
|
122
122
|
data-focused={isFocused ? 'true' : 'false'}
|
|
123
123
|
onClick={() => {
|
|
124
|
-
eventBus.get('
|
|
124
|
+
eventBus.get('browse:click').next({ annotationId: reference.id, motivation: reference.motivation });
|
|
125
125
|
}}
|
|
126
126
|
{...hoverProps}
|
|
127
127
|
>
|
|
@@ -11,7 +11,7 @@ import type { components, paths, Selector } from '@semiont/core';
|
|
|
11
11
|
import { getTextPositionSelector, getTargetSelector } from '@semiont/api-client';
|
|
12
12
|
import { PanelHeader } from './PanelHeader';
|
|
13
13
|
import './ReferencesPanel.css';
|
|
14
|
-
import type {
|
|
14
|
+
import type { MarkProgress } from '@semiont/core';
|
|
15
15
|
|
|
16
16
|
type Annotation = components['schemas']['Annotation'];
|
|
17
17
|
type Motivation = components['schemas']['Motivation'];
|
|
@@ -45,7 +45,7 @@ interface Props {
|
|
|
45
45
|
// Generic panel props
|
|
46
46
|
annotations?: Annotation[];
|
|
47
47
|
isAssisting: boolean;
|
|
48
|
-
progress:
|
|
48
|
+
progress: MarkProgress | null;
|
|
49
49
|
annotateMode?: boolean;
|
|
50
50
|
Link: React.ComponentType<LinkComponentProps>;
|
|
51
51
|
routes: RouteBuilder;
|
|
@@ -65,9 +65,9 @@ interface Props {
|
|
|
65
65
|
* Panel for managing reference annotations with entity type annotation
|
|
66
66
|
*
|
|
67
67
|
* @emits annotate:detect-request - Start reference annotation. Payload: { motivation: 'linking', options: { entityTypes: string[], includeDescriptiveReferences: boolean } }
|
|
68
|
-
* @emits
|
|
69
|
-
* @emits
|
|
70
|
-
* @subscribes
|
|
68
|
+
* @emits mark:create - Create new reference annotation. Payload: { motivation: 'linking', selector: Selector | Selector[], body: Body[] }
|
|
69
|
+
* @emits mark:cancel-pending - Cancel pending reference annotation. Payload: undefined
|
|
70
|
+
* @subscribes browse:click - Annotation clicked. Payload: { annotationId: string }
|
|
71
71
|
*/
|
|
72
72
|
export function ReferencesPanel({
|
|
73
73
|
annotations = [],
|
|
@@ -196,13 +196,13 @@ export function ReferencesPanel({
|
|
|
196
196
|
}, []);
|
|
197
197
|
|
|
198
198
|
useEventSubscriptions({
|
|
199
|
-
'
|
|
199
|
+
'browse:click': handleAnnotationClick,
|
|
200
200
|
});
|
|
201
201
|
|
|
202
202
|
// Clear log when starting new annotation
|
|
203
203
|
const handleAssist = () => {
|
|
204
204
|
setLastDetectionLog(null);
|
|
205
|
-
eventBus.get('
|
|
205
|
+
eventBus.get('mark:assist-request').next({
|
|
206
206
|
motivation: 'linking',
|
|
207
207
|
options: {
|
|
208
208
|
entityTypes: selectedEntityTypes,
|
|
@@ -245,7 +245,7 @@ export function ReferencesPanel({
|
|
|
245
245
|
const handleCreateReference = () => {
|
|
246
246
|
if (pendingAnnotation) {
|
|
247
247
|
const entityType = pendingEntityTypes.join(',') || undefined;
|
|
248
|
-
eventBus.get('
|
|
248
|
+
eventBus.get('mark:create').next({
|
|
249
249
|
motivation: 'linking',
|
|
250
250
|
selector: pendingAnnotation.selector,
|
|
251
251
|
body: entityType ? [{ type: 'TextualBody', value: entityType, purpose: 'tagging' }] : [],
|
|
@@ -260,7 +260,7 @@ export function ReferencesPanel({
|
|
|
260
260
|
|
|
261
261
|
const handleEscape = (e: KeyboardEvent) => {
|
|
262
262
|
if (e.key === 'Escape') {
|
|
263
|
-
eventBus.get('
|
|
263
|
+
eventBus.get('mark:cancel-pending').next(undefined);
|
|
264
264
|
setPendingEntityTypes([]);
|
|
265
265
|
}
|
|
266
266
|
};
|
|
@@ -312,7 +312,7 @@ export function ReferencesPanel({
|
|
|
312
312
|
<div className="semiont-annotation-prompt__actions">
|
|
313
313
|
<button
|
|
314
314
|
onClick={() => {
|
|
315
|
-
eventBus.get('
|
|
315
|
+
eventBus.get('mark:cancel-pending').next(undefined);
|
|
316
316
|
setPendingEntityTypes([]);
|
|
317
317
|
}}
|
|
318
318
|
className="semiont-button semiont-button--secondary"
|
|
@@ -16,9 +16,9 @@ interface Props {
|
|
|
16
16
|
/**
|
|
17
17
|
* Panel for displaying resource metadata and management actions
|
|
18
18
|
*
|
|
19
|
-
* @emits
|
|
20
|
-
* @emits
|
|
21
|
-
* @emits
|
|
19
|
+
* @emits yield:clone - Clone this resource. Payload: undefined
|
|
20
|
+
* @emits mark:unarchive - Unarchive this resource. Payload: undefined
|
|
21
|
+
* @emits mark:archive - Archive this resource. Payload: undefined
|
|
22
22
|
*/
|
|
23
23
|
export function ResourceInfoPanel({
|
|
24
24
|
documentEntityTypes,
|
|
@@ -97,7 +97,7 @@ export function ResourceInfoPanel({
|
|
|
97
97
|
{/* Clone Action */}
|
|
98
98
|
<div className="semiont-resource-info-panel__action-section">
|
|
99
99
|
<button
|
|
100
|
-
onClick={() => eventBus.get('
|
|
100
|
+
onClick={() => eventBus.get('yield:clone').next(undefined)}
|
|
101
101
|
className="semiont-resource-button semiont-resource-button--secondary"
|
|
102
102
|
>
|
|
103
103
|
🔗 {t('clone')}
|
|
@@ -112,7 +112,7 @@ export function ResourceInfoPanel({
|
|
|
112
112
|
{isArchived ? (
|
|
113
113
|
<>
|
|
114
114
|
<button
|
|
115
|
-
onClick={() => eventBus.get('
|
|
115
|
+
onClick={() => eventBus.get('mark:unarchive').next(undefined)}
|
|
116
116
|
className="semiont-resource-button semiont-resource-button--secondary"
|
|
117
117
|
>
|
|
118
118
|
📤 {t('unarchive')}
|
|
@@ -124,7 +124,7 @@ export function ResourceInfoPanel({
|
|
|
124
124
|
) : (
|
|
125
125
|
<>
|
|
126
126
|
<button
|
|
127
|
-
onClick={() => eventBus.get('
|
|
127
|
+
onClick={() => eventBus.get('mark:archive').next(undefined)}
|
|
128
128
|
className="semiont-resource-button semiont-resource-button--archive"
|
|
129
129
|
>
|
|
130
130
|
📦 {t('archive')}
|
|
@@ -6,7 +6,7 @@ import { getAnnotationExactText } from '@semiont/api-client';
|
|
|
6
6
|
import { getTagCategory, getTagSchemaId } from '@semiont/ontology';
|
|
7
7
|
import { getTagSchema } from '../../../lib/tag-schemas';
|
|
8
8
|
import { useEventBus } from '../../../contexts/EventBusContext';
|
|
9
|
-
import { useHoverEmitter } from '../../../hooks/
|
|
9
|
+
import { useHoverEmitter } from '../../../hooks/useBeckonFlow';
|
|
10
10
|
|
|
11
11
|
type Annotation = components['schemas']['Annotation'];
|
|
12
12
|
|
|
@@ -37,7 +37,7 @@ export const TagEntry = forwardRef<HTMLDivElement, TagEntryProps>(
|
|
|
37
37
|
<div
|
|
38
38
|
ref={ref}
|
|
39
39
|
onClick={() => {
|
|
40
|
-
eventBus.get('
|
|
40
|
+
eventBus.get('browse:click').next({ annotationId: tag.id, motivation: tag.motivation });
|
|
41
41
|
}}
|
|
42
42
|
{...hoverProps}
|
|
43
43
|
className={`semiont-annotation-entry${isHovered ? ' semiont-annotation-pulse' : ''}`}
|
|
@@ -60,9 +60,9 @@ interface TaggingPanelProps {
|
|
|
60
60
|
* Panel for managing tag annotations with schema-based annotation
|
|
61
61
|
*
|
|
62
62
|
* @emits annotate:detect-request - Start tag annotation. Payload: { motivation: 'tagging', options: { schemaId: string, categories: string[] } }
|
|
63
|
-
* @emits
|
|
64
|
-
* @emits
|
|
65
|
-
* @subscribes
|
|
63
|
+
* @emits mark:cancel-pending - Cancel pending tag annotation. Payload: undefined
|
|
64
|
+
* @emits mark:create - Create new tag annotation. Payload: { motivation: 'tagging', selector: Selector | Selector[], body: Body[] }
|
|
65
|
+
* @subscribes browse:click - Annotation clicked. Payload: { annotationId: string }
|
|
66
66
|
*/
|
|
67
67
|
export function TaggingPanel({
|
|
68
68
|
annotations,
|
|
@@ -102,7 +102,7 @@ export function TaggingPanel({
|
|
|
102
102
|
}, []);
|
|
103
103
|
|
|
104
104
|
useEventSubscriptions({
|
|
105
|
-
'
|
|
105
|
+
'browse:click': handleAnnotationClick,
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
// Direct ref management
|
|
@@ -195,7 +195,7 @@ export function TaggingPanel({
|
|
|
195
195
|
|
|
196
196
|
const handleAssist = () => {
|
|
197
197
|
if (selectedCategories.size > 0) {
|
|
198
|
-
eventBus.get('
|
|
198
|
+
eventBus.get('mark:assist-request').next({
|
|
199
199
|
motivation: 'tagging',
|
|
200
200
|
options: {
|
|
201
201
|
schemaId: selectedSchemaId,
|
|
@@ -212,7 +212,7 @@ export function TaggingPanel({
|
|
|
212
212
|
|
|
213
213
|
const handleEscape = (e: KeyboardEvent) => {
|
|
214
214
|
if (e.key === 'Escape') {
|
|
215
|
-
eventBus.get('
|
|
215
|
+
eventBus.get('mark:cancel-pending').next(undefined);
|
|
216
216
|
}
|
|
217
217
|
};
|
|
218
218
|
|
|
@@ -274,7 +274,7 @@ export function TaggingPanel({
|
|
|
274
274
|
className="semiont-select"
|
|
275
275
|
onChange={(e) => {
|
|
276
276
|
if (e.target.value && pendingAnnotation) {
|
|
277
|
-
eventBus.get('
|
|
277
|
+
eventBus.get('mark:create').next({
|
|
278
278
|
motivation: 'tagging',
|
|
279
279
|
selector: pendingAnnotation.selector,
|
|
280
280
|
body: [
|
|
@@ -305,7 +305,7 @@ export function TaggingPanel({
|
|
|
305
305
|
{/* Cancel button */}
|
|
306
306
|
<div className="semiont-annotation-prompt__footer">
|
|
307
307
|
<button
|
|
308
|
-
onClick={() => eventBus.get('
|
|
308
|
+
onClick={() => eventBus.get('mark:cancel-pending').next(undefined)}
|
|
309
309
|
className="semiont-button semiont-button--secondary"
|
|
310
310
|
data-type="tag"
|
|
311
311
|
>
|