@semiont/react-ui 0.2.35-build.100 → 0.2.35-build.101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +6 -2
- package/dist/index.mjs +128 -124
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- 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/dist/index.d.mts
CHANGED
|
@@ -3833,7 +3833,11 @@ declare function useAnnotationFlow(rUri: ResourceUri): AnnotationFlowState;
|
|
|
3833
3833
|
* Follows react-rxjs-guide.md Layer 2 pattern: Hook bridge that
|
|
3834
3834
|
* subscribes to events and pushes values into React state.
|
|
3835
3835
|
*/
|
|
3836
|
-
type ToolbarPanelType = '
|
|
3836
|
+
type ToolbarPanelType = 'history' | 'info' | 'annotations' | 'settings' | 'collaboration' | 'user' | 'jsonld';
|
|
3837
|
+
/** Panels available on all pages */
|
|
3838
|
+
declare const COMMON_PANELS: readonly ToolbarPanelType[];
|
|
3839
|
+
/** Panels available only on resource viewer pages */
|
|
3840
|
+
declare const RESOURCE_PANELS: readonly ToolbarPanelType[];
|
|
3837
3841
|
interface PanelNavigationState {
|
|
3838
3842
|
activePanel: ToolbarPanelType | null;
|
|
3839
3843
|
scrollToAnnotationId: string | null;
|
|
@@ -3953,4 +3957,4 @@ interface ResolutionFlowState {
|
|
|
3953
3957
|
*/
|
|
3954
3958
|
declare function useResolutionFlow(rUri: ResourceUri): ResolutionFlowState;
|
|
3955
3959
|
|
|
3956
|
-
export { ANNOTATORS, AUTH_EVENTS, AVAILABLE_LOCALES, AdminDevOpsPage, type AdminDevOpsPageProps, AdminSecurityPage, type AdminSecurityPageProps, type AdminUser, type AdminUserStats, AdminUsersPage, type AdminUsersPageProps, AnnotateReferencesProgressWidget, AnnotateToolbar, AnnotateView, type Annotation$l as Annotation, type AnnotationConfig, type AnnotationCreationHandler, type AnnotationFlowState, type AnnotationHandlers, AnnotationHistory, type AnnotationManager, AnnotationOverlay, AnnotationProvider, type AnnotationProviderProps, type AnnotationUIState, type AnnotationsCollection, type Annotator, ApiClientProvider, type ApiClientProviderProps, AssessmentEntry, AssessmentPanel, AssistSection, AsyncErrorBoundary, type AttentionFlowState, AuthErrorDisplay, type AuthErrorDisplayProps, type AuthEventDetail, type AuthEventType, AuthTokenProvider, type AuthTokenProviderProps, type AvailableLocale, type BorderRadiusToken, BrowseView, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type CacheManager, CacheProvider, type CacheProviderProps, type ClickAction, CodeMirrorRenderer, CollaborationPanel, CollapsibleResourceNavigation, type CollapsibleResourceNavigationProps, type ColorToken, CommentEntry, CommentsPanel, ComposeLoadingState, type ComposeLoadingStateProps, type ContextCorrelationFlowConfig, type ContextCorrelationFlowState, type CreateAnnotationParams, type CreateConfig, type DeleteAnnotationParams, type DetectionConfig, type DevOpsFeature, type DrawingMode, EntityTagsPage, type EntityTagsPageProps, EntityTypeBadges, ErrorBoundary, Footer, type GenerationFlowState, type GenerationOptions, HOVER_DELAY_MS, HighlightEntry, HighlightPanel, HistoryEvent, type HoverEmitterProps, type HoverHandlers, ImageURLSchema, ImageViewer, JsonLdPanel, JsonLdView, type KeyboardShortcut, KeyboardShortcutsHelpModal, LeftSidebar, type LinkComponentProps, LiveRegionProvider, type Motivation$8 as Motivation, type NavigationItem, NavigationMenu, type NavigationMenuHelper, type NavigationProps, type OAuthProvider, type OAuthUser, OAuthUserSchema, ObservableLink, type ObservableLinkProps, type OpenResource, OpenResourcesManager, OpenResourcesProvider, type OverlayAnnotation, PageLayout, PanelHeader, type PanelNavigationState, PopupContainer, PopupHeader, ProposeEntitiesModal, QUERY_KEYS, RecentDocumentsPage, type RecentDocumentsPageProps, ReferenceEntry, ReferenceResolutionWidget, ReferencesPanel, ResizeHandle, type ResolutionFlowState, type ResolvedTheme, ResourceAnnotationsProvider, ResourceCard, type ResourceCardProps, ResourceComposePage, type ResourceComposePageProps, ResourceDiscoveryPage, type ResourceDiscoveryPageProps, ResourceErrorState, type ResourceErrorStateProps, ResourceInfoPanel, ResourceLoadingState, ResourceSearchModal, type ResourceSearchModalProps, ResourceTagsInline, ResourceViewer, ResourceViewerPage, type ResourceViewerPageProps, type RouteBuilder, type SaveResourceParams, SearchModal, type SearchModalProps, SelectedTextDisplay, type SelectionMotivation, type SelectorType, SemiontBranding, SemiontFavicon, type SemiontResource$4 as SemiontResource, SessionExpiryBanner, SessionManager, SessionProvider, SessionTimer, SettingsPanel, type ShadowToken, type ShapeType, SignInForm, type SignInFormProps, SignUpForm, type SignUpFormProps, SimpleNavigation, type SimpleNavigationItem, type SimpleNavigationProps, SkipLinks, SortableResourceTab, type SortableResourceTabProps, type SpacingToken, StatisticsPanel, StatusDisplay, type StreamStatus, SvgDrawingCanvas, TagEntry, TagSchemasPage, type TagSchemasPageProps, TaggingPanel, type TextSegment, type TextSelection, type Theme, ThemeProvider, ToastContainer, type ToastMessage, ToastProvider, type ToastType, Toolbar, type ToolbarPanelType, type TransitionToken, TranslationManager, TranslationProvider, type TranslationProviderProps, type TypographyToken, type UICreateAnnotationParams, UnifiedAnnotationsPanel, UnifiedHeader, type UseResourceContentResult, UserMenuSkeleton, WelcomePage, type WelcomePageProps, applyHighlights, buildSourceToRenderedMap, buildTextNodeIndex, buttonStyles, clearHighlights, createHoverHandlers, cssVariables, dispatch401Error, dispatch403Error, dispatchAuthEvent, faviconPaths, formatTime, generateCSSVariables, getResourceIcon, getSelectedShapeForSelectorType, getSelectorType, getShortcutDisplay, getSupportedShapes, hideWidgetPreview, isShapeSupported, jsonLightHighlightStyle, jsonLightTheme, onAuthEvent, resolveAnnotationRanges, sanitizeImageURL, saveSelectedShapeForSelectorType, showWidgetPreview, supportsDetection, toOverlayAnnotations, tokens, useAdmin, useAnnotationFlow, useAnnotationManager, useAnnotations, useApiClient, useAttentionFlow, useAuthApi, useAuthToken, useCacheManager, useContextCorrelationFlow, useDebounce, useDebouncedCallback, useDocumentAnnouncements, useDoubleKeyPress, useDropdown, useEntityTypes, useEventSubscription, useEventSubscriptions, useFormAnnouncements, useGenerationFlow, useHealth, useHoverDelay, useHoverEmitter, useIsTyping, useKeyboardShortcuts, useLanguageChangeAnnouncements, useLineNumbers, useLiveRegion, useLoadingState, useLocalStorage, useObservableExternalNavigation, useObservableRouter, useOpenResources, usePanelNavigation, usePanelWidth, usePreloadTranslations, useResolutionFlow, useResourceAnnotations, useResourceContent, useResourceEvents, useResourceLoadingAnnouncements, useResources, useRovingTabIndex, useSearchAnnouncements, useSessionContext, useSessionExpiry, useTheme, useToast, useTranslations };
|
|
3960
|
+
export { ANNOTATORS, AUTH_EVENTS, AVAILABLE_LOCALES, AdminDevOpsPage, type AdminDevOpsPageProps, AdminSecurityPage, type AdminSecurityPageProps, type AdminUser, type AdminUserStats, AdminUsersPage, type AdminUsersPageProps, AnnotateReferencesProgressWidget, AnnotateToolbar, AnnotateView, type Annotation$l as Annotation, type AnnotationConfig, type AnnotationCreationHandler, type AnnotationFlowState, type AnnotationHandlers, AnnotationHistory, type AnnotationManager, AnnotationOverlay, AnnotationProvider, type AnnotationProviderProps, type AnnotationUIState, type AnnotationsCollection, type Annotator, ApiClientProvider, type ApiClientProviderProps, AssessmentEntry, AssessmentPanel, AssistSection, AsyncErrorBoundary, type AttentionFlowState, AuthErrorDisplay, type AuthErrorDisplayProps, type AuthEventDetail, type AuthEventType, AuthTokenProvider, type AuthTokenProviderProps, type AvailableLocale, type BorderRadiusToken, BrowseView, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, COMMON_PANELS, type CacheManager, CacheProvider, type CacheProviderProps, type ClickAction, CodeMirrorRenderer, CollaborationPanel, CollapsibleResourceNavigation, type CollapsibleResourceNavigationProps, type ColorToken, CommentEntry, CommentsPanel, ComposeLoadingState, type ComposeLoadingStateProps, type ContextCorrelationFlowConfig, type ContextCorrelationFlowState, type CreateAnnotationParams, type CreateConfig, type DeleteAnnotationParams, type DetectionConfig, type DevOpsFeature, type DrawingMode, EntityTagsPage, type EntityTagsPageProps, EntityTypeBadges, ErrorBoundary, Footer, type GenerationFlowState, type GenerationOptions, HOVER_DELAY_MS, HighlightEntry, HighlightPanel, HistoryEvent, type HoverEmitterProps, type HoverHandlers, ImageURLSchema, ImageViewer, JsonLdPanel, JsonLdView, type KeyboardShortcut, KeyboardShortcutsHelpModal, LeftSidebar, type LinkComponentProps, LiveRegionProvider, type Motivation$8 as Motivation, type NavigationItem, NavigationMenu, type NavigationMenuHelper, type NavigationProps, type OAuthProvider, type OAuthUser, OAuthUserSchema, ObservableLink, type ObservableLinkProps, type OpenResource, OpenResourcesManager, OpenResourcesProvider, type OverlayAnnotation, PageLayout, PanelHeader, type PanelNavigationState, PopupContainer, PopupHeader, ProposeEntitiesModal, QUERY_KEYS, RESOURCE_PANELS, RecentDocumentsPage, type RecentDocumentsPageProps, ReferenceEntry, ReferenceResolutionWidget, ReferencesPanel, ResizeHandle, type ResolutionFlowState, type ResolvedTheme, ResourceAnnotationsProvider, ResourceCard, type ResourceCardProps, ResourceComposePage, type ResourceComposePageProps, ResourceDiscoveryPage, type ResourceDiscoveryPageProps, ResourceErrorState, type ResourceErrorStateProps, ResourceInfoPanel, ResourceLoadingState, ResourceSearchModal, type ResourceSearchModalProps, ResourceTagsInline, ResourceViewer, ResourceViewerPage, type ResourceViewerPageProps, type RouteBuilder, type SaveResourceParams, SearchModal, type SearchModalProps, SelectedTextDisplay, type SelectionMotivation, type SelectorType, SemiontBranding, SemiontFavicon, type SemiontResource$4 as SemiontResource, SessionExpiryBanner, SessionManager, SessionProvider, SessionTimer, SettingsPanel, type ShadowToken, type ShapeType, SignInForm, type SignInFormProps, SignUpForm, type SignUpFormProps, SimpleNavigation, type SimpleNavigationItem, type SimpleNavigationProps, SkipLinks, SortableResourceTab, type SortableResourceTabProps, type SpacingToken, StatisticsPanel, StatusDisplay, type StreamStatus, SvgDrawingCanvas, TagEntry, TagSchemasPage, type TagSchemasPageProps, TaggingPanel, type TextSegment, type TextSelection, type Theme, ThemeProvider, ToastContainer, type ToastMessage, ToastProvider, type ToastType, Toolbar, type ToolbarPanelType, type TransitionToken, TranslationManager, TranslationProvider, type TranslationProviderProps, type TypographyToken, type UICreateAnnotationParams, UnifiedAnnotationsPanel, UnifiedHeader, type UseResourceContentResult, UserMenuSkeleton, WelcomePage, type WelcomePageProps, applyHighlights, buildSourceToRenderedMap, buildTextNodeIndex, buttonStyles, clearHighlights, createHoverHandlers, cssVariables, dispatch401Error, dispatch403Error, dispatchAuthEvent, faviconPaths, formatTime, generateCSSVariables, getResourceIcon, getSelectedShapeForSelectorType, getSelectorType, getShortcutDisplay, getSupportedShapes, hideWidgetPreview, isShapeSupported, jsonLightHighlightStyle, jsonLightTheme, onAuthEvent, resolveAnnotationRanges, sanitizeImageURL, saveSelectedShapeForSelectorType, showWidgetPreview, supportsDetection, toOverlayAnnotations, tokens, useAdmin, useAnnotationFlow, useAnnotationManager, useAnnotations, useApiClient, useAttentionFlow, useAuthApi, useAuthToken, useCacheManager, useContextCorrelationFlow, useDebounce, useDebouncedCallback, useDocumentAnnouncements, useDoubleKeyPress, useDropdown, useEntityTypes, useEventSubscription, useEventSubscriptions, useFormAnnouncements, useGenerationFlow, useHealth, useHoverDelay, useHoverEmitter, useIsTyping, useKeyboardShortcuts, useLanguageChangeAnnouncements, useLineNumbers, useLiveRegion, useLoadingState, useLocalStorage, useObservableExternalNavigation, useObservableRouter, useOpenResources, usePanelNavigation, usePanelWidth, usePreloadTranslations, useResolutionFlow, useResourceAnnotations, useResourceContent, useResourceEvents, useResourceLoadingAnnouncements, useResources, useRovingTabIndex, useSearchAnnouncements, useSessionContext, useSessionExpiry, useTheme, useToast, useTranslations };
|
package/dist/index.mjs
CHANGED
|
@@ -54628,6 +54628,68 @@ function UserCircleIcon({
|
|
|
54628
54628
|
var ForwardRef17 = /* @__PURE__ */ React44.forwardRef(UserCircleIcon);
|
|
54629
54629
|
var UserCircleIcon_default = ForwardRef17;
|
|
54630
54630
|
|
|
54631
|
+
// src/hooks/usePanelNavigation.ts
|
|
54632
|
+
import { useState as useState36, useCallback as useCallback31, useEffect as useEffect43 } from "react";
|
|
54633
|
+
var COMMON_PANELS = ["user", "settings"];
|
|
54634
|
+
var RESOURCE_PANELS = ["history", "info", "annotations", "collaboration", "jsonld"];
|
|
54635
|
+
var tabGenerationCounter = 0;
|
|
54636
|
+
function usePanelNavigation() {
|
|
54637
|
+
const [activePanel, setActivePanel] = useState36(() => {
|
|
54638
|
+
if (typeof window !== "undefined") {
|
|
54639
|
+
const saved = localStorage.getItem("activeToolbarPanel");
|
|
54640
|
+
return saved || null;
|
|
54641
|
+
}
|
|
54642
|
+
return null;
|
|
54643
|
+
});
|
|
54644
|
+
const [scrollToAnnotationId, setScrollToAnnotationId] = useState36(null);
|
|
54645
|
+
const [panelInitialTab, setPanelInitialTab] = useState36(null);
|
|
54646
|
+
useEffect43(() => {
|
|
54647
|
+
if (typeof window === "undefined") return;
|
|
54648
|
+
if (activePanel) {
|
|
54649
|
+
localStorage.setItem("activeToolbarPanel", activePanel);
|
|
54650
|
+
} else {
|
|
54651
|
+
localStorage.removeItem("activeToolbarPanel");
|
|
54652
|
+
}
|
|
54653
|
+
}, [activePanel]);
|
|
54654
|
+
const handleScrollCompleted = useCallback31(() => {
|
|
54655
|
+
setScrollToAnnotationId(null);
|
|
54656
|
+
}, []);
|
|
54657
|
+
const handlePanelToggle = useCallback31(({ panel }) => {
|
|
54658
|
+
setActivePanel((current) => current === panel ? null : panel);
|
|
54659
|
+
}, []);
|
|
54660
|
+
const handlePanelOpen = useCallback31(({ panel, scrollToAnnotationId: scrollTarget, motivation }) => {
|
|
54661
|
+
if (scrollTarget) {
|
|
54662
|
+
setScrollToAnnotationId(scrollTarget);
|
|
54663
|
+
}
|
|
54664
|
+
if (motivation) {
|
|
54665
|
+
const motivationToTab = {
|
|
54666
|
+
"linking": "reference",
|
|
54667
|
+
"commenting": "comment",
|
|
54668
|
+
"tagging": "tag",
|
|
54669
|
+
"highlighting": "highlight",
|
|
54670
|
+
"assessing": "assessment"
|
|
54671
|
+
};
|
|
54672
|
+
const tab2 = motivationToTab[motivation] || "highlight";
|
|
54673
|
+
setPanelInitialTab({ tab: tab2, generation: ++tabGenerationCounter });
|
|
54674
|
+
}
|
|
54675
|
+
setActivePanel(panel);
|
|
54676
|
+
}, []);
|
|
54677
|
+
const handlePanelClose = useCallback31(() => {
|
|
54678
|
+
setActivePanel(null);
|
|
54679
|
+
}, []);
|
|
54680
|
+
useEventSubscriptions({
|
|
54681
|
+
"attend:panel-toggle": handlePanelToggle,
|
|
54682
|
+
"attend:panel-open": handlePanelOpen,
|
|
54683
|
+
"attend:panel-close": handlePanelClose
|
|
54684
|
+
});
|
|
54685
|
+
return {
|
|
54686
|
+
activePanel,
|
|
54687
|
+
scrollToAnnotationId,
|
|
54688
|
+
panelInitialTab,
|
|
54689
|
+
onScrollCompleted: handleScrollCompleted
|
|
54690
|
+
};
|
|
54691
|
+
}
|
|
54692
|
+
|
|
54631
54693
|
// src/features/admin-devops/components/AdminDevOpsPage.tsx
|
|
54632
54694
|
import { jsx as jsx66, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
54633
54695
|
function AdminDevOpsPage({
|
|
@@ -54640,7 +54702,7 @@ function AdminDevOpsPage({
|
|
|
54640
54702
|
ToolbarPanels,
|
|
54641
54703
|
Toolbar: Toolbar2
|
|
54642
54704
|
}) {
|
|
54643
|
-
return /* @__PURE__ */ jsxs54("div", { className: `semiont-page${activePanel ? " semiont-page--panel-open" : ""}`, children: [
|
|
54705
|
+
return /* @__PURE__ */ jsxs54("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
|
|
54644
54706
|
/* @__PURE__ */ jsxs54("div", { className: "semiont-page__content", children: [
|
|
54645
54707
|
/* @__PURE__ */ jsxs54("div", { className: "semiont-page__header", children: [
|
|
54646
54708
|
/* @__PURE__ */ jsx66("h1", { className: "semiont-page__title", children: t12.title }),
|
|
@@ -54713,7 +54775,7 @@ function AdminSecurityPage({
|
|
|
54713
54775
|
ToolbarPanels,
|
|
54714
54776
|
Toolbar: Toolbar2
|
|
54715
54777
|
}) {
|
|
54716
|
-
return /* @__PURE__ */ jsxs55("div", { className: `semiont-page${activePanel ? " semiont-page--panel-open" : ""}`, children: [
|
|
54778
|
+
return /* @__PURE__ */ jsxs55("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
|
|
54717
54779
|
/* @__PURE__ */ jsx67("div", { className: "semiont-page__content", children: /* @__PURE__ */ jsxs55("div", { className: "semiont-page__sections", children: [
|
|
54718
54780
|
/* @__PURE__ */ jsxs55("div", { className: "semiont-page__header", children: [
|
|
54719
54781
|
/* @__PURE__ */ jsx67("h1", { className: "semiont-page__title", children: t12.title }),
|
|
@@ -54796,7 +54858,7 @@ function AdminSecurityPage({
|
|
|
54796
54858
|
}
|
|
54797
54859
|
|
|
54798
54860
|
// src/features/admin-users/components/AdminUsersPage.tsx
|
|
54799
|
-
import { useState as
|
|
54861
|
+
import { useState as useState37 } from "react";
|
|
54800
54862
|
import { Fragment as Fragment15, jsx as jsx68, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
54801
54863
|
function UserTableRow({
|
|
54802
54864
|
user,
|
|
@@ -54878,9 +54940,9 @@ function AdminUsersPage({
|
|
|
54878
54940
|
Toolbar: Toolbar2,
|
|
54879
54941
|
buttonStyles: buttonStyles2
|
|
54880
54942
|
}) {
|
|
54881
|
-
const [searchTerm, setSearchTerm] =
|
|
54882
|
-
const [selectedRole, setSelectedRole] =
|
|
54883
|
-
const [selectedStatus, setSelectedStatus] =
|
|
54943
|
+
const [searchTerm, setSearchTerm] = useState37("");
|
|
54944
|
+
const [selectedRole, setSelectedRole] = useState37("all");
|
|
54945
|
+
const [selectedStatus, setSelectedStatus] = useState37("all");
|
|
54884
54946
|
const filteredUsers = users.filter((user) => {
|
|
54885
54947
|
const matchesSearch = (user.name || "").toLowerCase().includes(searchTerm.toLowerCase()) || user.email.toLowerCase().includes(searchTerm.toLowerCase());
|
|
54886
54948
|
const userRole = user.isAdmin ? "admin" : "user";
|
|
@@ -54889,7 +54951,7 @@ function AdminUsersPage({
|
|
|
54889
54951
|
const matchesStatus = selectedStatus === "all" || userStatus === selectedStatus;
|
|
54890
54952
|
return matchesSearch && matchesRole && matchesStatus;
|
|
54891
54953
|
});
|
|
54892
|
-
return /* @__PURE__ */ jsxs56("div", { className: `semiont-page${activePanel ? " semiont-page--panel-open" : ""}`, children: [
|
|
54954
|
+
return /* @__PURE__ */ jsxs56("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
|
|
54893
54955
|
/* @__PURE__ */ jsx68("div", { className: "semiont-page__content", children: /* @__PURE__ */ jsxs56("div", { className: "semiont-page__sections", children: [
|
|
54894
54956
|
/* @__PURE__ */ jsxs56("div", { className: "semiont-page__header-with-action", children: [
|
|
54895
54957
|
/* @__PURE__ */ jsxs56("div", { children: [
|
|
@@ -55195,7 +55257,7 @@ function SignInForm({
|
|
|
55195
55257
|
}
|
|
55196
55258
|
|
|
55197
55259
|
// src/features/auth/components/SignUpForm.tsx
|
|
55198
|
-
import { useState as
|
|
55260
|
+
import { useState as useState38 } from "react";
|
|
55199
55261
|
import { jsx as jsx70, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
55200
55262
|
function GoogleIcon2() {
|
|
55201
55263
|
return /* @__PURE__ */ jsxs58("svg", { className: "semiont-icon semiont-icon--small semiont-icon--inline", viewBox: "0 0 24 24", children: [
|
|
@@ -55230,7 +55292,7 @@ function GoogleIcon2() {
|
|
|
55230
55292
|
] });
|
|
55231
55293
|
}
|
|
55232
55294
|
function SignUpForm({ onSignUp, Link, translations: t12 }) {
|
|
55233
|
-
const [isLoading, setIsLoading] =
|
|
55295
|
+
const [isLoading, setIsLoading] = useState38(false);
|
|
55234
55296
|
const handleSignUp = async () => {
|
|
55235
55297
|
setIsLoading(true);
|
|
55236
55298
|
try {
|
|
@@ -55455,7 +55517,7 @@ function EntityTagsPage({
|
|
|
55455
55517
|
onAddTag();
|
|
55456
55518
|
}
|
|
55457
55519
|
};
|
|
55458
|
-
return /* @__PURE__ */ jsxs61("div", { className: `semiont-page${activePanel ? " semiont-page--panel-open" : ""}`, children: [
|
|
55520
|
+
return /* @__PURE__ */ jsxs61("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
|
|
55459
55521
|
/* @__PURE__ */ jsxs61("div", { className: "semiont-page__content", children: [
|
|
55460
55522
|
/* @__PURE__ */ jsxs61("div", { className: "semiont-page__header", children: [
|
|
55461
55523
|
/* @__PURE__ */ jsx73("h1", { className: "semiont-page__title", children: t12.pageTitle }),
|
|
@@ -55543,7 +55605,7 @@ function RecentDocumentsPage({
|
|
|
55543
55605
|
if (isLoading) {
|
|
55544
55606
|
return /* @__PURE__ */ jsx74("div", { className: "semiont-page__loading", children: /* @__PURE__ */ jsx74("p", { className: "semiont-page__loading-text", children: t12.loading }) });
|
|
55545
55607
|
}
|
|
55546
|
-
return /* @__PURE__ */ jsxs62("div", { className: `semiont-page${activePanel ? " semiont-page--panel-open" : ""}`, children: [
|
|
55608
|
+
return /* @__PURE__ */ jsxs62("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
|
|
55547
55609
|
/* @__PURE__ */ jsxs62("div", { className: "semiont-page__content", children: [
|
|
55548
55610
|
/* @__PURE__ */ jsxs62("div", { className: "semiont-page__header", children: [
|
|
55549
55611
|
/* @__PURE__ */ jsx74("h1", { className: "semiont-page__title", children: t12.pageTitle }),
|
|
@@ -55609,7 +55671,7 @@ function TagSchemasPage({
|
|
|
55609
55671
|
if (isLoading) {
|
|
55610
55672
|
return /* @__PURE__ */ jsx75("div", { className: "semiont-page__loading", children: /* @__PURE__ */ jsx75("p", { className: "semiont-page__loading-text", children: t12.loading }) });
|
|
55611
55673
|
}
|
|
55612
|
-
return /* @__PURE__ */ jsxs63("div", { className: `semiont-page${activePanel ? " semiont-page--panel-open" : ""}`, children: [
|
|
55674
|
+
return /* @__PURE__ */ jsxs63("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
|
|
55613
55675
|
/* @__PURE__ */ jsxs63("div", { className: "semiont-page__content", children: [
|
|
55614
55676
|
/* @__PURE__ */ jsxs63("div", { className: "semiont-page__header", children: [
|
|
55615
55677
|
/* @__PURE__ */ jsx75("h1", { className: "semiont-page__title", children: t12.pageTitle }),
|
|
@@ -55687,7 +55749,7 @@ function TagSchemasPage({
|
|
|
55687
55749
|
}
|
|
55688
55750
|
|
|
55689
55751
|
// src/features/resource-compose/components/ResourceComposePage.tsx
|
|
55690
|
-
import { useState as
|
|
55752
|
+
import { useState as useState39, useEffect as useEffect44 } from "react";
|
|
55691
55753
|
import { isImageMimeType, isPdfMimeType as isPdfMimeType4, LOCALES as LOCALES2 } from "@semiont/api-client";
|
|
55692
55754
|
import { jsx as jsx76, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
55693
55755
|
function ResourceComposePage({
|
|
@@ -55707,19 +55769,19 @@ function ResourceComposePage({
|
|
|
55707
55769
|
Toolbar: Toolbar2
|
|
55708
55770
|
}) {
|
|
55709
55771
|
const { announceFormSubmitting, announceFormSuccess, announceFormError } = useFormAnnouncements();
|
|
55710
|
-
const [newResourceName, setNewResourceName] =
|
|
55711
|
-
const [newResourceContent, setNewResourceContent] =
|
|
55712
|
-
const [selectedEntityTypes, setSelectedEntityTypes] =
|
|
55713
|
-
const [isCreating, setIsCreating] =
|
|
55714
|
-
const [inputMethod, setInputMethod] =
|
|
55715
|
-
const [uploadedFile, setUploadedFile] =
|
|
55716
|
-
const [fileMimeType, setFileMimeType] =
|
|
55717
|
-
const [filePreviewUrl, setFilePreviewUrl] =
|
|
55718
|
-
const [selectedFormat, setSelectedFormat] =
|
|
55719
|
-
const [selectedLanguage, setSelectedLanguage] =
|
|
55720
|
-
const [selectedCharset, setSelectedCharset] =
|
|
55721
|
-
const [archiveOriginal, setArchiveOriginal] =
|
|
55722
|
-
|
|
55772
|
+
const [newResourceName, setNewResourceName] = useState39("");
|
|
55773
|
+
const [newResourceContent, setNewResourceContent] = useState39("");
|
|
55774
|
+
const [selectedEntityTypes, setSelectedEntityTypes] = useState39([]);
|
|
55775
|
+
const [isCreating, setIsCreating] = useState39(false);
|
|
55776
|
+
const [inputMethod, setInputMethod] = useState39("write");
|
|
55777
|
+
const [uploadedFile, setUploadedFile] = useState39(null);
|
|
55778
|
+
const [fileMimeType, setFileMimeType] = useState39("text/markdown");
|
|
55779
|
+
const [filePreviewUrl, setFilePreviewUrl] = useState39(null);
|
|
55780
|
+
const [selectedFormat, setSelectedFormat] = useState39("text/markdown");
|
|
55781
|
+
const [selectedLanguage, setSelectedLanguage] = useState39(initialLocale);
|
|
55782
|
+
const [selectedCharset, setSelectedCharset] = useState39("");
|
|
55783
|
+
const [archiveOriginal, setArchiveOriginal] = useState39(true);
|
|
55784
|
+
useEffect44(() => {
|
|
55723
55785
|
if (mode === "clone" && cloneData) {
|
|
55724
55786
|
setNewResourceName(cloneData.sourceResource.name);
|
|
55725
55787
|
setNewResourceContent(cloneData.sourceContent);
|
|
@@ -55752,7 +55814,7 @@ function ResourceComposePage({
|
|
|
55752
55814
|
reader.readAsText(file);
|
|
55753
55815
|
}
|
|
55754
55816
|
};
|
|
55755
|
-
|
|
55817
|
+
useEffect44(() => {
|
|
55756
55818
|
return () => {
|
|
55757
55819
|
if (filePreviewUrl) {
|
|
55758
55820
|
URL.revokeObjectURL(filePreviewUrl);
|
|
@@ -55800,7 +55862,7 @@ function ResourceComposePage({
|
|
|
55800
55862
|
};
|
|
55801
55863
|
const isClone = mode === "clone";
|
|
55802
55864
|
const isReferenceCompletion = mode === "reference";
|
|
55803
|
-
return /* @__PURE__ */ jsxs64("div", { className: `semiont-page${activePanel ? " semiont-page--panel-open" : ""}`, children: [
|
|
55865
|
+
return /* @__PURE__ */ jsxs64("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
|
|
55804
55866
|
/* @__PURE__ */ jsxs64("div", { className: "semiont-page__content semiont-page__compose", children: [
|
|
55805
55867
|
/* @__PURE__ */ jsxs64("div", { className: "semiont-page__header", children: [
|
|
55806
55868
|
/* @__PURE__ */ jsx76("h1", { className: "semiont-page__title", children: isClone ? t12.titleEditClone : isReferenceCompletion ? t12.titleCompleteReference : t12.title }),
|
|
@@ -56101,7 +56163,7 @@ function ResourceComposePage({
|
|
|
56101
56163
|
}
|
|
56102
56164
|
|
|
56103
56165
|
// src/features/resource-discovery/components/ResourceDiscoveryPage.tsx
|
|
56104
|
-
import { useState as
|
|
56166
|
+
import { useState as useState40, useCallback as useCallback32, useRef as useRef31 } from "react";
|
|
56105
56167
|
import { getResourceId as getResourceId2 } from "@semiont/api-client";
|
|
56106
56168
|
|
|
56107
56169
|
// src/features/resource-discovery/components/ResourceCard.tsx
|
|
@@ -56174,8 +56236,8 @@ function ResourceDiscoveryPage({
|
|
|
56174
56236
|
translations: t12,
|
|
56175
56237
|
ToolbarPanels
|
|
56176
56238
|
}) {
|
|
56177
|
-
const [searchQuery2, setSearchQuery] =
|
|
56178
|
-
const [selectedEntityType, setSelectedEntityType] =
|
|
56239
|
+
const [searchQuery2, setSearchQuery] = useState40("");
|
|
56240
|
+
const [selectedEntityType, setSelectedEntityType] = useState40("");
|
|
56179
56241
|
const hasSearchQuery = searchQuery2.trim() !== "";
|
|
56180
56242
|
const hasSearchResults = searchDocuments.length > 0;
|
|
56181
56243
|
const baseDocuments = hasSearchResults ? searchDocuments : recentDocuments;
|
|
@@ -56194,23 +56256,23 @@ function ResourceDiscoveryPage({
|
|
|
56194
56256
|
);
|
|
56195
56257
|
const onNavigateToResourceRef = useRef31(onNavigateToResource);
|
|
56196
56258
|
onNavigateToResourceRef.current = onNavigateToResource;
|
|
56197
|
-
const handleEntityTypeFilter =
|
|
56259
|
+
const handleEntityTypeFilter = useCallback32((entityType3) => {
|
|
56198
56260
|
setSelectedEntityType(entityType3);
|
|
56199
56261
|
}, []);
|
|
56200
|
-
const openResource =
|
|
56262
|
+
const openResource = useCallback32((resource) => {
|
|
56201
56263
|
const resourceId = getResourceId2(resource);
|
|
56202
56264
|
if (resourceId) {
|
|
56203
56265
|
onNavigateToResourceRef.current(resourceId);
|
|
56204
56266
|
}
|
|
56205
56267
|
}, []);
|
|
56206
|
-
const handleSearchSubmit =
|
|
56268
|
+
const handleSearchSubmit = useCallback32((e6) => {
|
|
56207
56269
|
e6.preventDefault();
|
|
56208
56270
|
}, []);
|
|
56209
56271
|
if (isLoadingRecent) {
|
|
56210
56272
|
return /* @__PURE__ */ jsx78("div", { className: "semiont-page__loading", children: /* @__PURE__ */ jsx78("p", { className: "semiont-page__loading-text", children: t12.loadingKnowledgeBase }) });
|
|
56211
56273
|
}
|
|
56212
56274
|
const showNoResultsWarning = hasSearchQuery && !hasSearchResults && !isSearching;
|
|
56213
|
-
return /* @__PURE__ */ jsxs66("div", { className: `semiont-page${activePanel ? " semiont-page--panel-open" : ""}`, children: [
|
|
56275
|
+
return /* @__PURE__ */ jsxs66("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
|
|
56214
56276
|
/* @__PURE__ */ jsxs66("div", { className: "semiont-page__content", children: [
|
|
56215
56277
|
/* @__PURE__ */ jsxs66("div", { className: "semiont-page__header", children: [
|
|
56216
56278
|
/* @__PURE__ */ jsx78("h1", { className: "semiont-page__title", children: t12.title }),
|
|
@@ -56342,7 +56404,7 @@ import { getLanguage, getPrimaryRepresentation, getPrimaryMediaType as getPrimar
|
|
|
56342
56404
|
import { uriToAnnotationId as uriToAnnotationId2 } from "@semiont/core";
|
|
56343
56405
|
|
|
56344
56406
|
// src/hooks/useResolutionFlow.ts
|
|
56345
|
-
import { useCallback as
|
|
56407
|
+
import { useCallback as useCallback33, useEffect as useEffect45, useRef as useRef32, useState as useState41 } from "react";
|
|
56346
56408
|
import { resourceAnnotationUri, accessToken as accessToken3 } from "@semiont/core";
|
|
56347
56409
|
import { uriToAnnotationIdOrPassthrough } from "@semiont/core";
|
|
56348
56410
|
function toAccessToken2(token) {
|
|
@@ -56353,24 +56415,24 @@ function useResolutionFlow(rUri) {
|
|
|
56353
56415
|
const client = useApiClient();
|
|
56354
56416
|
const token = useAuthToken();
|
|
56355
56417
|
const { showError } = useToast();
|
|
56356
|
-
const [searchModalOpen, setSearchModalOpen] =
|
|
56357
|
-
const [pendingReferenceId, setPendingReferenceId] =
|
|
56358
|
-
const onCloseSearchModal =
|
|
56418
|
+
const [searchModalOpen, setSearchModalOpen] = useState41(false);
|
|
56419
|
+
const [pendingReferenceId, setPendingReferenceId] = useState41(null);
|
|
56420
|
+
const onCloseSearchModal = useCallback33(() => {
|
|
56359
56421
|
setSearchModalOpen(false);
|
|
56360
56422
|
}, []);
|
|
56361
56423
|
const rUriRef = useRef32(rUri);
|
|
56362
|
-
|
|
56424
|
+
useEffect45(() => {
|
|
56363
56425
|
rUriRef.current = rUri;
|
|
56364
56426
|
});
|
|
56365
56427
|
const clientRef = useRef32(client);
|
|
56366
|
-
|
|
56428
|
+
useEffect45(() => {
|
|
56367
56429
|
clientRef.current = client;
|
|
56368
56430
|
});
|
|
56369
56431
|
const tokenRef = useRef32(token);
|
|
56370
|
-
|
|
56432
|
+
useEffect45(() => {
|
|
56371
56433
|
tokenRef.current = token;
|
|
56372
56434
|
});
|
|
56373
|
-
|
|
56435
|
+
useEffect45(() => {
|
|
56374
56436
|
const handleAnnotationUpdateBody = async (event) => {
|
|
56375
56437
|
try {
|
|
56376
56438
|
const annotationIdSegment = uriToAnnotationIdOrPassthrough(event.annotationUri);
|
|
@@ -56398,7 +56460,7 @@ function useResolutionFlow(rUri) {
|
|
|
56398
56460
|
subscription2.unsubscribe();
|
|
56399
56461
|
};
|
|
56400
56462
|
}, [eventBus]);
|
|
56401
|
-
|
|
56463
|
+
useEffect45(() => {
|
|
56402
56464
|
const handleResolutionSearchRequested = (event) => {
|
|
56403
56465
|
setPendingReferenceId(event.referenceId);
|
|
56404
56466
|
setSearchModalOpen(true);
|
|
@@ -56413,7 +56475,7 @@ function useResolutionFlow(rUri) {
|
|
|
56413
56475
|
}
|
|
56414
56476
|
|
|
56415
56477
|
// src/hooks/useAnnotationFlow.ts
|
|
56416
|
-
import { useState as
|
|
56478
|
+
import { useState as useState42, useRef as useRef33, useEffect as useEffect46, useCallback as useCallback34 } from "react";
|
|
56417
56479
|
import { resourceAnnotationUri as resourceAnnotationUri2, accessToken as accessToken4, entityType as entityType2 } from "@semiont/core";
|
|
56418
56480
|
import { uriToAnnotationIdOrPassthrough as uriToAnnotationIdOrPassthrough2 } from "@semiont/core";
|
|
56419
56481
|
function toAccessToken3(token) {
|
|
@@ -56427,17 +56489,17 @@ function useAnnotationFlow(rUri) {
|
|
|
56427
56489
|
const clientRef = useRef33(client);
|
|
56428
56490
|
const rUriRef = useRef33(rUri);
|
|
56429
56491
|
const tokenRef = useRef33(token);
|
|
56430
|
-
|
|
56492
|
+
useEffect46(() => {
|
|
56431
56493
|
clientRef.current = client;
|
|
56432
56494
|
});
|
|
56433
|
-
|
|
56495
|
+
useEffect46(() => {
|
|
56434
56496
|
rUriRef.current = rUri;
|
|
56435
56497
|
});
|
|
56436
|
-
|
|
56498
|
+
useEffect46(() => {
|
|
56437
56499
|
tokenRef.current = token;
|
|
56438
56500
|
});
|
|
56439
|
-
const [pendingAnnotation, setPendingAnnotation] =
|
|
56440
|
-
const handleAnnotationRequested =
|
|
56501
|
+
const [pendingAnnotation, setPendingAnnotation] = useState42(null);
|
|
56502
|
+
const handleAnnotationRequested = useCallback34((pending) => {
|
|
56441
56503
|
const MOTIVATION_TO_TAB = {
|
|
56442
56504
|
highlighting: "annotations",
|
|
56443
56505
|
commenting: "annotations",
|
|
@@ -56456,7 +56518,7 @@ function useAnnotationFlow(rUri) {
|
|
|
56456
56518
|
eventBus.get("attend:panel-open").next({ panel: MOTIVATION_TO_TAB[pending.motivation] || "annotations" });
|
|
56457
56519
|
setPendingAnnotation(pending);
|
|
56458
56520
|
}, []);
|
|
56459
|
-
const selectionToSelector =
|
|
56521
|
+
const selectionToSelector = useCallback34((selection2) => {
|
|
56460
56522
|
if (selection2.svgSelector) {
|
|
56461
56523
|
return {
|
|
56462
56524
|
type: "SvgSelector",
|
|
@@ -56488,29 +56550,29 @@ function useAnnotationFlow(rUri) {
|
|
|
56488
56550
|
...selection2.suffix && { suffix: selection2.suffix }
|
|
56489
56551
|
};
|
|
56490
56552
|
}, []);
|
|
56491
|
-
const handleCommentRequested =
|
|
56553
|
+
const handleCommentRequested = useCallback34((selection2) => {
|
|
56492
56554
|
handleAnnotationRequested({ selector: selectionToSelector(selection2), motivation: "commenting" });
|
|
56493
56555
|
}, [handleAnnotationRequested, selectionToSelector]);
|
|
56494
|
-
const handleTagRequested =
|
|
56556
|
+
const handleTagRequested = useCallback34((selection2) => {
|
|
56495
56557
|
handleAnnotationRequested({ selector: selectionToSelector(selection2), motivation: "tagging" });
|
|
56496
56558
|
}, [handleAnnotationRequested, selectionToSelector]);
|
|
56497
|
-
const handleAssessmentRequested =
|
|
56559
|
+
const handleAssessmentRequested = useCallback34((selection2) => {
|
|
56498
56560
|
handleAnnotationRequested({ selector: selectionToSelector(selection2), motivation: "assessing" });
|
|
56499
56561
|
}, [handleAnnotationRequested, selectionToSelector]);
|
|
56500
|
-
const handleReferenceRequested =
|
|
56562
|
+
const handleReferenceRequested = useCallback34((selection2) => {
|
|
56501
56563
|
handleAnnotationRequested({ selector: selectionToSelector(selection2), motivation: "linking" });
|
|
56502
56564
|
}, [handleAnnotationRequested, selectionToSelector]);
|
|
56503
|
-
const handleAnnotationCancelPending =
|
|
56565
|
+
const handleAnnotationCancelPending = useCallback34(() => {
|
|
56504
56566
|
setPendingAnnotation(null);
|
|
56505
56567
|
}, []);
|
|
56506
|
-
const [assistingMotivation, setAssistingMotivation] =
|
|
56507
|
-
const [progress, setProgress] =
|
|
56568
|
+
const [assistingMotivation, setAssistingMotivation] = useState42(null);
|
|
56569
|
+
const [progress, setProgress] = useState42(null);
|
|
56508
56570
|
const assistStreamRef = useRef33(null);
|
|
56509
56571
|
const progressDismissTimeoutRef = useRef33(null);
|
|
56510
|
-
const handleAnnotationProgress =
|
|
56572
|
+
const handleAnnotationProgress = useCallback34((chunk) => {
|
|
56511
56573
|
setProgress(chunk);
|
|
56512
56574
|
}, []);
|
|
56513
|
-
const handleAnnotationComplete =
|
|
56575
|
+
const handleAnnotationComplete = useCallback34((event) => {
|
|
56514
56576
|
setAssistingMotivation((prev) => {
|
|
56515
56577
|
if (!event.motivation || event.motivation !== prev) return prev;
|
|
56516
56578
|
return null;
|
|
@@ -56524,7 +56586,7 @@ function useAnnotationFlow(rUri) {
|
|
|
56524
56586
|
progressDismissTimeoutRef.current = null;
|
|
56525
56587
|
}, 5e3);
|
|
56526
56588
|
}, [showSuccess]);
|
|
56527
|
-
const handleAnnotationFailed =
|
|
56589
|
+
const handleAnnotationFailed = useCallback34((event) => {
|
|
56528
56590
|
if (progressDismissTimeoutRef.current) {
|
|
56529
56591
|
clearTimeout(progressDismissTimeoutRef.current);
|
|
56530
56592
|
progressDismissTimeoutRef.current = null;
|
|
@@ -56534,14 +56596,14 @@ function useAnnotationFlow(rUri) {
|
|
|
56534
56596
|
const errorMessage = event.payload.error || "Annotation failed";
|
|
56535
56597
|
showError(errorMessage);
|
|
56536
56598
|
}, [showError]);
|
|
56537
|
-
const handleProgressDismiss =
|
|
56599
|
+
const handleProgressDismiss = useCallback34(() => {
|
|
56538
56600
|
if (progressDismissTimeoutRef.current) {
|
|
56539
56601
|
clearTimeout(progressDismissTimeoutRef.current);
|
|
56540
56602
|
progressDismissTimeoutRef.current = null;
|
|
56541
56603
|
}
|
|
56542
56604
|
setProgress(null);
|
|
56543
56605
|
}, []);
|
|
56544
|
-
|
|
56606
|
+
useEffect46(() => {
|
|
56545
56607
|
const handleAnnotationCreate = async (event) => {
|
|
56546
56608
|
const currentClient = clientRef.current;
|
|
56547
56609
|
const currentRUri = rUriRef.current;
|
|
@@ -56671,7 +56733,7 @@ function useAnnotationFlow(rUri) {
|
|
|
56671
56733
|
"annotate:create-failed": ({ error }) => showError(`Failed to create annotation: ${error.message}`),
|
|
56672
56734
|
"annotate:delete-failed": ({ error }) => showError(`Failed to delete annotation: ${error.message}`)
|
|
56673
56735
|
});
|
|
56674
|
-
|
|
56736
|
+
useEffect46(() => {
|
|
56675
56737
|
return () => {
|
|
56676
56738
|
if (progressDismissTimeoutRef.current) {
|
|
56677
56739
|
clearTimeout(progressDismissTimeoutRef.current);
|
|
@@ -56686,66 +56748,6 @@ function useAnnotationFlow(rUri) {
|
|
|
56686
56748
|
};
|
|
56687
56749
|
}
|
|
56688
56750
|
|
|
56689
|
-
// src/hooks/usePanelNavigation.ts
|
|
56690
|
-
import { useState as useState42, useCallback as useCallback34, useEffect as useEffect46 } from "react";
|
|
56691
|
-
var tabGenerationCounter = 0;
|
|
56692
|
-
function usePanelNavigation() {
|
|
56693
|
-
const [activePanel, setActivePanel] = useState42(() => {
|
|
56694
|
-
if (typeof window !== "undefined") {
|
|
56695
|
-
const saved = localStorage.getItem("activeToolbarPanel");
|
|
56696
|
-
return saved || null;
|
|
56697
|
-
}
|
|
56698
|
-
return null;
|
|
56699
|
-
});
|
|
56700
|
-
const [scrollToAnnotationId, setScrollToAnnotationId] = useState42(null);
|
|
56701
|
-
const [panelInitialTab, setPanelInitialTab] = useState42(null);
|
|
56702
|
-
useEffect46(() => {
|
|
56703
|
-
if (typeof window === "undefined") return;
|
|
56704
|
-
if (activePanel) {
|
|
56705
|
-
localStorage.setItem("activeToolbarPanel", activePanel);
|
|
56706
|
-
} else {
|
|
56707
|
-
localStorage.removeItem("activeToolbarPanel");
|
|
56708
|
-
}
|
|
56709
|
-
}, [activePanel]);
|
|
56710
|
-
const handleScrollCompleted = useCallback34(() => {
|
|
56711
|
-
setScrollToAnnotationId(null);
|
|
56712
|
-
}, []);
|
|
56713
|
-
const handlePanelToggle = useCallback34(({ panel }) => {
|
|
56714
|
-
setActivePanel((current) => current === panel ? null : panel);
|
|
56715
|
-
}, []);
|
|
56716
|
-
const handlePanelOpen = useCallback34(({ panel, scrollToAnnotationId: scrollTarget, motivation }) => {
|
|
56717
|
-
if (scrollTarget) {
|
|
56718
|
-
setScrollToAnnotationId(scrollTarget);
|
|
56719
|
-
}
|
|
56720
|
-
if (motivation) {
|
|
56721
|
-
const motivationToTab = {
|
|
56722
|
-
"linking": "reference",
|
|
56723
|
-
"commenting": "comment",
|
|
56724
|
-
"tagging": "tag",
|
|
56725
|
-
"highlighting": "highlight",
|
|
56726
|
-
"assessing": "assessment"
|
|
56727
|
-
};
|
|
56728
|
-
const tab2 = motivationToTab[motivation] || "highlight";
|
|
56729
|
-
setPanelInitialTab({ tab: tab2, generation: ++tabGenerationCounter });
|
|
56730
|
-
}
|
|
56731
|
-
setActivePanel(panel);
|
|
56732
|
-
}, []);
|
|
56733
|
-
const handlePanelClose = useCallback34(() => {
|
|
56734
|
-
setActivePanel(null);
|
|
56735
|
-
}, []);
|
|
56736
|
-
useEventSubscriptions({
|
|
56737
|
-
"attend:panel-toggle": handlePanelToggle,
|
|
56738
|
-
"attend:panel-open": handlePanelOpen,
|
|
56739
|
-
"attend:panel-close": handlePanelClose
|
|
56740
|
-
});
|
|
56741
|
-
return {
|
|
56742
|
-
activePanel,
|
|
56743
|
-
scrollToAnnotationId,
|
|
56744
|
-
panelInitialTab,
|
|
56745
|
-
onScrollCompleted: handleScrollCompleted
|
|
56746
|
-
};
|
|
56747
|
-
}
|
|
56748
|
-
|
|
56749
56751
|
// src/hooks/useGenerationFlow.ts
|
|
56750
56752
|
import { useState as useState43, useCallback as useCallback35, useEffect as useEffect47, useRef as useRef34 } from "react";
|
|
56751
56753
|
import { annotationUri, accessToken as accessToken5 } from "@semiont/core";
|
|
@@ -57398,6 +57400,7 @@ export {
|
|
|
57398
57400
|
BrowseView,
|
|
57399
57401
|
Button,
|
|
57400
57402
|
ButtonGroup,
|
|
57403
|
+
COMMON_PANELS,
|
|
57401
57404
|
CacheProvider,
|
|
57402
57405
|
CodeMirrorRenderer,
|
|
57403
57406
|
CollaborationPanel,
|
|
@@ -57431,6 +57434,7 @@ export {
|
|
|
57431
57434
|
PopupHeader,
|
|
57432
57435
|
ProposeEntitiesModal,
|
|
57433
57436
|
QUERY_KEYS,
|
|
57437
|
+
RESOURCE_PANELS,
|
|
57434
57438
|
RecentDocumentsPage,
|
|
57435
57439
|
ReferenceEntry,
|
|
57436
57440
|
ReferenceResolutionWidget,
|