@collabdt/core 0.12.2 → 0.13.1
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/core/components/AppSidebarContent.js +2 -2
- package/dist/core/components/AppSidebarContent.js.map +1 -1
- package/dist/core/components/organizationConfig/src/organizationConfigContent.d.ts.map +1 -1
- package/dist/core/components/organizationConfig/src/organizationConfigContent.js +5 -11
- package/dist/core/components/organizationConfig/src/organizationConfigContent.js.map +1 -1
- package/dist/core/components/viewers/Data/DataMenu.js +1 -1
- package/dist/core/components/viewers/Data/DataMenu.js.map +1 -1
- package/dist/core/components/viewers/Data/HeaderButtons.js +1 -1
- package/dist/core/components/viewers/Data/HeaderButtons.js.map +1 -1
- package/dist/core/components/viewers/Data/utils/viewerConfig.js +1 -1
- package/dist/core/components/viewers/Data/utils/viewerConfig.js.map +1 -1
- package/dist/core/components/viewers/Viewer.js +1 -1
- package/dist/core/components/viewers/Viewer.js.map +1 -1
- package/dist/core/components/viewers/plugins/PluginsManager.d.ts +6 -9
- package/dist/core/components/viewers/plugins/PluginsManager.d.ts.map +1 -1
- package/dist/core/components/viewers/plugins/PluginsManager.js +321 -122
- package/dist/core/components/viewers/plugins/PluginsManager.js.map +1 -1
- package/dist/core/components/viewers/plugins/src/PluginDetails.d.ts +22 -0
- package/dist/core/components/viewers/plugins/src/PluginDetails.d.ts.map +1 -0
- package/dist/core/components/viewers/plugins/src/PluginDetails.js +204 -0
- package/dist/core/components/viewers/plugins/src/PluginDetails.js.map +1 -0
- package/dist/core/components/viewers/plugins/src/PluginQuickControls.d.ts +25 -0
- package/dist/core/components/viewers/plugins/src/PluginQuickControls.d.ts.map +1 -0
- package/dist/core/components/viewers/plugins/src/PluginQuickControls.js +79 -0
- package/dist/core/components/viewers/plugins/src/PluginQuickControls.js.map +1 -0
- package/dist/core/components/viewers/plugins/src/PluginRow.d.ts +28 -0
- package/dist/core/components/viewers/plugins/src/PluginRow.d.ts.map +1 -0
- package/dist/core/components/viewers/plugins/src/PluginRow.js +141 -0
- package/dist/core/components/viewers/plugins/src/PluginRow.js.map +1 -0
- package/dist/core/components/viewers/plugins/src/RegistryAccessList.d.ts +9 -0
- package/dist/core/components/viewers/plugins/src/RegistryAccessList.d.ts.map +1 -0
- package/dist/core/components/viewers/plugins/src/RegistryAccessList.js +96 -0
- package/dist/core/components/viewers/plugins/src/RegistryAccessList.js.map +1 -0
- package/dist/core/components/viewers/plugins/src/RegistryDetails.d.ts +19 -0
- package/dist/core/components/viewers/plugins/src/RegistryDetails.d.ts.map +1 -0
- package/dist/core/components/viewers/plugins/src/RegistryDetails.js +171 -0
- package/dist/core/components/viewers/plugins/src/RegistryDetails.js.map +1 -0
- package/dist/core/components/viewers/plugins/src/RegistryImport.d.ts +7 -0
- package/dist/core/components/viewers/plugins/src/RegistryImport.d.ts.map +1 -0
- package/dist/core/components/viewers/plugins/src/RegistryImport.js +88 -0
- package/dist/core/components/viewers/plugins/src/RegistryImport.js.map +1 -0
- package/dist/core/components/viewers/plugins/src/RegistryPublishStrip.d.ts +14 -0
- package/dist/core/components/viewers/plugins/src/RegistryPublishStrip.d.ts.map +1 -0
- package/dist/core/components/viewers/plugins/src/RegistryPublishStrip.js +74 -0
- package/dist/core/components/viewers/plugins/src/RegistryPublishStrip.js.map +1 -0
- package/dist/core/components/viewers/plugins/src/RegistryToolbar.d.ts +12 -0
- package/dist/core/components/viewers/plugins/src/RegistryToolbar.d.ts.map +1 -0
- package/dist/core/components/viewers/plugins/src/RegistryToolbar.js +41 -0
- package/dist/core/components/viewers/plugins/src/RegistryToolbar.js.map +1 -0
- package/dist/core/components/viewers/plugins/src/VisibleToPicker.d.ts +10 -0
- package/dist/core/components/viewers/plugins/src/VisibleToPicker.d.ts.map +1 -0
- package/dist/core/components/viewers/plugins/src/VisibleToPicker.js +82 -0
- package/dist/core/components/viewers/plugins/src/VisibleToPicker.js.map +1 -0
- package/dist/core/components/viewers/plugins/src/pluginColumns.d.ts +12 -0
- package/dist/core/components/viewers/plugins/src/pluginColumns.d.ts.map +1 -0
- package/dist/core/components/viewers/plugins/src/pluginColumns.js +47 -0
- package/dist/core/components/viewers/plugins/src/pluginColumns.js.map +1 -0
- package/dist/core/components/viewers/plugins/src/pluginRows.d.ts +29 -0
- package/dist/core/components/viewers/plugins/src/pluginRows.d.ts.map +1 -0
- package/dist/core/components/viewers/plugins/src/pluginRows.js +66 -0
- package/dist/core/components/viewers/plugins/src/pluginRows.js.map +1 -0
- package/dist/core/components/viewers/plugins/src/pluginStatus.d.ts +6 -5
- package/dist/core/components/viewers/plugins/src/pluginStatus.d.ts.map +1 -1
- package/dist/core/components/viewers/plugins/src/pluginStatus.js +8 -1
- package/dist/core/components/viewers/plugins/src/pluginStatus.js.map +1 -1
- package/dist/core/components/viewers/plugins/src/publishState.d.ts +22 -0
- package/dist/core/components/viewers/plugins/src/publishState.d.ts.map +1 -0
- package/dist/core/components/viewers/plugins/src/publishState.js +19 -0
- package/dist/core/components/viewers/plugins/src/publishState.js.map +1 -0
- package/dist/core/components/viewers/plugins/src/registryErrorMessage.d.ts +3 -0
- package/dist/core/components/viewers/plugins/src/registryErrorMessage.d.ts.map +1 -0
- package/dist/core/components/viewers/plugins/src/registryErrorMessage.js +11 -0
- package/dist/core/components/viewers/plugins/src/registryErrorMessage.js.map +1 -0
- package/dist/core/components/viewers/plugins/src/sharedPluginChanges.d.ts +15 -0
- package/dist/core/components/viewers/plugins/src/sharedPluginChanges.d.ts.map +1 -0
- package/dist/core/components/viewers/plugins/src/sharedPluginChanges.js +24 -0
- package/dist/core/components/viewers/plugins/src/sharedPluginChanges.js.map +1 -0
- package/dist/core/components/viewers/plugins/src/sortPluginRows.d.ts +15 -0
- package/dist/core/components/viewers/plugins/src/sortPluginRows.d.ts.map +1 -0
- package/dist/core/components/viewers/plugins/src/sortPluginRows.js +45 -0
- package/dist/core/components/viewers/plugins/src/sortPluginRows.js.map +1 -0
- package/dist/core/components/viewers/plugins/src/useFittedColumns.d.ts +5 -0
- package/dist/core/components/viewers/plugins/src/useFittedColumns.d.ts.map +1 -0
- package/dist/core/components/viewers/plugins/src/useFittedColumns.js +27 -0
- package/dist/core/components/viewers/plugins/src/useFittedColumns.js.map +1 -0
- package/dist/core/components/viewers/plugins/src/useMountedPlugins.d.ts +6 -2
- package/dist/core/components/viewers/plugins/src/useMountedPlugins.d.ts.map +1 -1
- package/dist/core/components/viewers/plugins/src/useMountedPlugins.js +8 -2
- package/dist/core/components/viewers/plugins/src/useMountedPlugins.js.map +1 -1
- package/dist/core/components/viewers/plugins/src/usePluginsData.d.ts.map +1 -1
- package/dist/core/components/viewers/plugins/src/usePluginsData.js +10 -5
- package/dist/core/components/viewers/plugins/src/usePluginsData.js.map +1 -1
- package/dist/core/components/viewers/plugins/src/useRegistryPlugins.d.ts +15 -0
- package/dist/core/components/viewers/plugins/src/useRegistryPlugins.d.ts.map +1 -0
- package/dist/core/components/viewers/plugins/src/useRegistryPlugins.js +105 -0
- package/dist/core/components/viewers/plugins/src/useRegistryPlugins.js.map +1 -0
- package/dist/core/components/viewers/plugins/types.d.ts +87 -0
- package/dist/core/components/viewers/plugins/types.d.ts.map +1 -1
- package/dist/core/components/viewers/viewerAccess.d.ts.map +1 -1
- package/dist/core/components/viewers/viewerAccess.js +2 -0
- package/dist/core/components/viewers/viewerAccess.js.map +1 -1
- package/dist/core/hooks/plugins/createPluginHooks.d.ts +2 -10
- package/dist/core/hooks/plugins/createPluginHooks.d.ts.map +1 -1
- package/dist/core/hooks/plugins/createPluginHooks.js +1 -2
- package/dist/core/hooks/plugins/createPluginHooks.js.map +1 -1
- package/dist/core/i18n/messages/en.json +130 -19
- package/dist/core/i18n/messages/es.json +130 -19
- package/dist/core/i18n/messages/fr.json +130 -19
- package/dist/core/plugins/sdk/semver.d.ts +7 -0
- package/dist/core/plugins/sdk/semver.d.ts.map +1 -0
- package/dist/core/plugins/sdk/semver.js +52 -0
- package/dist/core/plugins/sdk/semver.js.map +1 -0
- package/dist/core/types/dbTypes.d.ts +1 -1
- package/dist/core/types/dbTypes.d.ts.map +1 -1
- package/dist/core/types/dbTypes.js +1 -1
- package/dist/core/types/dbTypes.js.map +1 -1
- package/dist/core/utils/appContent.d.ts +4 -7
- package/dist/core/utils/appContent.d.ts.map +1 -1
- package/dist/core/utils/appContent.js +8 -3
- package/dist/core/utils/appContent.js.map +1 -1
- package/package.json +1 -1
- package/dist/core/components/viewers/plugins/src/PluginCard.d.ts +0 -14
- package/dist/core/components/viewers/plugins/src/PluginCard.d.ts.map +0 -1
- package/dist/core/components/viewers/plugins/src/PluginCard.js +0 -234
- package/dist/core/components/viewers/plugins/src/PluginCard.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/core/components/viewers/Data/utils/viewerConfig.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nimport {\n Building2,\n BoxSelect,\n TrainTrack,\n GalleryVerticalEnd,\n Blocks,\n Users,\n type LucideIcon,\n} from 'lucide-react'\n\nimport { ViewerNames } from '../../../../types/dbTypes'\nimport { DataTypes } from '../../../../types/global'\n\nexport interface ViewerConfig {\n /** Key into the 'DataMenu' translation namespace, e.g. t(cfg.titleKey) */\n titleKey: string\n icon: LucideIcon\n /** Corresponding DataTypes value, undefined for viewers with no data type (map, bim, etc.) */\n dataType?: DataTypes\n}\n\n/**\n * Static config for every viewer that DataMenu renders.\n * - titleKey → key inside the \"DataMenu\" i18n namespace\n * - icon → Lucide icon component (pass size/className at the call site)\n * - dataType → DataTypes enum value used by MoreOptions, permissions, etc.\n */\nexport const VIEWER_CONFIG: Partial<Record<ViewerNames, ViewerConfig>> = {\n [ViewerNames.buildings]: {\n titleKey: 'buildingHeader',\n icon: Building2,\n dataType: DataTypes.building,\n },\n [ViewerNames.sites]: {\n titleKey: 'siteHeader',\n icon: BoxSelect,\n dataType: DataTypes.site,\n },\n [ViewerNames.infrastructure]: {\n titleKey: 'infrastructureHeader',\n icon: TrainTrack,\n dataType: DataTypes.infrastructure,\n },\n [ViewerNames.files]: {\n titleKey: 'fileHeader',\n icon: GalleryVerticalEnd,\n dataType: DataTypes.file,\n },\n [ViewerNames.
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/core/components/viewers/Data/utils/viewerConfig.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\nimport {\n Building2,\n BoxSelect,\n TrainTrack,\n GalleryVerticalEnd,\n Blocks,\n Users,\n type LucideIcon,\n} from 'lucide-react'\n\nimport { ViewerNames } from '../../../../types/dbTypes'\nimport { DataTypes } from '../../../../types/global'\n\nexport interface ViewerConfig {\n /** Key into the 'DataMenu' translation namespace, e.g. t(cfg.titleKey) */\n titleKey: string\n icon: LucideIcon\n /** Corresponding DataTypes value, undefined for viewers with no data type (map, bim, etc.) */\n dataType?: DataTypes\n}\n\n/**\n * Static config for every viewer that DataMenu renders.\n * - titleKey → key inside the \"DataMenu\" i18n namespace\n * - icon → Lucide icon component (pass size/className at the call site)\n * - dataType → DataTypes enum value used by MoreOptions, permissions, etc.\n */\nexport const VIEWER_CONFIG: Partial<Record<ViewerNames, ViewerConfig>> = {\n [ViewerNames.buildings]: {\n titleKey: 'buildingHeader',\n icon: Building2,\n dataType: DataTypes.building,\n },\n [ViewerNames.sites]: {\n titleKey: 'siteHeader',\n icon: BoxSelect,\n dataType: DataTypes.site,\n },\n [ViewerNames.infrastructure]: {\n titleKey: 'infrastructureHeader',\n icon: TrainTrack,\n dataType: DataTypes.infrastructure,\n },\n [ViewerNames.files]: {\n titleKey: 'fileHeader',\n icon: GalleryVerticalEnd,\n dataType: DataTypes.file,\n },\n [ViewerNames.plugins]: {\n titleKey: 'pluginsHeader',\n icon: Blocks,\n dataType: undefined,\n },\n [ViewerNames.users]: {\n titleKey: 'usersHeader',\n icon: Users,\n dataType: DataTypes.user,\n },\n}"],"mappings":"AAGA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAEP,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB;AAgBnB,MAAM,gBAA4D;AAAA,EACvE,CAAC,YAAY,SAAS,GAAG;AAAA,IACvB,UAAU;AAAA,IACV,MAAM;AAAA,IACN,UAAU,UAAU;AAAA,EACtB;AAAA,EACA,CAAC,YAAY,KAAK,GAAG;AAAA,IACnB,UAAU;AAAA,IACV,MAAM;AAAA,IACN,UAAU,UAAU;AAAA,EACtB;AAAA,EACA,CAAC,YAAY,cAAc,GAAG;AAAA,IAC5B,UAAU;AAAA,IACV,MAAM;AAAA,IACN,UAAU,UAAU;AAAA,EACtB;AAAA,EACA,CAAC,YAAY,KAAK,GAAG;AAAA,IACnB,UAAU;AAAA,IACV,MAAM;AAAA,IACN,UAAU,UAAU;AAAA,EACtB;AAAA,EACA,CAAC,YAAY,OAAO,GAAG;AAAA,IACrB,UAAU;AAAA,IACV,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA,CAAC,YAAY,KAAK,GAAG;AAAA,IACnB,UAAU;AAAA,IACV,MAAM;AAAA,IACN,UAAU,UAAU;AAAA,EACtB;AACF;","names":[]}
|
|
@@ -109,7 +109,7 @@ function Viewer({ organization, minioBaseUrl, martinBaseUrl, pointcloudApiUrl, m
|
|
|
109
109
|
/* @__PURE__ */ jsx("div", { style: { display: builtInViewer === ViewerNames.map ? "block" : "none", width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx(MapViewer, { organization, maptilerKey }) }),
|
|
110
110
|
builtInViewer === ViewerNames.bim && /* @__PURE__ */ jsx(BimViewer, { pointcloudApiUrl }),
|
|
111
111
|
builtInViewer !== null && [ViewerNames.buildings, ViewerNames.sites, ViewerNames.files, ViewerNames.land, ViewerNames.infrastructure, ViewerNames.users].includes(builtInViewer) && /* @__PURE__ */ jsx(DataMenu, { currentViewer: builtInViewer, organization, geocodeEarthApiKey, geocoderUrl }),
|
|
112
|
-
builtInViewer === ViewerNames.
|
|
112
|
+
builtInViewer === ViewerNames.plugins && /* @__PURE__ */ jsx("div", { className: "h-full w-full overflow-y-auto", children: /* @__PURE__ */ jsx(PluginsManager, {}) }),
|
|
113
113
|
builtInViewer === ViewerNames.settings && /* @__PURE__ */ jsx(UserSettings, { minioBaseUrl }),
|
|
114
114
|
pluginPage && /* @__PURE__ */ jsx("div", { className: "h-full w-full overflow-y-auto", children: /* @__PURE__ */ jsx(PluginDataPageHost, { viewer: validViewer }) })
|
|
115
115
|
] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/core/components/viewers/Viewer.tsx"],"sourcesContent":["'use client'\n\n// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\n// Dependencies\nimport { Loader2 } from 'lucide-react'\nimport dynamic from 'next/dynamic'\nimport { useSearchParams, useRouter, usePathname } from 'next/navigation'\nimport * as React from 'react'\n\nimport { parsePluginViewerKey } from '../../plugins/host/pluginViewerKey'\nimport { BuildingsContext, MenusContext } from '../../store'\nimport { ViewerNames } from '../../types'\n\n// Deep import, not the ui barrel: the barrel drags heavy modules into the eager map bundle.\nimport { switchLanguage } from '../../utils/utils'\nimport { UserSettings } from '../settings'\nimport { Toolbar } from '../Toolbar'\nimport { UploadProgressToasts } from '../ui/FilesManager/src/UploadProgressBar'\nimport { SidebarTrigger } from '../ui/Sidebar'\n\nimport { withBuildingId } from './bim/src/lib/buildingLocationParams'\nimport { MapViewer } from './map/MapViewer'\nimport { isViewerAllowed } from './viewerAccess'\n\nimport type { Organization, ViewerKey } from '../../types/dbTypes'\n\n// Code-split: map-only sessions must not pay for @thatopen or the Potree stack.\nconst BimViewer = dynamic(\n () => import('./bim/BimViewer').then(m => ({ default: m.BimViewer })),\n { ssr: false, loading: () => <ViewerLoadingFallback label=\"Loading BIM viewer…\" /> },\n)\n\n// DataMenu reaches BimViewer through FilePreview, so a static import undoes the split above.\nconst PluginsManager = dynamic(\n () => import('./plugins/PluginsManager').then(m => ({ default: m.PluginsManager })),\n { ssr: false, loading: () => <ViewerLoadingFallback label=\"Loading plugins…\" /> },\n)\n\nconst DataMenu = dynamic(\n () => import('./Data/DataMenu').then(m => ({ default: m.DataMenu })),\n { ssr: false, loading: () => <ViewerLoadingFallback label=\"Loading data…\" /> },\n)\n\n// Lazy too, or every plugin's page code lands in the eager bundle for every user.\nconst PluginDataPageHost = dynamic(\n () => import('../../plugins/host/PluginDataPageHost').then(m => ({ default: m.PluginDataPageHost })),\n { ssr: false, loading: () => <ViewerLoadingFallback label=\"Loading page…\" /> },\n)\n\n// Matches BimLoadingState using only Tailwind tokens, so the eager bundle stays light.\nfunction ViewerLoadingFallback({ label }: { label: string }) {\n return (\n <div className=\"absolute inset-0 z-10 flex items-center justify-center bg-background/50 backdrop-blur-[1px]\">\n <div className=\"flex items-center gap-3 rounded-md border border-border bg-card px-5 py-4 shadow-sm\">\n <Loader2 className=\"h-5 w-5 animate-spin text-muted-foreground\" />\n <span className=\"text-foreground text-base font-medium font-['Inter'] leading-7\">{label}</span>\n </div>\n </div>\n )\n}\n\ninterface ViewerProps {\n organization: Organization\n minioBaseUrl?: string\n martinBaseUrl?: string\n pointcloudApiUrl?: string\n maptilerKey?: string\n geocodeEarthApiKey?: string\n geocoderUrl?: string\n}\n\nexport function Viewer({ organization, minioBaseUrl, martinBaseUrl, pointcloudApiUrl, maptilerKey, geocodeEarthApiKey, geocoderUrl }: ViewerProps) {\n\n const searchParams = useSearchParams()\n const viewer = (searchParams.get('viewer') as ViewerKey) || ViewerNames.map\n\n const { dispatch: menusDispatch, state: menusState } = React.useContext(MenusContext)\n const { state: buildingState } = React.useContext(BuildingsContext)\n // const { dispatch: appConfigDispatch } = React.useContext(AppConfigContext)\n const { building } = buildingState.buildings\n const { currentViewer } = menusState.menus\n const router = useRouter()\n const pathname = usePathname()\n const [isMounted, setIsMounted] = React.useState(false)\n\n // Use a ref to track if we're currently updating -> prevent circular updates\n const isUpdatingRef = React.useRef(false)\n\n const { appContent } = organization\n\n const pluginPage = parsePluginViewerKey(viewer)\n const isViewerValid = isViewerAllowed(viewer, appContent)\n\n // Use default viewer (map) if current viewer is not valid\n const validViewer = isViewerValid ? viewer : ViewerNames.map\n\n // Update URL if viewer was not available for the organization\n React.useEffect(() => {\n if (isMounted && !isViewerValid && viewer !== ViewerNames.map) {\n const current = new URLSearchParams(searchParams.toString())\n current.delete('viewer')\n const newSearchParams = building?.id ? withBuildingId(current, building.id) : current\n router.replace(`${pathname}?${newSearchParams.toString()}`, { scroll: false })\n }\n }, [isMounted, isViewerValid, viewer, searchParams, pathname, router, building?.id])\n\n // On first mount, respond to URL\n React.useEffect(() => {\n if (!isMounted) {\n menusDispatch({\n type: 'SET_VIEWER',\n payload: { currentViewer: validViewer },\n })\n setIsMounted(true)\n }\n }, [isMounted, validViewer, menusDispatch])\n\n React.useEffect(() => {\n if (!organization) return\n const defaultLanguage = organization.languages?.[0] || 'En'\n if (defaultLanguage) void switchLanguage(defaultLanguage)\n }, [organization])\n\n // Handle context changes (from sidebar, HeaderButtons, etc.)\n React.useEffect(() => {\n if (!isMounted || !currentViewer || currentViewer === validViewer || isUpdatingRef.current) {\n return\n }\n\n isUpdatingRef.current = true\n\n // Create URLSearchParams to preserve existing search params\n\n const current = new URLSearchParams(searchParams.toString())\n current.set('viewer', currentViewer)\n const newSearchParams = building?.id ? withBuildingId(current, building.id) : current\n\n\n router.replace(`${pathname}?${newSearchParams.toString()}`, { scroll: false })\n\n // Reset the flag after a brief delay to allow the navigation to complete\n setTimeout(() => {\n isUpdatingRef.current = false\n }, 100)\n }, [currentViewer, isMounted, pathname, router, viewer, searchParams])\n\n // Handle URL changes (direct navigation)\n React.useEffect(() => {\n if (isMounted && currentViewer !== validViewer && !isUpdatingRef.current) {\n isUpdatingRef.current = true\n\n menusDispatch({\n type: 'SET_VIEWER',\n payload: { currentViewer: validViewer },\n })\n\n // Reset the flag after a brief delay\n setTimeout(() => {\n isUpdatingRef.current = false\n }, 100)\n }\n }, [validViewer, menusDispatch, isMounted, currentViewer])\n\n // Null while a plugin page shows, so the branches below stay exhaustive over ViewerNames.\n const builtInViewer = pluginPage ? null : (validViewer as ViewerNames)\n\n const selectedViewer = (\n <>\n {builtInViewer !== null\n && [ViewerNames.map, ViewerNames.bim].includes(builtInViewer)\n && <SidebarTrigger />}\n <div style={{ height: '100%', width: '100%', position: 'relative' }}>\n <div style={{ display: builtInViewer === ViewerNames.map ? 'block' : 'none', width: '100%', height: '100%' }}>\n <MapViewer organization={organization} maptilerKey={maptilerKey} />\n </div>\n {builtInViewer === ViewerNames.bim && <BimViewer pointcloudApiUrl={pointcloudApiUrl} />}\n {builtInViewer !== null\n && [ViewerNames.buildings, ViewerNames.sites, ViewerNames.files, ViewerNames.land, ViewerNames.infrastructure, ViewerNames.users].includes(builtInViewer) && (\n <DataMenu currentViewer={builtInViewer} organization={organization} geocodeEarthApiKey={geocodeEarthApiKey} geocoderUrl={geocoderUrl} />\n )}\n {/* `plugins` used to route through DataMenu, which rendered nothing:\n VIEWER_CONFIG gives it no dataType. It has its own page now. */}\n {builtInViewer === ViewerNames.extensions && (\n <div className=\"h-full w-full overflow-y-auto\">\n <PluginsManager />\n </div>\n )}\n {builtInViewer === ViewerNames.settings && (\n <UserSettings minioBaseUrl={minioBaseUrl} />\n )}\n {pluginPage && (\n <div className=\"h-full w-full overflow-y-auto\">\n <PluginDataPageHost viewer={validViewer} />\n </div>\n )}\n </div>\n </>\n )\n\n return (\n <>\n {selectedViewer}\n <Toolbar viewer={validViewer} minioBaseUrl={minioBaseUrl} martinBaseUrl={martinBaseUrl} organization={organization} geocodeEarthApiKey={geocodeEarthApiKey} geocoderUrl={geocoderUrl} />\n <UploadProgressToasts />\n </>\n )\n}"],"mappings":";AA+B+B,SA0I3B,UA1I2B,KAwBzB,YAxByB;AAzB/B,SAAS,eAAe;AACxB,OAAO,aAAa;AACpB,SAAS,iBAAiB,WAAW,mBAAmB;AACxD,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,OAAO,EAAE,SAAS,kBAAkB,YAAY,MAAM,UAAU,QAAQ,OAAO,QAAQ,QAAQ,OAAO,GACzG,8BAAC,aAAU,cAA4B,aAA0B,GACnE;AAAA,MACC,kBAAkB,YAAY,OAAO,oBAAC,aAAU,kBAAoC;AAAA,MACpF,kBAAkB,QACd,CAAC,YAAY,WAAW,YAAY,OAAO,YAAY,OAAO,YAAY,MAAM,YAAY,gBAAgB,YAAY,KAAK,EAAE,SAAS,aAAa,KACxJ,oBAAC,YAAS,eAAe,eAAe,cAA4B,oBAAwC,aAA0B;AAAA,MAIvI,kBAAkB,YAAY,cAC7B,oBAAC,SAAI,WAAU,iCACb,8BAAC,kBAAe,GAClB;AAAA,MAED,kBAAkB,YAAY,YAC7B,oBAAC,gBAAa,cAA4B;AAAA,MAE3C,cACC,oBAAC,SAAI,WAAU,iCACb,8BAAC,sBAAmB,QAAQ,aAAa,GAC3C;AAAA,OAEJ;AAAA,KACF;AAGF,SACE,iCACG;AAAA;AAAA,IACD,oBAAC,WAAQ,QAAQ,aAAa,cAA4B,eAA8B,cAA4B,oBAAwC,aAA0B;AAAA,IACtL,oBAAC,wBAAqB;AAAA,KACxB;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/core/components/viewers/Viewer.tsx"],"sourcesContent":["'use client'\n\n// SPDX-License-Identifier: AGPL-3.0-or-later\n// Copyright (C) 2025 Collab Digital Twins\n\n// Dependencies\nimport { Loader2 } from 'lucide-react'\nimport dynamic from 'next/dynamic'\nimport { useSearchParams, useRouter, usePathname } from 'next/navigation'\nimport * as React from 'react'\n\nimport { parsePluginViewerKey } from '../../plugins/host/pluginViewerKey'\nimport { BuildingsContext, MenusContext } from '../../store'\nimport { ViewerNames } from '../../types'\n\n// Deep import, not the ui barrel: the barrel drags heavy modules into the eager map bundle.\nimport { switchLanguage } from '../../utils/utils'\nimport { UserSettings } from '../settings'\nimport { Toolbar } from '../Toolbar'\nimport { UploadProgressToasts } from '../ui/FilesManager/src/UploadProgressBar'\nimport { SidebarTrigger } from '../ui/Sidebar'\n\nimport { withBuildingId } from './bim/src/lib/buildingLocationParams'\nimport { MapViewer } from './map/MapViewer'\nimport { isViewerAllowed } from './viewerAccess'\n\nimport type { Organization, ViewerKey } from '../../types/dbTypes'\n\n// Code-split: map-only sessions must not pay for @thatopen or the Potree stack.\nconst BimViewer = dynamic(\n () => import('./bim/BimViewer').then(m => ({ default: m.BimViewer })),\n { ssr: false, loading: () => <ViewerLoadingFallback label=\"Loading BIM viewer…\" /> },\n)\n\n// DataMenu reaches BimViewer through FilePreview, so a static import undoes the split above.\nconst PluginsManager = dynamic(\n () => import('./plugins/PluginsManager').then(m => ({ default: m.PluginsManager })),\n { ssr: false, loading: () => <ViewerLoadingFallback label=\"Loading plugins…\" /> },\n)\n\nconst DataMenu = dynamic(\n () => import('./Data/DataMenu').then(m => ({ default: m.DataMenu })),\n { ssr: false, loading: () => <ViewerLoadingFallback label=\"Loading data…\" /> },\n)\n\n// Lazy too, or every plugin's page code lands in the eager bundle for every user.\nconst PluginDataPageHost = dynamic(\n () => import('../../plugins/host/PluginDataPageHost').then(m => ({ default: m.PluginDataPageHost })),\n { ssr: false, loading: () => <ViewerLoadingFallback label=\"Loading page…\" /> },\n)\n\n// Matches BimLoadingState using only Tailwind tokens, so the eager bundle stays light.\nfunction ViewerLoadingFallback({ label }: { label: string }) {\n return (\n <div className=\"absolute inset-0 z-10 flex items-center justify-center bg-background/50 backdrop-blur-[1px]\">\n <div className=\"flex items-center gap-3 rounded-md border border-border bg-card px-5 py-4 shadow-sm\">\n <Loader2 className=\"h-5 w-5 animate-spin text-muted-foreground\" />\n <span className=\"text-foreground text-base font-medium font-['Inter'] leading-7\">{label}</span>\n </div>\n </div>\n )\n}\n\ninterface ViewerProps {\n organization: Organization\n minioBaseUrl?: string\n martinBaseUrl?: string\n pointcloudApiUrl?: string\n maptilerKey?: string\n geocodeEarthApiKey?: string\n geocoderUrl?: string\n}\n\nexport function Viewer({ organization, minioBaseUrl, martinBaseUrl, pointcloudApiUrl, maptilerKey, geocodeEarthApiKey, geocoderUrl }: ViewerProps) {\n\n const searchParams = useSearchParams()\n const viewer = (searchParams.get('viewer') as ViewerKey) || ViewerNames.map\n\n const { dispatch: menusDispatch, state: menusState } = React.useContext(MenusContext)\n const { state: buildingState } = React.useContext(BuildingsContext)\n // const { dispatch: appConfigDispatch } = React.useContext(AppConfigContext)\n const { building } = buildingState.buildings\n const { currentViewer } = menusState.menus\n const router = useRouter()\n const pathname = usePathname()\n const [isMounted, setIsMounted] = React.useState(false)\n\n // Use a ref to track if we're currently updating -> prevent circular updates\n const isUpdatingRef = React.useRef(false)\n\n const { appContent } = organization\n\n const pluginPage = parsePluginViewerKey(viewer)\n const isViewerValid = isViewerAllowed(viewer, appContent)\n\n // Use default viewer (map) if current viewer is not valid\n const validViewer = isViewerValid ? viewer : ViewerNames.map\n\n // Update URL if viewer was not available for the organization\n React.useEffect(() => {\n if (isMounted && !isViewerValid && viewer !== ViewerNames.map) {\n const current = new URLSearchParams(searchParams.toString())\n current.delete('viewer')\n const newSearchParams = building?.id ? withBuildingId(current, building.id) : current\n router.replace(`${pathname}?${newSearchParams.toString()}`, { scroll: false })\n }\n }, [isMounted, isViewerValid, viewer, searchParams, pathname, router, building?.id])\n\n // On first mount, respond to URL\n React.useEffect(() => {\n if (!isMounted) {\n menusDispatch({\n type: 'SET_VIEWER',\n payload: { currentViewer: validViewer },\n })\n setIsMounted(true)\n }\n }, [isMounted, validViewer, menusDispatch])\n\n React.useEffect(() => {\n if (!organization) return\n const defaultLanguage = organization.languages?.[0] || 'En'\n if (defaultLanguage) void switchLanguage(defaultLanguage)\n }, [organization])\n\n // Handle context changes (from sidebar, HeaderButtons, etc.)\n React.useEffect(() => {\n if (!isMounted || !currentViewer || currentViewer === validViewer || isUpdatingRef.current) {\n return\n }\n\n isUpdatingRef.current = true\n\n // Create URLSearchParams to preserve existing search params\n\n const current = new URLSearchParams(searchParams.toString())\n current.set('viewer', currentViewer)\n const newSearchParams = building?.id ? withBuildingId(current, building.id) : current\n\n\n router.replace(`${pathname}?${newSearchParams.toString()}`, { scroll: false })\n\n // Reset the flag after a brief delay to allow the navigation to complete\n setTimeout(() => {\n isUpdatingRef.current = false\n }, 100)\n }, [currentViewer, isMounted, pathname, router, viewer, searchParams])\n\n // Handle URL changes (direct navigation)\n React.useEffect(() => {\n if (isMounted && currentViewer !== validViewer && !isUpdatingRef.current) {\n isUpdatingRef.current = true\n\n menusDispatch({\n type: 'SET_VIEWER',\n payload: { currentViewer: validViewer },\n })\n\n // Reset the flag after a brief delay\n setTimeout(() => {\n isUpdatingRef.current = false\n }, 100)\n }\n }, [validViewer, menusDispatch, isMounted, currentViewer])\n\n // Null while a plugin page shows, so the branches below stay exhaustive over ViewerNames.\n const builtInViewer = pluginPage ? null : (validViewer as ViewerNames)\n\n const selectedViewer = (\n <>\n {builtInViewer !== null\n && [ViewerNames.map, ViewerNames.bim].includes(builtInViewer)\n && <SidebarTrigger />}\n <div style={{ height: '100%', width: '100%', position: 'relative' }}>\n <div style={{ display: builtInViewer === ViewerNames.map ? 'block' : 'none', width: '100%', height: '100%' }}>\n <MapViewer organization={organization} maptilerKey={maptilerKey} />\n </div>\n {builtInViewer === ViewerNames.bim && <BimViewer pointcloudApiUrl={pointcloudApiUrl} />}\n {builtInViewer !== null\n && [ViewerNames.buildings, ViewerNames.sites, ViewerNames.files, ViewerNames.land, ViewerNames.infrastructure, ViewerNames.users].includes(builtInViewer) && (\n <DataMenu currentViewer={builtInViewer} organization={organization} geocodeEarthApiKey={geocodeEarthApiKey} geocoderUrl={geocoderUrl} />\n )}\n {/* `plugins` used to route through DataMenu, which rendered nothing:\n VIEWER_CONFIG gives it no dataType. It has its own page now. */}\n {builtInViewer === ViewerNames.plugins && (\n <div className=\"h-full w-full overflow-y-auto\">\n <PluginsManager />\n </div>\n )}\n {builtInViewer === ViewerNames.settings && (\n <UserSettings minioBaseUrl={minioBaseUrl} />\n )}\n {pluginPage && (\n <div className=\"h-full w-full overflow-y-auto\">\n <PluginDataPageHost viewer={validViewer} />\n </div>\n )}\n </div>\n </>\n )\n\n return (\n <>\n {selectedViewer}\n <Toolbar viewer={validViewer} minioBaseUrl={minioBaseUrl} martinBaseUrl={martinBaseUrl} organization={organization} geocodeEarthApiKey={geocodeEarthApiKey} geocoderUrl={geocoderUrl} />\n <UploadProgressToasts />\n </>\n )\n}"],"mappings":";AA+B+B,SA0I3B,UA1I2B,KAwBzB,YAxByB;AAzB/B,SAAS,eAAe;AACxB,OAAO,aAAa;AACpB,SAAS,iBAAiB,WAAW,mBAAmB;AACxD,YAAY,WAAW;AAEvB,SAAS,4BAA4B;AACrC,SAAS,kBAAkB,oBAAoB;AAC/C,SAAS,mBAAmB;AAG5B,SAAS,sBAAsB;AAC/B,SAAS,oBAAoB;AAC7B,SAAS,eAAe;AACxB,SAAS,4BAA4B;AACrC,SAAS,sBAAsB;AAE/B,SAAS,sBAAsB;AAC/B,SAAS,iBAAiB;AAC1B,SAAS,uBAAuB;AAKhC,MAAM,YAAY;AAAA,EAChB,MAAM,OAAO,iBAAiB,EAAE,KAAK,QAAM,EAAE,SAAS,EAAE,UAAU,EAAE;AAAA,EACpE,EAAE,KAAK,OAAO,SAAS,MAAM,oBAAC,yBAAsB,OAAM,4BAAsB,EAAG;AACrF;AAGA,MAAM,iBAAiB;AAAA,EACrB,MAAM,OAAO,0BAA0B,EAAE,KAAK,QAAM,EAAE,SAAS,EAAE,eAAe,EAAE;AAAA,EAClF,EAAE,KAAK,OAAO,SAAS,MAAM,oBAAC,yBAAsB,OAAM,yBAAmB,EAAG;AAClF;AAEA,MAAM,WAAW;AAAA,EACf,MAAM,OAAO,iBAAiB,EAAE,KAAK,QAAM,EAAE,SAAS,EAAE,SAAS,EAAE;AAAA,EACnE,EAAE,KAAK,OAAO,SAAS,MAAM,oBAAC,yBAAsB,OAAM,sBAAgB,EAAG;AAC/E;AAGA,MAAM,qBAAqB;AAAA,EACzB,MAAM,OAAO,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ginListing, PluginsActions, RegistryActions } from './types';
|
|
3
3
|
interface Props {
|
|
4
4
|
/** Override the rows. Normally omitted; the page reads them through the `ApiAdapter`. */
|
|
5
5
|
listings?: PluginListing[];
|
|
6
6
|
/** Override the writes. Normally omitted; they bind to the API by default. */
|
|
7
7
|
actions?: PluginsActions;
|
|
8
|
+
/** Override the shared-registry writes. Normally omitted; they bind to `/api/plugins/registry`. */
|
|
9
|
+
registryActions?: RegistryActions;
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
|
-
* The Plugins page:
|
|
11
|
-
*
|
|
12
|
-
* The frame mirrors `DataMenu`, since this belongs to the same management group.
|
|
13
|
-
* Two levels of control rather than one switch (see `plugins/enablement.ts`): an
|
|
14
|
-
* admin sets what is available and its default, then anyone chooses for themselves
|
|
15
|
-
* unless the admin locked it. CASL only decides which controls render — every write
|
|
16
|
-
* is re-checked server-side.
|
|
12
|
+
* The Plugins page: one row per plugin, holding its organization state and its registry state.
|
|
13
|
+
* Tabs only filter those rows. CASL decides which controls render; every write is re-checked server-side.
|
|
17
14
|
*/
|
|
18
|
-
export declare function PluginsManager({ listings, actions }: Props): React.JSX.Element;
|
|
15
|
+
export declare function PluginsManager({ listings, actions, registryActions }: Props): React.JSX.Element;
|
|
19
16
|
export {};
|
|
20
17
|
//# sourceMappingURL=PluginsManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginsManager.d.ts","sourceRoot":"","sources":["../../../../../src/core/components/viewers/plugins/PluginsManager.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PluginsManager.d.ts","sourceRoot":"","sources":["../../../../../src/core/components/viewers/plugins/PluginsManager.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAyC9B,OAAO,KAAK,EAAE,aAAa,EAAkB,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE7F,UAAU,KAAK;IACb,yFAAyF;IACzF,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAA;IAC1B,8EAA8E;IAC9E,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,mGAAmG;IACnG,eAAe,CAAC,EAAE,eAAe,CAAA;CAClC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,eAAe,EAAE,EAAE,KAAK,qBAoP3E"}
|