@collabdt/core 0.6.0 → 0.7.0

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.
Files changed (108) hide show
  1. package/dist/core/components/AppSidebarContent.d.ts.map +1 -1
  2. package/dist/core/components/AppSidebarContent.js +3 -2
  3. package/dist/core/components/AppSidebarContent.js.map +1 -1
  4. package/dist/core/components/viewers/plugins/src/PluginCard.d.ts.map +1 -1
  5. package/dist/core/components/viewers/plugins/src/PluginCard.js +19 -36
  6. package/dist/core/components/viewers/plugins/src/PluginCard.js.map +1 -1
  7. package/dist/core/plugins/hello-bim/src/components/SpaceDialog.d.ts.map +1 -0
  8. package/dist/core/plugins/hello-bim/{components → src/components}/SpaceDialog.js +3 -3
  9. package/dist/core/plugins/hello-bim/src/components/SpaceDialog.js.map +1 -0
  10. package/dist/core/plugins/hello-bim/{components → src/components}/SpacesLegend.d.ts +1 -1
  11. package/dist/core/plugins/hello-bim/src/components/SpacesLegend.d.ts.map +1 -0
  12. package/dist/core/plugins/hello-bim/{components → src/components}/SpacesLegend.js +1 -1
  13. package/dist/core/plugins/hello-bim/src/components/SpacesLegend.js.map +1 -0
  14. package/dist/core/plugins/hello-bim/src/components/SpacesTab.d.ts.map +1 -0
  15. package/dist/core/plugins/hello-bim/{components → src/components}/SpacesTab.js +5 -5
  16. package/dist/core/plugins/hello-bim/src/components/SpacesTab.js.map +1 -0
  17. package/dist/core/plugins/hello-bim/{components → src/components}/SpacesTool.d.ts +1 -2
  18. package/dist/core/plugins/hello-bim/src/components/SpacesTool.d.ts.map +1 -0
  19. package/dist/core/plugins/hello-bim/{components → src/components}/SpacesTool.js +2 -2
  20. package/dist/core/plugins/hello-bim/src/components/SpacesTool.js.map +1 -0
  21. package/dist/core/plugins/hello-bim/src/components/icons.d.ts.map +1 -0
  22. package/dist/core/plugins/hello-bim/src/components/icons.js.map +1 -0
  23. package/dist/core/plugins/hello-bim/src/index.d.ts +10 -0
  24. package/dist/core/plugins/hello-bim/src/index.d.ts.map +1 -0
  25. package/dist/core/plugins/hello-bim/{index.js → src/index.js} +2 -3
  26. package/dist/core/plugins/hello-bim/src/index.js.map +1 -0
  27. package/dist/core/plugins/hello-bim/{spaces.d.ts → src/spaces.d.ts} +1 -1
  28. package/dist/core/plugins/hello-bim/src/spaces.d.ts.map +1 -0
  29. package/dist/core/plugins/hello-bim/{spaces.js → src/spaces.js} +4 -4
  30. package/dist/core/plugins/hello-bim/src/spaces.js.map +1 -0
  31. package/dist/core/plugins/hello-map/{components → src/components}/MapTool.d.ts +1 -2
  32. package/dist/core/plugins/hello-map/src/components/MapTool.d.ts.map +1 -0
  33. package/dist/core/plugins/hello-map/{components → src/components}/MapTool.js +3 -3
  34. package/dist/core/plugins/hello-map/src/components/MapTool.js.map +1 -0
  35. package/dist/core/plugins/hello-map/src/components/MarkerDialog.d.ts.map +1 -0
  36. package/dist/core/plugins/hello-map/{components → src/components}/MarkerDialog.js +2 -2
  37. package/dist/core/plugins/hello-map/src/components/MarkerDialog.js.map +1 -0
  38. package/dist/core/plugins/hello-map/{components → src/components}/MarkersLayer.d.ts +1 -1
  39. package/dist/core/plugins/hello-map/src/components/MarkersLayer.d.ts.map +1 -0
  40. package/dist/core/plugins/hello-map/{components → src/components}/MarkersLayer.js +1 -1
  41. package/dist/core/plugins/hello-map/src/components/MarkersLayer.js.map +1 -0
  42. package/dist/core/plugins/hello-map/{components → src/components}/MarkersLegend.d.ts +1 -1
  43. package/dist/core/plugins/hello-map/src/components/MarkersLegend.d.ts.map +1 -0
  44. package/dist/core/plugins/hello-map/{components → src/components}/MarkersLegend.js +1 -1
  45. package/dist/core/plugins/hello-map/src/components/MarkersLegend.js.map +1 -0
  46. package/dist/core/plugins/hello-map/{components → src/components}/MarkersPage.d.ts +1 -1
  47. package/dist/core/plugins/hello-map/src/components/MarkersPage.d.ts.map +1 -0
  48. package/dist/core/plugins/hello-map/{components → src/components}/MarkersPage.js +1 -1
  49. package/dist/core/plugins/hello-map/src/components/MarkersPage.js.map +1 -0
  50. package/dist/core/plugins/hello-map/src/components/MarkersTab.d.ts.map +1 -0
  51. package/dist/core/plugins/hello-map/{components → src/components}/MarkersTab.js +4 -4
  52. package/dist/core/plugins/hello-map/src/components/MarkersTab.js.map +1 -0
  53. package/dist/core/plugins/hello-map/src/index.d.ts +10 -0
  54. package/dist/core/plugins/hello-map/src/index.d.ts.map +1 -0
  55. package/dist/core/plugins/hello-map/{index.js → src/index.js} +2 -3
  56. package/dist/core/plugins/hello-map/src/index.js.map +1 -0
  57. package/dist/core/plugins/hello-map/src/markers.d.ts.map +1 -0
  58. package/dist/core/plugins/hello-map/{markers.js → src/markers.js} +3 -3
  59. package/dist/core/plugins/hello-map/src/markers.js.map +1 -0
  60. package/dist/core/plugins/host/context.js.map +1 -1
  61. package/dist/core/plugins/host/pluginIcon.js.map +1 -1
  62. package/dist/core/plugins/host/runtimeShims.js.map +1 -1
  63. package/dist/core/plugins/installed.js +2 -2
  64. package/dist/core/plugins/installed.js.map +1 -1
  65. package/dist/core/plugins/manifests.js.map +1 -1
  66. package/dist/core/plugins/sdk/types.d.ts +9 -4
  67. package/dist/core/plugins/sdk/types.d.ts.map +1 -1
  68. package/dist/core/plugins/sdk/types.js.map +1 -1
  69. package/package.json +2 -1
  70. package/dist/core/plugins/hello-bim/components/SpaceDialog.d.ts.map +0 -1
  71. package/dist/core/plugins/hello-bim/components/SpaceDialog.js.map +0 -1
  72. package/dist/core/plugins/hello-bim/components/SpacesLegend.d.ts.map +0 -1
  73. package/dist/core/plugins/hello-bim/components/SpacesLegend.js.map +0 -1
  74. package/dist/core/plugins/hello-bim/components/SpacesTab.d.ts.map +0 -1
  75. package/dist/core/plugins/hello-bim/components/SpacesTab.js.map +0 -1
  76. package/dist/core/plugins/hello-bim/components/SpacesTool.d.ts.map +0 -1
  77. package/dist/core/plugins/hello-bim/components/SpacesTool.js.map +0 -1
  78. package/dist/core/plugins/hello-bim/components/icons.d.ts.map +0 -1
  79. package/dist/core/plugins/hello-bim/components/icons.js.map +0 -1
  80. package/dist/core/plugins/hello-bim/index.d.ts +0 -7
  81. package/dist/core/plugins/hello-bim/index.d.ts.map +0 -1
  82. package/dist/core/plugins/hello-bim/index.js.map +0 -1
  83. package/dist/core/plugins/hello-bim/spaces.d.ts.map +0 -1
  84. package/dist/core/plugins/hello-bim/spaces.js.map +0 -1
  85. package/dist/core/plugins/hello-map/components/MapTool.d.ts.map +0 -1
  86. package/dist/core/plugins/hello-map/components/MapTool.js.map +0 -1
  87. package/dist/core/plugins/hello-map/components/MarkerDialog.d.ts.map +0 -1
  88. package/dist/core/plugins/hello-map/components/MarkerDialog.js.map +0 -1
  89. package/dist/core/plugins/hello-map/components/MarkersLayer.d.ts.map +0 -1
  90. package/dist/core/plugins/hello-map/components/MarkersLayer.js.map +0 -1
  91. package/dist/core/plugins/hello-map/components/MarkersLegend.d.ts.map +0 -1
  92. package/dist/core/plugins/hello-map/components/MarkersLegend.js.map +0 -1
  93. package/dist/core/plugins/hello-map/components/MarkersPage.d.ts.map +0 -1
  94. package/dist/core/plugins/hello-map/components/MarkersPage.js.map +0 -1
  95. package/dist/core/plugins/hello-map/components/MarkersTab.d.ts.map +0 -1
  96. package/dist/core/plugins/hello-map/components/MarkersTab.js.map +0 -1
  97. package/dist/core/plugins/hello-map/index.d.ts +0 -7
  98. package/dist/core/plugins/hello-map/index.d.ts.map +0 -1
  99. package/dist/core/plugins/hello-map/index.js.map +0 -1
  100. package/dist/core/plugins/hello-map/markers.d.ts.map +0 -1
  101. package/dist/core/plugins/hello-map/markers.js.map +0 -1
  102. /package/dist/core/plugins/hello-bim/{components → src/components}/SpaceDialog.d.ts +0 -0
  103. /package/dist/core/plugins/hello-bim/{components → src/components}/SpacesTab.d.ts +0 -0
  104. /package/dist/core/plugins/hello-bim/{components → src/components}/icons.d.ts +0 -0
  105. /package/dist/core/plugins/hello-bim/{components → src/components}/icons.js +0 -0
  106. /package/dist/core/plugins/hello-map/{components → src/components}/MarkerDialog.d.ts +0 -0
  107. /package/dist/core/plugins/hello-map/{components → src/components}/MarkersTab.d.ts +0 -0
  108. /package/dist/core/plugins/hello-map/{markers.d.ts → src/markers.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/core/plugins/sdk/types.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAM/C,eAAO,MAAM,kBAAkB,oIASrB,CAAA;AAEV,MAAM,MAAM,gBAAgB,GAAG,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAA;AAIhE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,kGAAkG;IAClG,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gGAAgG;IAChG,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,gBAAgB,EAAE,CAAA;IAChC,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CACnD;AAED,wBAAgB,gBAAg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E;AAClE,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,GAC3B,OAAO,CAAC,WAAW,CAAC,CAEtB;AAED,sFAAsF;AACtF,MAAM,MAAM,YAAY,GAAG,YAAY,EAAE,GAAG,CAAC,MAAM,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/core/plugins/sdk/types.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\n// Type-only: keeps the viewer modules' runtime deps (@thatopen, three, maplibre)\r\n// out of the host's module graph.\r\nimport type { BimToolProps } from './bimViewer'\r\nimport type { MapToolProps } from './mapViewer'\r\nimport type { PointCloudToolProps } from './pointCloudViewer'\r\n// A value, not just a type: a `viewer.tabs` contribution names the viewers it belongs in.\r\nexport { ViewerNames } from '../../types/dbTypes'\r\n\r\nimport type { ViewerNames } from '../../types/dbTypes'\r\nimport type { LucideProps } from 'lucide-react'\r\n\r\n// --- Capability definitions ---\r\n\r\n// Only capabilities core actually renders. One with no consumer registers fine,\r\n// shows nothing, and leaves nothing to debug.\r\nexport const VALID_CAPABILITIES = [\r\n 'data.pages',\r\n 'viewer.tabs',\r\n 'ui.dialogs',\r\n 'map.tools',\r\n 'bim.tools',\r\n 'pointcloud.tools',\r\n 'viewer.legends',\r\n 'map.layers',\r\n] as const\r\n\r\nexport type PluginCapability = typeof VALID_CAPABILITIES[number]\r\n\r\n// --- Manifest ---\r\n\r\nexport interface PluginManifest {\r\n slug: string\r\n name: string\r\n version: string\r\n /** The `PLUGIN_HOST_API` this plugin was built against. Omitted is warned about, not rejected. */\r\n hostApi?: number\r\n description?: string\r\n author?: string\r\n /** A lucide icon name shown beside the plugin's name. Unset or unknown shows a puzzle piece. */\r\n icon?: string\r\n capabilities: PluginCapability[]\r\n requiredPermissions?: string[]\r\n configSchema?: Record<string, unknown>\r\n /**\r\n * Strings keyed by locale then message key, e.g. `{ en: { title: 'Hello' } }`.\r\n * Core folds them under `plugins.<slug>`, so `t('title')` resolves and no plugin\r\n * can collide with another. Values may nest, addressed as `t('spaces.title')`.\r\n */\r\n messages?: Record<string, Record<string, unknown>>\r\n}\r\n\r\nexport function validateManifest(manifest: unknown): { valid: boolean; errors: string[] } {\r\n const errors: string[] = []\r\n\r\n if (typeof manifest !== 'object' || manifest === null) {\r\n return { valid: false, errors: ['manifest must be an object'] }\r\n }\r\n\r\n const m = manifest as Record<string, unknown>\r\n\r\n if (!m.slug || typeof m.slug !== 'string') errors.push('slug is required')\r\n if (!m.name || typeof m.name !== 'string') errors.push('name is required')\r\n if (!m.version || typeof m.version !== 'string') errors.push('version is required')\r\n\r\n if (m.hostApi !== undefined && !Number.isInteger(m.hostApi)) {\r\n errors.push('hostApi must be an integer when present')\r\n }\r\n\r\n if (!Array.isArray(m.capabilities) || m.capabilities.length === 0) {\r\n errors.push('at least one capability is required')\r\n } else {\r\n for (const cap of m.capabilities) {\r\n if (!VALID_CAPABILITIES.includes(cap as PluginCapability)) {\r\n errors.push(`invalid capability: \"${cap}\"`)\r\n }\r\n }\r\n }\r\n\r\n return { valid: errors.length === 0, errors }\r\n}\r\n\r\n// --- Registration shapes (one per capability) ---\r\n\r\nexport interface DataPageColumn<Row> {\r\n key: string\r\n /** Resolved in the plugin's own namespace, falling back to the literal string. */\r\n labelKey: string\r\n render?: (row: Row) => React.ReactNode\r\n}\r\n\r\n/**\r\n * A full page in the Datasets nav, rendered by core. The plugin declares rows and columns; a\r\n * row click opens one of its own `ui.dialogs` rather than a detail view of its own.\r\n */\r\nexport interface DataPageRows<Row> {\r\n rows: Row[]\r\n isLoading?: boolean\r\n /** From the hook, not the registration, so it can close over `usePluginDialogs`. */\r\n onRowClick?: (row: Row) => void\r\n}\r\n\r\nexport interface DataPageRegistration<Row = Record<string, unknown>> {\r\n id: string\r\n titleKey: string\r\n icon: string | React.ComponentType<LucideProps>\r\n useRows: () => DataPageRows<Row>\r\n columns: DataPageColumn<Row>[]\r\n /** Column keys the search box filters on. Omit to search every column. */\r\n searchKeys?: string[]\r\n emptyKey?: string\r\n}\r\n\r\n/** Every toolbar component receives the toolbar entry core built for it. */\r\nexport interface ToolbarToolProps {\r\n tool: unknown\r\n}\r\n\r\n/**\r\n * A toolbar contribution. `P` is the viewer surface the hosting toolbar passes as\r\n * props, bound per capability by `CapabilityRegistry` — so a BIM component\r\n * registered under `map.tools` is a compile error.\r\n */\r\nexport interface ToolbarRegistration<P = Record<string, unknown>> {\r\n id: string\r\n label: string\r\n icon: string | React.ComponentType<LucideProps>\r\n component: React.ComponentType<ToolbarToolProps & P>\r\n cursor?: string\r\n stayActive?: boolean\r\n}\r\n\r\nexport interface ViewerTabRegistration {\r\n id: string\r\n labelKey: string\r\n icon: string | React.ComponentType<LucideProps>\r\n component: React.ComponentType\r\n /** Which viewers this tab appears in. Omit for all of them. */\r\n viewers?: ViewerNames[]\r\n}\r\n\r\n/**\r\n * A modal core owns. Registered here, opened by id from any of the plugin's surfaces via\r\n * `usePluginDialogs()`, so it outlives whichever one opened it.\r\n */\r\nexport interface DialogRegistration<P = Record<string, unknown>> {\r\n id: string\r\n titleKey: string\r\n size?: 'sm' | 'md' | 'lg' | 'xl'\r\n component: React.ComponentType<P & { close: () => void }>\r\n}\r\n\r\n/**\r\n * Something drawn on the map, mounted for as long as the map. Separate from `map.tools`,\r\n * whose panel unmounts when its dropdown closes and would take the layer with it.\r\n */\r\nexport interface MapLayerRegistration {\r\n id: string\r\n component: React.ComponentType<MapToolProps>\r\n}\r\n\r\nexport interface LegendRow {\r\n label: string\r\n color: string\r\n count?: number\r\n}\r\n\r\nexport interface LegendRegistration {\r\n id: string\r\n title: string\r\n /** Which viewers this legend appears in. Omit for all of them. */\r\n viewers?: ViewerNames[]\r\n // Called by <MapLegendHost> on each render; active:false omits the section.\r\n useLegend: () => {\r\n active: boolean\r\n // Overrides registration.title when set, e.g. a city-scoped label.\r\n title?: string\r\n unavailable?: boolean\r\n rows: LegendRow[]\r\n }\r\n}\r\n\r\n// --- Capability → registration type map ---\r\n// A new contribution point needs one entry here, its type above, and a consumer\r\n// calling `registry.getAll('your.key')`. No host changes.\r\n\r\nexport interface CapabilityRegistry {\r\n 'data.pages': DataPageRegistration\r\n 'viewer.tabs': ViewerTabRegistration\r\n 'ui.dialogs': DialogRegistration\r\n 'map.tools': ToolbarRegistration<MapToolProps>\r\n 'bim.tools': ToolbarRegistration<BimToolProps>\r\n 'pointcloud.tools': ToolbarRegistration<PointCloudToolProps>\r\n 'viewer.legends': LegendRegistration\r\n 'map.layers': MapLayerRegistration\r\n}\r\n\r\n// Errors if VALID_CAPABILITIES and keyof CapabilityRegistry drift apart.\r\ntype _CapabilityParity =\r\n PluginCapability extends keyof CapabilityRegistry\r\n ? keyof CapabilityRegistry extends PluginCapability\r\n ? true\r\n : never\r\n : never\r\nconst _capabilityParity: _CapabilityParity = true\r\nvoid _capabilityParity\r\n\r\n// --- Plugin Context ---\r\n\r\nexport interface PluginContext {\r\n pluginId: string\r\n register<K extends keyof CapabilityRegistry>(key: K, item: CapabilityRegistry[K]): void\r\n config: Record<string, unknown>\r\n}\r\n\r\n// --- Plugin entry point type ---\r\n\r\nexport interface PluginEntry {\r\n activate(ctx: PluginContext): void | Promise<void>\r\n deactivate?(ctx: PluginContext): void | Promise<void>\r\n}\r\n\r\n/**\r\n * One loadable plugin: its manifest plus its module, or a thunk returning it.\r\n * Prefer the thunk when compiled in — a static import pulls the plugin's\r\n * components into every route that reaches `installed.ts`.\r\n */\r\nexport interface PluginSource {\r\n manifest: PluginManifest\r\n entry: PluginEntry | (() => Promise<PluginEntry>)\r\n}\r\n\r\n/** Resolves either form of `PluginSource.entry` to the module. */\r\nexport async function resolvePluginEntry(\r\n entry: PluginSource['entry'],\r\n): Promise<PluginEntry> {\r\n return typeof entry === 'function' ? entry() : entry\r\n}\r\n\r\n/** An array for compiled-in plugins; a thunk when the list itself must be fetched. */\r\nexport type PluginsInput = PluginSource[] | (() => Promise<PluginSource[]>)\r\n"],"mappings":"AASA,SAAS,mBAAmB;AASrB,MAAM,qBAAqB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AA2BO,SAAS,iBAAiB,UAAyD;AACxF,QAAM,SAAmB,CAAC;AAE1B,MAAI,OAAO,aAAa,YAAY,aAAa,MAAM;AACrD,WAAO,EAAE,OAAO,OAAO,QAAQ,CAAC,4BAA4B,EAAE;AAAA,EAChE;AAEA,QAAM,IAAI;AAEV,MAAI,CAAC,EAAE,QAAQ,OAAO,EAAE,SAAS,SAAU,QAAO,KAAK,kBAAkB;AACzE,MAAI,CAAC,EAAE,QAAQ,OAAO,EAAE,SAAS,SAAU,QAAO,KAAK,kBAAkB;AACzE,MAAI,CAAC,EAAE,WAAW,OAAO,EAAE,YAAY,SAAU,QAAO,KAAK,qBAAqB;AAElF,MAAI,EAAE,YAAY,UAAa,CAAC,OAAO,UAAU,EAAE,OAAO,GAAG;AAC3D,WAAO,KAAK,yCAAyC;AAAA,EACvD;AAEA,MAAI,CAAC,MAAM,QAAQ,EAAE,YAAY,KAAK,EAAE,aAAa,WAAW,GAAG;AACjE,WAAO,KAAK,qCAAqC;AAAA,EACnD,OAAO;AACL,eAAW,OAAO,EAAE,cAAc;AAChC,UAAI,CAAC,mBAAmB,SAAS,GAAuB,GAAG;AACzD,eAAO,KAAK,wBAAwB,GAAG,GAAG;AAAA,MAC5C;AAAA,IACF;AAAA,EACF;AAEA,SAAO,EAAE,OAAO,OAAO,WAAW,GAAG,OAAO;AAC9C;AA4HA,MAAM,oBAAuC;AAC7C,KAAK;AA4BL,eAAsB,mBACpB,OACsB;AACtB,SAAO,OAAO,UAAU,aAAa,MAAM,IAAI;AACjD;","names":[]}
1
+ {"version":3,"sources":["../../../../src/core/plugins/sdk/types.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\n// Type-only: keeps the viewer modules' runtime deps (@thatopen, three, maplibre)\r\n// out of the host's module graph.\r\nimport type { BimToolProps } from './bimViewer'\r\nimport type { MapToolProps } from './mapViewer'\r\nimport type { PointCloudToolProps } from './pointCloudViewer'\r\n// A value, not just a type: a `viewer.tabs` contribution names the viewers it belongs in.\r\nexport { ViewerNames } from '../../types/dbTypes'\r\n\r\nimport type { ViewerNames } from '../../types/dbTypes'\r\n\r\n/**\r\n * The viewers that can host a tab or a legend, spelled as plain strings. Derived from\r\n * `ViewerNames` so the two cannot drift, and the form `@collabdt/plugin-kit` publishes.\r\n */\r\nexport type PluginViewerTarget = `${ViewerNames.map | ViewerNames.bim | ViewerNames.pointcloud}`\r\nimport type { LucideProps } from 'lucide-react'\r\n\r\n// --- Capability definitions ---\r\n\r\n// Only capabilities core actually renders. One with no consumer registers fine,\r\n// shows nothing, and leaves nothing to debug.\r\nexport const VALID_CAPABILITIES = [\r\n 'data.pages',\r\n 'viewer.tabs',\r\n 'ui.dialogs',\r\n 'map.tools',\r\n 'bim.tools',\r\n 'pointcloud.tools',\r\n 'viewer.legends',\r\n 'map.layers',\r\n] as const\r\n\r\nexport type PluginCapability = typeof VALID_CAPABILITIES[number]\r\n\r\n// --- Manifest ---\r\n\r\nexport interface PluginManifest {\r\n slug: string\r\n name: string\r\n version: string\r\n /** The `PLUGIN_HOST_API` this plugin was built against. Omitted is warned about, not rejected. */\r\n hostApi?: number\r\n description?: string\r\n author?: string\r\n /** A lucide icon name shown beside the plugin's name. Unset or unknown shows a puzzle piece. */\r\n icon?: string\r\n capabilities: PluginCapability[]\r\n requiredPermissions?: string[]\r\n configSchema?: Record<string, unknown>\r\n /**\r\n * Strings keyed by locale then message key, e.g. `{ en: { title: 'Hello' } }`.\r\n * Core folds them under `plugins.<slug>`, so `t('title')` resolves and no plugin\r\n * can collide with another. Values may nest, addressed as `t('spaces.title')`.\r\n */\r\n messages?: Record<string, Record<string, unknown>>\r\n}\r\n\r\nexport function validateManifest(manifest: unknown): { valid: boolean; errors: string[] } {\r\n const errors: string[] = []\r\n\r\n if (typeof manifest !== 'object' || manifest === null) {\r\n return { valid: false, errors: ['manifest must be an object'] }\r\n }\r\n\r\n const m = manifest as Record<string, unknown>\r\n\r\n if (!m.slug || typeof m.slug !== 'string') errors.push('slug is required')\r\n if (!m.name || typeof m.name !== 'string') errors.push('name is required')\r\n if (!m.version || typeof m.version !== 'string') errors.push('version is required')\r\n\r\n if (m.hostApi !== undefined && !Number.isInteger(m.hostApi)) {\r\n errors.push('hostApi must be an integer when present')\r\n }\r\n\r\n if (!Array.isArray(m.capabilities) || m.capabilities.length === 0) {\r\n errors.push('at least one capability is required')\r\n } else {\r\n for (const cap of m.capabilities) {\r\n if (!VALID_CAPABILITIES.includes(cap as PluginCapability)) {\r\n errors.push(`invalid capability: \"${cap}\"`)\r\n }\r\n }\r\n }\r\n\r\n return { valid: errors.length === 0, errors }\r\n}\r\n\r\n// --- Registration shapes (one per capability) ---\r\n\r\nexport interface DataPageColumn<Row> {\r\n key: string\r\n /** Resolved in the plugin's own namespace, falling back to the literal string. */\r\n labelKey: string\r\n render?: (row: Row) => React.ReactNode\r\n}\r\n\r\n/**\r\n * A full page in the Datasets nav, rendered by core. The plugin declares rows and columns; a\r\n * row click opens one of its own `ui.dialogs` rather than a detail view of its own.\r\n */\r\nexport interface DataPageRows<Row> {\r\n rows: Row[]\r\n isLoading?: boolean\r\n /** From the hook, not the registration, so it can close over `usePluginDialogs`. */\r\n onRowClick?: (row: Row) => void\r\n}\r\n\r\nexport interface DataPageRegistration<Row = Record<string, unknown>> {\r\n id: string\r\n titleKey: string\r\n icon: string | React.ComponentType<LucideProps>\r\n useRows: () => DataPageRows<Row>\r\n columns: DataPageColumn<Row>[]\r\n /** Column keys the search box filters on. Omit to search every column. */\r\n searchKeys?: string[]\r\n emptyKey?: string\r\n}\r\n\r\n/** Every toolbar component receives the toolbar entry core built for it. */\r\nexport interface ToolbarToolProps {\r\n tool: unknown\r\n}\r\n\r\n/**\r\n * A toolbar contribution. `P` is the viewer surface the hosting toolbar passes as\r\n * props, bound per capability by `CapabilityRegistry` — so a BIM component\r\n * registered under `map.tools` is a compile error.\r\n */\r\nexport interface ToolbarRegistration<P = Record<string, unknown>> {\r\n id: string\r\n label: string\r\n icon: string | React.ComponentType<LucideProps>\r\n component: React.ComponentType<ToolbarToolProps & P>\r\n cursor?: string\r\n stayActive?: boolean\r\n}\r\n\r\nexport interface ViewerTabRegistration {\r\n id: string\r\n labelKey: string\r\n icon: string | React.ComponentType<LucideProps>\r\n component: React.ComponentType\r\n /** Which viewers this tab appears in. Omit for all of them. */\r\n viewers?: Array<PluginViewerTarget | ViewerNames>\r\n}\r\n\r\n/**\r\n * A modal core owns. Registered here, opened by id from any of the plugin's surfaces via\r\n * `usePluginDialogs()`, so it outlives whichever one opened it.\r\n */\r\nexport interface DialogRegistration<P = Record<string, unknown>> {\r\n id: string\r\n titleKey: string\r\n size?: 'sm' | 'md' | 'lg' | 'xl'\r\n component: React.ComponentType<P & { close: () => void }>\r\n}\r\n\r\n/**\r\n * Something drawn on the map, mounted for as long as the map. Separate from `map.tools`,\r\n * whose panel unmounts when its dropdown closes and would take the layer with it.\r\n */\r\nexport interface MapLayerRegistration {\r\n id: string\r\n component: React.ComponentType<MapToolProps>\r\n}\r\n\r\nexport interface LegendRow {\r\n label: string\r\n color: string\r\n count?: number\r\n}\r\n\r\nexport interface LegendRegistration {\r\n id: string\r\n title: string\r\n /** Which viewers this legend appears in. Omit for all of them. */\r\n viewers?: Array<PluginViewerTarget | ViewerNames>\r\n // Called by <MapLegendHost> on each render; active:false omits the section.\r\n useLegend: () => {\r\n active: boolean\r\n // Overrides registration.title when set, e.g. a city-scoped label.\r\n title?: string\r\n unavailable?: boolean\r\n rows: LegendRow[]\r\n }\r\n}\r\n\r\n// --- Capability → registration type map ---\r\n// A new contribution point needs one entry here, its type above, and a consumer\r\n// calling `registry.getAll('your.key')`. No host changes.\r\n\r\nexport interface CapabilityRegistry {\r\n 'data.pages': DataPageRegistration\r\n 'viewer.tabs': ViewerTabRegistration\r\n 'ui.dialogs': DialogRegistration\r\n 'map.tools': ToolbarRegistration<MapToolProps>\r\n 'bim.tools': ToolbarRegistration<BimToolProps>\r\n 'pointcloud.tools': ToolbarRegistration<PointCloudToolProps>\r\n 'viewer.legends': LegendRegistration\r\n 'map.layers': MapLayerRegistration\r\n}\r\n\r\n// Errors if VALID_CAPABILITIES and keyof CapabilityRegistry drift apart.\r\ntype _CapabilityParity =\r\n PluginCapability extends keyof CapabilityRegistry\r\n ? keyof CapabilityRegistry extends PluginCapability\r\n ? true\r\n : never\r\n : never\r\nconst _capabilityParity: _CapabilityParity = true\r\nvoid _capabilityParity\r\n\r\n// --- Plugin Context ---\r\n\r\nexport interface PluginContext {\r\n pluginId: string\r\n register<K extends keyof CapabilityRegistry>(key: K, item: CapabilityRegistry[K]): void\r\n config: Record<string, unknown>\r\n}\r\n\r\n// --- Plugin entry point type ---\r\n\r\nexport interface PluginEntry {\r\n // `any`: each plugin binds only the slots it uses, so no one context type fits them all.\r\n activate(ctx: any): void | Promise<void>\r\n deactivate?(ctx: any): void | Promise<void>\r\n}\r\n\r\n/**\r\n * One loadable plugin: its manifest plus its module, or a thunk returning it.\r\n * Prefer the thunk when compiled in — a static import pulls the plugin's\r\n * components into every route that reaches `installed.ts`.\r\n */\r\nexport interface PluginSource {\r\n manifest: PluginManifest\r\n entry: PluginEntry | (() => Promise<PluginEntry>)\r\n}\r\n\r\n/** Resolves either form of `PluginSource.entry` to the module. */\r\nexport async function resolvePluginEntry(\r\n entry: PluginSource['entry'],\r\n): Promise<PluginEntry> {\r\n return typeof entry === 'function' ? entry() : entry\r\n}\r\n\r\n/** An array for compiled-in plugins; a thunk when the list itself must be fetched. */\r\nexport type PluginsInput = PluginSource[] | (() => Promise<PluginSource[]>)\r\n"],"mappings":"AASA,SAAS,mBAAmB;AAerB,MAAM,qBAAqB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AA2BO,SAAS,iBAAiB,UAAyD;AACxF,QAAM,SAAmB,CAAC;AAE1B,MAAI,OAAO,aAAa,YAAY,aAAa,MAAM;AACrD,WAAO,EAAE,OAAO,OAAO,QAAQ,CAAC,4BAA4B,EAAE;AAAA,EAChE;AAEA,QAAM,IAAI;AAEV,MAAI,CAAC,EAAE,QAAQ,OAAO,EAAE,SAAS,SAAU,QAAO,KAAK,kBAAkB;AACzE,MAAI,CAAC,EAAE,QAAQ,OAAO,EAAE,SAAS,SAAU,QAAO,KAAK,kBAAkB;AACzE,MAAI,CAAC,EAAE,WAAW,OAAO,EAAE,YAAY,SAAU,QAAO,KAAK,qBAAqB;AAElF,MAAI,EAAE,YAAY,UAAa,CAAC,OAAO,UAAU,EAAE,OAAO,GAAG;AAC3D,WAAO,KAAK,yCAAyC;AAAA,EACvD;AAEA,MAAI,CAAC,MAAM,QAAQ,EAAE,YAAY,KAAK,EAAE,aAAa,WAAW,GAAG;AACjE,WAAO,KAAK,qCAAqC;AAAA,EACnD,OAAO;AACL,eAAW,OAAO,EAAE,cAAc;AAChC,UAAI,CAAC,mBAAmB,SAAS,GAAuB,GAAG;AACzD,eAAO,KAAK,wBAAwB,GAAG,GAAG;AAAA,MAC5C;AAAA,IACF;AAAA,EACF;AAEA,SAAO,EAAE,OAAO,OAAO,WAAW,GAAG,OAAO;AAC9C;AA4HA,MAAM,oBAAuC;AAC7C,KAAK;AA6BL,eAAsB,mBACpB,OACsB;AACtB,SAAO,OAAO,UAAU,aAAa,MAAM,IAAI;AACjD;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@collabdt/core",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "CDT Core contains all the core technology for your CDT platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -118,6 +118,7 @@
118
118
  },
119
119
  "dependencies": {
120
120
  "@casl/ability": "^6.7.5",
121
+ "@collabdt/plugin-kit": "^0.5.0",
121
122
  "@dnd-kit/core": "^6.3.1",
122
123
  "@dnd-kit/sortable": "^10.0.0",
123
124
  "@dnd-kit/utilities": "^3.2.2",
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpaceDialog.d.ts","sourceRoot":"","sources":["../../../../../src/core/plugins/hello-bim/components/SpaceDialog.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,yFAAyF;IACzF,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,KAAK,qBAyErD"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/core/plugins/hello-bim/components/SpaceDialog.tsx"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport * as React from 'react'\r\n\r\nimport { useBimViewer } from '../../sdk/bimViewer'\r\nimport { Button } from '../../sdk/components'\r\nimport { usePluginTranslations } from '../../sdk/messages'\r\nimport { toModelIdMap, useSpaces } from '../spaces'\r\n\r\ninterface Props {\r\n close: () => void\r\n /** Supplied by whichever surface opened this — the sidebar tab, or the toolbar panel. */\r\n spaceKey?: string\r\n}\r\n\r\n/**\r\n * One space in full, including the IFC attributes the plugin does not store. Core owns the\r\n * overlay and Escape; this renders the body, and outlives whatever opened it.\r\n */\r\nexport function SpaceDialog({ close, spaceKey }: Props) {\r\n const t = usePluginTranslations()\r\n const { getProperties } = useBimViewer()\r\n const { spaces, selected } = useSpaces()\r\n\r\n const space = spaceKey\r\n ? spaces.find(candidate => candidate.key === spaceKey) ?? null\r\n : selected\r\n\r\n const [attributes, setAttributes] = React.useState<Record<string, unknown> | null>(null)\r\n\r\n React.useEffect(() => {\r\n if (!space) return\r\n let cancelled = false\r\n\r\n void getProperties(toModelIdMap([space]))\r\n .then((results) => {\r\n if (!cancelled) setAttributes(results[0] ?? {})\r\n })\r\n .catch(() => {\r\n if (!cancelled) setAttributes({})\r\n })\r\n\r\n return () => {\r\n cancelled = true\r\n }\r\n }, [space, getProperties])\r\n\r\n if (!space) {\r\n return (\r\n <div className=\"flex flex-col gap-4\">\r\n <p className=\"text-sm text-muted-foreground\">{t('gone', 'That space is no longer loaded.')}</p>\r\n <Button className=\"self-end\" onClick={close}>{t('close', 'Close')}</Button>\r\n </div>\r\n )\r\n }\r\n\r\n return (\r\n <div className=\"flex flex-col gap-4\">\r\n <div className=\"flex items-center gap-2\">\r\n <span\r\n aria-hidden=\"true\"\r\n className=\"inline-block h-4 w-4 rounded-full border border-white\"\r\n style={{ backgroundColor: space.colour }}\r\n />\r\n <p className=\"font-medium\">{space.name}</p>\r\n </div>\r\n\r\n <dl className=\"text-sm\">\r\n <Row label={t('ifcNameLabel', 'Name in the model')} value={space.ifcName} />\r\n <Row label={t('modelLabel', 'Model')} value={space.modelId} />\r\n <Row label={t('idLabel', 'Element id')} value={String(space.localId)} />\r\n <Row label={t('colour', 'Colour')} value={space.colour} />\r\n </dl>\r\n\r\n <div>\r\n <p className=\"mb-1 text-xs font-medium\">{t('attributes', 'IFC attributes')}</p>\r\n {attributes === null ? (\r\n <p className=\"text-xs text-muted-foreground\">{t('loading', 'Reading the model…')}</p>\r\n ) : (\r\n <dl className=\"max-h-48 overflow-y-auto text-xs\">\r\n {Object.entries(attributes)\r\n .filter(([key]) => key !== 'modelId' && key !== 'localId')\r\n .map(([key, value]) => (\r\n <Row key={key} label={key} value={readable(value)} />\r\n ))}\r\n </dl>\r\n )}\r\n </div>\r\n\r\n <Button className=\"self-end\" onClick={close}>{t('close', 'Close')}</Button>\r\n </div>\r\n )\r\n}\r\n\r\n/** Only primitives render; nested objects would come out as `[object Object]`. */\r\nfunction readable(value: unknown): string {\r\n const unwrapped = value && typeof value === 'object' && 'value' in value\r\n ? (value as { value: unknown }).value\r\n : value\r\n\r\n switch (typeof unwrapped) {\r\n case 'string': return unwrapped\r\n case 'number':\r\n case 'boolean': return String(unwrapped)\r\n default: return ''\r\n }\r\n}\r\n\r\nfunction Row({ label, value }: { label: string; value: string }) {\r\n return (\r\n <div className=\"flex items-baseline justify-between gap-3 py-0.5\">\r\n <dt className=\"shrink-0 text-muted-foreground\">{label}</dt>\r\n <dd className=\"truncate text-right\">{value}</dd>\r\n </div>\r\n )\r\n}\r\n"],"mappings":";AAoDM,SACE,KADF;AA/CN,YAAY,WAAW;AAEvB,SAAS,oBAAoB;AAC7B,SAAS,cAAc;AACvB,SAAS,6BAA6B;AACtC,SAAS,cAAc,iBAAiB;AAYjC,SAAS,YAAY,EAAE,OAAO,SAAS,GAAU;AAtBxD;AAuBE,QAAM,IAAI,sBAAsB;AAChC,QAAM,EAAE,cAAc,IAAI,aAAa;AACvC,QAAM,EAAE,QAAQ,SAAS,IAAI,UAAU;AAEvC,QAAM,QAAQ,YACV,YAAO,KAAK,eAAa,UAAU,QAAQ,QAAQ,MAAnD,YAAwD,OACxD;AAEJ,QAAM,CAAC,YAAY,aAAa,IAAI,MAAM,SAAyC,IAAI;AAEvF,QAAM,UAAU,MAAM;AACpB,QAAI,CAAC,MAAO;AACZ,QAAI,YAAY;AAEhB,SAAK,cAAc,aAAa,CAAC,KAAK,CAAC,CAAC,EACrC,KAAK,CAAC,YAAY;AAtCzB,UAAAA;AAuCQ,UAAI,CAAC,UAAW,gBAAcA,MAAA,QAAQ,CAAC,MAAT,OAAAA,MAAc,CAAC,CAAC;AAAA,IAChD,CAAC,EACA,MAAM,MAAM;AACX,UAAI,CAAC,UAAW,eAAc,CAAC,CAAC;AAAA,IAClC,CAAC;AAEH,WAAO,MAAM;AACX,kBAAY;AAAA,IACd;AAAA,EACF,GAAG,CAAC,OAAO,aAAa,CAAC;AAEzB,MAAI,CA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AC,UAAO,WAAU,YAAW,SAAS,OAAQ,YAAE,SAAS,OAAO,GAAE;AAAA,KACpE;AAEJ;AAGA,SAAS,SAAS,OAAwB;AACxC,QAAM,YAAY,SAAS,OAAO,UAAU,YAAY,WAAW,QAC9D,MAA6B,QAC9B;AAEJ,UAAQ,OAAO,WAAW;AAAA,IACxB,KAAK;AAAU,aAAO;AAAA,IACtB,KAAK;AAAA,IACL,KAAK;AAAW,aAAO,OAAO,SAAS;AAAA,IACvC;AAAS,aAAO;AAAA,EAClB;AACF;AAEA,SAAS,IAAI,EAAE,OAAO,MAAM,GAAqC;AAC/D,SACE,qBAAC,SAAI,WAAU,oDACb;AAAA,wBAAC,QAAG,WAAU,kCAAkC,iBAAM;AAAA,IACtD,oBAAC,QAAG,WAAU,uBAAuB,iBAAM;AAAA,KAC7C;AAEJ;","names":["_a"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpacesLegend.d.ts","sourceRoot":"","sources":["../../../../../src/core/plugins/hello-bim/components/SpacesLegend.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD;;;GAGG;AACH,wBAAgB,eAAe,IAAI;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,EAAE,CAAA;CAAE,CASxF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/core/plugins/hello-bim/components/SpacesLegend.ts"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport { usePluginTranslations } from '../../sdk/messages'\r\nimport { useSpaces } from '../spaces'\r\n\r\nimport type { LegendRow } from '../../sdk/types'\r\n\r\n/**\r\n * One row per space, live as they are renamed and recoloured. The legend probe is mounted for\r\n * as long as the viewer, so this is also what discovers the model's spaces.\r\n */\r\nexport function useSpacesLegend(): { active: boolean; title?: string; rows: LegendRow[] } {\r\n const t = usePluginTranslations()\r\n const { spaces } = useSpaces()\r\n\r\n return {\r\n active: spaces.length > 0,\r\n title: t('legendTitle', 'Spaces'),\r\n rows: spaces.map<LegendRow>(space => ({ label: space.name, color: space.colour })),\r\n }\r\n}\r\n"],"mappings":";AAKA,SAAS,6BAA6B;AACtC,SAAS,iBAAiB;AAQnB,SAAS,kBAA0E;AACxF,QAAM,IAAI,sBAAsB;AAChC,QAAM,EAAE,OAAO,IAAI,UAAU;AAE7B,SAAO;AAAA,IACL,QAAQ,OAAO,SAAS;AAAA,IACxB,OAAO,EAAE,eAAe,QAAQ;AAAA,IAChC,MAAM,OAAO,IAAe,YAAU,EAAE,OAAO,MAAM,MAAM,OAAO,MAAM,OAAO,EAAE;AAAA,EACnF;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpacesTab.d.ts","sourceRoot":"","sources":["../../../../../src/core/plugins/hello-bim/components/SpacesTab.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAc9B,4FAA4F;AAC5F,wBAAgB,SAAS,sBAgJxB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/core/plugins/hello-bim/components/SpacesTab.tsx"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport * as React from 'react'\r\n\r\nimport { MAP_COLOUR_PALETTE } from '../../sdk'\r\nimport { useBimViewer } from '../../sdk/bimViewer'\r\nimport { Button, Input, Separator } from '../../sdk/components'\r\nimport { usePluginTranslations } from '../../sdk/messages'\r\nimport { usePluginDialogs } from '../../sdk/ui'\r\nimport { toModelIdMap, useSpacePainting, useSpaces } from '../spaces'\r\n\r\nimport { CheckIcon, Glyph, PlusIcon, XIcon } from './icons'\r\n\r\n/** How many palette entries to offer as swatches before the free colour input. */\r\nconst SWATCHES = 8\r\n\r\n/** The spaces in the BIM sidebar. Renaming and colouring live here, not in the dropdown. */\r\nexport function SpacesTab() {\r\n const t = usePluginTranslations()\r\n const { select, isolate, showAll, fitToSelection, setItemsVisible } = useBimViewer()\r\n const { spaces, isLoading, lastError, selected, select: choose, rename, setColour, reset } = useSpaces()\r\n const { open: openDialog } = usePluginDialogs()\r\n const { painted, setPainted } = useSpacePainting()\r\n\r\n const showOnly = async (key: string) => {\r\n const space = spaces.find(candidate => candidate.key === key)\r\n if (!space) return\r\n\r\n const items = toModelIdMap([space])\r\n await setItemsVisible(items, true)\r\n await isolate(items)\r\n await select(items)\r\n await fitToSelection()\r\n }\r\n\r\n if (isLoading && spaces.length === 0) {\r\n return <p className=\"p-4 text-sm text-muted-foreground\">{t('loading', 'Reading the model…')}</p>\r\n }\r\n\r\n if (spaces.length === 0) {\r\n return (\r\n <p className=\"p-4 text-sm text-muted-foreground\">\r\n {t('empty', 'This model has no IfcSpaces.')}\r\n </p>\r\n )\r\n }\r\n\r\n return (\r\n <div className=\"flex flex-col gap-3 p-4\">\r\n <div className=\"flex gap-2\">\r\n <Button\r\n size=\"sm\"\r\n variant={painted ? 'default' : 'outline'}\r\n aria-pressed={painted}\r\n className=\"flex-1\"\r\n onClick={() => setPainted(current => !current)}\r\n >\r\n {painted ? t('clearColours', 'Clear colours') : t('colourSpaces', 'Colour the spaces')}\r\n </Button>\r\n </div>\r\n\r\n <Button size=\"sm\" variant=\"outline\" onClick={() => { void showAll() }}>\r\n {t('showAllElements', 'Show all elements')}\r\n </Button>\r\n\r\n {lastError && (\r\n <p className=\"rounded-md bg-destructive/10 px-2 py-1 text-xs text-destructive\">\r\n {t('saveFailed', 'Could not save: ')}{lastError}\r\n </p>\r\n )}\r\n\r\n <ul className=\"flex flex-col gap-1\">\r\n {spaces.map(space => (\r\n <li key={space.key}>\r\n <button\r\n type=\"button\"\r\n onClick={() => { choose(space.key); void select(toModelIdMap([space])) }}\r\n className={`flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm ${\r\n selected?.key === space.key ? 'bg-accent' : 'hover:bg-accent/50'\r\n }`}\r\n >\r\n <span\r\n aria-hidden=\"true\"\r\n className=\"inline-block h-3 w-3 shrink-0 rounded-full border border-white\"\r\n style={{ backgroundColor: space.colour }}\r\n />\r\n <span className=\"flex-1 truncate\">{space.name}</span>\r\n </button>\r\n </li>\r\n ))}\r\n </ul>\r\n\r\n {selected && (\r\n <>\r\n <Separator />\r\n\r\n <NameField\r\n key={selected.key}\r\n name={selected.name}\r\n label={t('nameLabel', 'Name')}\r\n saveLabel={t('saveName', 'Save name')}\r\n revertLabel={t('revertName', 'Discard the change')}\r\n onCommit={name => { void rename(selected.key, name) }}\r\n />\r\n\r\n <p className=\"text-xs text-muted-foreground\">\r\n {t('ifcName', 'In the model: ')}{selected.ifcName}\r\n </p>\r\n\r\n <div className=\"flex flex-col gap-2\">\r\n <p className=\"text-xs font-medium\">{t('colour', 'Colour')}</p>\r\n\r\n <div className=\"flex flex-wrap items-center gap-1\">\r\n {MAP_COLOUR_PALETTE.slice(0, SWATCHES).map(colour => (\r\n <button\r\n key={colour}\r\n type=\"button\"\r\n aria-label={colour}\r\n aria-pressed={selected.colour === colour}\r\n onClick={() => { void setColour(selected.key, colour) }}\r\n className={`h-6 w-6 rounded-full border-2 ${\r\n selected.colour === colour ? 'border-foreground' : 'border-transparent'\r\n }`}\r\n style={{ backgroundColor: colour }}\r\n />\r\n ))}\r\n\r\n <label\r\n title={t('customColour', 'Pick any colour')}\r\n className=\"relative ml-1 flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-full border border-input bg-background text-muted-foreground hover:text-foreground\"\r\n >\r\n <PlusIcon />\r\n <input\r\n type=\"color\"\r\n value={selected.colour}\r\n onChange={event => { void setColour(selected.key, event.target.value) }}\r\n className=\"absolute inset-0 h-full w-full cursor-pointer opacity-0\"\r\n />\r\n <span className=\"sr-only\">{t('customColour', 'Pick any colour')}</span>\r\n </label>\r\n </div>\r\n </div>\r\n\r\n <div className=\"flex gap-2\">\r\n <Button size=\"sm\" variant=\"outline\" className=\"flex-1\" onClick={() => { void showOnly(selected.key) }}>\r\n {t('isolateSpace', 'Isolate space')}\r\n </Button>\r\n <Button size=\"sm\" variant=\"outline\" onClick={() => openDialog('detail', { spaceKey: selected.key })}>\r\n {t('details', 'Details')}\r\n </Button>\r\n </div>\r\n\r\n {selected.annotated && (\r\n <Button size=\"sm\" variant=\"ghost\" className=\"self-start\" onClick={() => { void reset(selected.key) }}>\r\n {t('reset', 'Reset to the model\\'s name and colour')}\r\n </Button>\r\n )}\r\n </>\r\n )}\r\n </div>\r\n )\r\n}\r\n\r\n/**\r\n * The name, edited locally and saved only when confirmed. Laid out like the app's other\r\n * inline text edits: the field takes the row, then a confirm and a revert.\r\n */\r\nfunction NameField({\r\n name,\r\n label,\r\n saveLabel,\r\n revertLabel,\r\n onCommit,\r\n}: {\r\n name: string\r\n label: string\r\n saveLabel: string\r\n revertLabel: string\r\n onCommit: (name: string) => void\r\n}) {\r\n const [draft, setDraft] = React.useState(name)\r\n const inputId = React.useId()\r\n\r\n const trimmed = draft.trim()\r\n const canSave = trimmed.length > 0 && trimmed !== name\r\n\r\n const commit = () => {\r\n if (!canSave) return\r\n onCommit(trimmed)\r\n }\r\n\r\n return (\r\n <div className=\"flex flex-col gap-1\">\r\n <label className=\"text-xs font-medium\" htmlFor={inputId}>{label}</label>\r\n\r\n <div className=\"flex items-center gap-1\">\r\n <Input\r\n id={inputId}\r\n value={draft}\r\n onChange={event => setDraft(event.target.value)}\r\n onKeyDown={(event) => {\r\n if (event.key === 'Enter') { event.preventDefault(); commit() }\r\n if (event.key === 'Escape') setDraft(name)\r\n }}\r\n className=\"h-8 flex-1\"\r\n />\r\n\r\n <Button\r\n size=\"icon\"\r\n className=\"h-8 w-8 shrink-0 p-0\"\r\n disabled={!canSave}\r\n aria-label={saveLabel}\r\n title={saveLabel}\r\n onClick={commit}\r\n >\r\n <Glyph><CheckIcon /></Glyph>\r\n </Button>\r\n\r\n <Button\r\n size=\"icon\"\r\n variant=\"ghost\"\r\n className=\"h-8 w-8 shrink-0 p-0\"\r\n disabled={!canSave}\r\n aria-label={revertLabel}\r\n title={revertLabel}\r\n onClick={() => setDraft(name)}\r\n >\r\n <Glyph><XIcon /></Glyph>\r\n </Button>\r\n </div>\r\n </div>\r\n )\r\n}\r\n"],"mappings":";AAuCW,SAyDH,UAzDG,KA8BH,YA9BG;AAlCX,YAAY,WAAW;AAEvB,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAC7B,SAAS,QAAQ,OAAO,iBAAiB;AACzC,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AACjC,SAAS,cAAc,kBAAkB,iBAAiB;AAE1D,SAAS,WAAW,OAAO,UAAU,aAAa;AAGlD,MAAM,WAAW;AAGV,SAAS,YAAY;AAC1B,QAAM,IAAI,sBAAsB;AAChC,QAAM,EAAE,QAAQ,SAAS,SAAS,gBAAgB,gBAAgB,IAAI,aAAa;AACnF,QAAM,EAAE,QAAQ,WAAW,WAAW,UAAU,QAAQ,QAAQ,QAAQ,WAAW,MAAM,IAAI,UAAU;AACvG,QAAM,EAAE,MAAM,WAAW,IAAI,iBAAiB;AAC9C,QAAM,EAAE,SAAS,WAAW,IAAI,iBAAiB;AAEjD,QAAM,WAAW,OAAO,QAAgB;AACtC,UAAM,QAAQ,OAAO,KAAK,eAAa,UAAU,QAAQ,GAAG;AAC5D,QAAI,CAAC,MAAO;AAEZ,UAAM,QAAQ,aAAa,CAAC,KAAK,CAAC;AAClC,UAAM,gBAAgB,OAAO,IAAI;AACjC,UAAM,QAAQ,KAAK;AACnB,UAAM,OAAO,KAAK;AAClB,UAAM,eAAe;AAAA,EACvB;AAEA,MAAI,aAAa,OAAO,WAAW,GAAG;AACpC,WAAO,oBAAC,OAAE,WAAU,qCAAqC,YAAE,WAAW,yBAAoB,GAAE;AAAA,EAC9F;AAEA,MAAI,OAAO,WAAW,GAAG;AACvB,WACE,oBAAC,OAAE,WAAU,qCACV,YAAE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C;AAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAU;AAAA,UACV,UAAU,CAAC;AAAA,UACX,cAAY;AAAA,UACZ,OAAO;AAAA,UACP,SAAS;AAAA,UAET,8BAAC,SAAM,8BAAC,aAAU,GAAE;AAAA;AAAA,MACtB;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAQ;AAAA,UACR,WAAU;AAAA,UACV,UAAU,CAAC;AAAA,UACX,cAAY;AAAA,UACZ,OAAO;AAAA,UACP,SAAS,MAAM,SAAS,IAAI;AAAA,UAE5B,8BAAC,SAAM,8BAAC,SAAM,GAAE;AAAA;AAAA,MAClB;AAAA,OACF;AAAA,KACF;AAEJ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpacesTool.d.ts","sourceRoot":"","sources":["../../../../../src/core/plugins/hello-bim/components/SpacesTool.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAEvD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,OAAO,EACP,eAAe,EACf,OAAO,EACP,cAAc,EACd,MAAM,GACP,EAAE,gBAAgB,GAAG,YAAY,+BAsDjC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/core/plugins/hello-bim/components/SpacesTool.tsx"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport { Button, Separator } from '../../sdk/components'\r\nimport { usePluginTranslations } from '../../sdk/messages'\r\nimport { toModelIdMap, useSpacePainting, useSpaces } from '../spaces'\r\n\r\nimport type { BimToolProps } from '../../sdk/bimViewer'\r\nimport type { ToolbarToolProps } from '../../sdk/types'\r\n\r\n/**\r\n * Three things worth one click. Renaming and colouring live in the sidebar tab: this panel is\r\n * a dropdown that closes on the next click. The viewer arrives as props, as the host intends.\r\n */\r\nexport function SpacesTool({\r\n modelIds,\r\n isolate,\r\n setItemsVisible,\r\n showAll,\r\n fitToSelection,\r\n select,\r\n}: ToolbarToolProps & BimToolProps) {\r\n const t = usePluginTranslations()\r\n const { spaces, isLoading } = useSpaces()\r\n const { painted, setPainted } = useSpacePainting()\r\n\r\n const items = () => toModelIdMap(spaces)\r\n\r\n const isolateSpaces = async () => {\r\n if (spaces.length === 0) return\r\n\r\n await setItemsVisible(items(), true)\r\n await isolate(items())\r\n await select(items())\r\n await fitToSelection()\r\n }\r\n\r\n const reset = async () => {\r\n setPainted(false)\r\n await showAll()\r\n }\r\n\r\n return (\r\n <div className=\"w-60 p-1\">\r\n <p className=\"px-2 py-1 text-sm font-medium\">{t('title', 'Spaces')}</p>\r\n <Separator className=\"my-1\" />\r\n\r\n {modelIds.length === 0 ? (\r\n <p className=\"px-2 py-1 text-sm text-muted-foreground\">\r\n {t('noModel', 'Load a model to see its spaces.')}\r\n </p>\r\n ) : isLoading && spaces.length === 0 ? (\r\n <p className=\"px-2 py-1 text-sm text-muted-foreground\">\r\n {t('loading', 'Reading the model…')}\r\n </p>\r\n ) : spaces.length === 0 ? (\r\n <p className=\"px-2 py-1 text-sm text-muted-foreground\">\r\n {t('empty', 'This model has no IfcSpaces.')}\r\n </p>\r\n ) : (\r\n <>\r\n <p className=\"px-2 pb-1 text-xs text-muted-foreground\">\r\n {t('count', 'Spaces in this model: ')}{spaces.length}\r\n </p>\r\n\r\n <Item\r\n label={painted ? t('clearColours', 'Clear colours') : t('colourSpaces', 'Colour the spaces')}\r\n onClick={() => setPainted(current => !current)}\r\n />\r\n <Item label={t('isolateSpaces', 'Isolate spaces')} onClick={() => { void isolateSpaces() }} />\r\n <Item label={t('resetView', 'Reset the view')} onClick={() => { void reset() }} />\r\n </>\r\n )}\r\n </div>\r\n )\r\n}\r\n\r\nfunction Item({ label, onClick }: { label: string; onClick: () => void }) {\r\n return (\r\n <Button\r\n size=\"sm\"\r\n variant=\"ghost\"\r\n className=\"w-full justify-start truncate font-normal\"\r\n onClick={onClick}\r\n >\r\n {label}\r\n </Button>\r\n )\r\n}\r\n"],"mappings":";AA8CM,SAgBE,UAhBF,KAiBI,YAjBJ;AAzCN,SAAS,QAAQ,iBAAiB;AAClC,SAAS,6BAA6B;AACtC,SAAS,cAAc,kBAAkB,iBAAiB;AASnD,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAoC;AAClC,QAAM,IAAI,sBAAsB;AAChC,QAAM,EAAE,QAAQ,UAAU,IAAI,UAAU;AACxC,QAAM,EAAE,SAAS,WAAW,IAAI,iBAAiB;AAEjD,QAAM,QAAQ,MAAM,aAAa,MAAM;AAEvC,QAAM,gBAAgB,YAAY;AAChC,QAAI,OAAO,WAAW,EAAG;AAEzB,UAAM,gBAAgB,MAAM,GAAG,IAAI;AACnC,UAAM,QAAQ,MAAM,CAAC;AACrB,UAAM,OAAO,MAAM,CAAC;AACpB,UAAM,eAAe;AAAA,EACvB;AAEA,QAAM,QAAQ,YAAY;AACxB,eAAW,KAAK;AAChB,UAAM,QAAQ;AAAA,EAChB;AAEA,SACE,qBAAC,SAAI,WAAU,YACb;AAAA,wBAAC,OAAE,WAAU,iCAAiC,YAAE,SAAS,QAAQ,GAAE;AAAA,IACnE,oBAAC,aAAU,WAAU,QAAO;AAAA,IAE3B,SAAS,WAAW,IACnB,oBAAC,OAAE,WAAU,2CACV,YAAE,WAAW,iCAAiC,GACjD,IACE,aAAa,OAAO,WAAW,IACjC,oBAAC,OAAE,WAAU,2CACV,YAAE,WAAW,yBAAoB,GACpC,IACE,OAAO,WAAW,IACpB,oBAAC,OAAE,WAAU,2CACV,YAAE,SAAS,8BAA8B,GAC5C,IAEA,iCACE;AAAA,2BAAC,OAAE,WAAU,2CACV;AAAA,UAAE,SAAS,wBAAwB;AAAA,QAAG,OAAO;AAAA,SAChD;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,OAAO,UAAU,EAAE,gBAAgB,eAAe,IAAI,EAAE,gBAAgB,mBAAmB;AAAA,UAC3F,SAAS,MAAM,WAAW,aAAW,CAAC,OAAO;AAAA;AAAA,MAC/C;AAAA,MACA,oBAAC,QAAK,OAAO,EAAE,iBAAiB,gBAAgB,GAAG,SAAS,MAAM;AAAE,aAAK,cAAc;AAAA,MAAE,GAAG;AAAA,MAC5F,oBAAC,QAAK,OAAO,EAAE,aAAa,gBAAgB,GAAG,SAAS,MAAM;AAAE,aAAK,MAAM;AAAA,MAAE,GAAG;AAAA,OAClF;AAAA,KAEJ;AAEJ;AAEA,SAAS,KAAK,EAAE,OAAO,QAAQ,GAA2C;AACxE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAQ;AAAA,MACR,WAAU;AAAA,MACV;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../../../src/core/plugins/hello-bim/components/icons.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B;;;GAGG;AACH,wBAAgB,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qBAehE;AAED,wBAAgB,SAAS,sBAExB;AAED,wBAAgB,KAAK,sBAEpB;AAED,wFAAwF;AACxF,wBAAgB,QAAQ,sBAevB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/core/plugins/hello-bim/components/icons.tsx"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport * as React from 'react'\r\n\r\n/**\r\n * Drawn here: `lucide-react` is unshimmed, so a plugin cannot import it. Icon *names* work in\r\n * registrations, where the host resolves them. Labels live on each button's aria-label.\r\n */\r\nexport function Glyph({ children }: { children: React.ReactNode }) {\r\n return (\r\n <svg\r\n viewBox=\"0 0 24 24\"\r\n className=\"h-4 w-4\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n aria-hidden=\"true\"\r\n >\r\n {children}\r\n </svg>\r\n )\r\n}\r\n\r\nexport function CheckIcon() {\r\n return <path d=\"M20 6 9 17l-5-5\" />\r\n}\r\n\r\nexport function XIcon() {\r\n return <><path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" /></>\r\n}\r\n\r\n/** Smaller than the button glyphs — it sits inside a 24px swatch, not a 32px button. */\r\nexport function PlusIcon() {\r\n return (\r\n <svg\r\n viewBox=\"0 0 24 24\"\r\n className=\"h-3 w-3\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2.5\"\r\n strokeLinecap=\"round\"\r\n aria-hidden=\"true\"\r\n >\r\n <path d=\"M5 12h14\" />\r\n <path d=\"M12 5v14\" />\r\n </svg>\r\n )\r\n}\r\n"],"mappings":";AAaI,SAoBK,UApBL,KAoBK,YApBL;AAFG,SAAS,MAAM,EAAE,SAAS,GAAkC;AACjE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,WAAU;AAAA,MACV,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,eAAc;AAAA,MACd,gBAAe;AAAA,MACf,eAAY;AAAA,MAEX;AAAA;AAAA,EACH;AAEJ;AAEO,SAAS,YAAY;AAC1B,SAAO,oBAAC,UAAK,GAAE,mBAAkB;AACnC;AAEO,SAAS,QAAQ;AACtB,SAAO,iCAAE;AAAA,wBAAC,UAAK,GAAE,cAAa;AAAA,IAAE,oBAAC,UAAK,GAAE,cAAa;AAAA,KAAE;AACzD;AAGO,SAAS,WAAW;AACzB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAQ;AAAA,MACR,WAAU;AAAA,MACV,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,eAAc;AAAA,MACd,eAAY;AAAA,MAEZ;AAAA,4BAAC,UAAK,GAAE,YAAW;AAAA,QACnB,oBAAC,UAAK,GAAE,YAAW;AAAA;AAAA;AAAA,EACrB;AAEJ;","names":[]}
@@ -1,7 +0,0 @@
1
- import type { PluginContext } from '../sdk/types';
2
- /**
3
- * Four surfaces over the model IfcSpaces, all reading one hook. The IFC is never written to:
4
- * a renamed space is an annotation this plugin stores, and the dialog shows both names.
5
- */
6
- export declare function activate(ctx: PluginContext): void;
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/plugins/hello-bim/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CA+BjD"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/core/plugins/hello-bim/index.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport { ViewerNames } from '../sdk/types'\r\n\r\nimport { SpaceDialog } from './components/SpaceDialog'\r\nimport { useSpacesLegend } from './components/SpacesLegend'\r\nimport { SpacesTab } from './components/SpacesTab'\r\nimport { SpacesTool } from './components/SpacesTool'\r\n\r\nimport type { PluginContext } from '../sdk/types'\r\n\r\n/**\r\n * Four surfaces over the model IfcSpaces, all reading one hook. The IFC is never written to:\r\n * a renamed space is an annotation this plugin stores, and the dialog shows both names.\r\n */\r\nexport function activate(ctx: PluginContext): void {\r\n ctx.register('bim.tools', {\r\n id: 'hello-bim',\r\n label: 'Spaces',\r\n icon: 'Boxes',\r\n component: SpacesTool,\r\n stayActive: true,\r\n })\r\n\r\n ctx.register('viewer.tabs', {\r\n id: 'spaces',\r\n labelKey: 'tabTitle',\r\n icon: 'Boxes',\r\n // BIM only: there are no IfcSpaces to annotate on the map or in a point cloud.\r\n viewers: [ViewerNames.bim],\r\n component: SpacesTab,\r\n })\r\n\r\n ctx.register('viewer.legends', {\r\n id: 'spaces',\r\n title: 'Spaces',\r\n viewers: [ViewerNames.bim],\r\n useLegend: useSpacesLegend,\r\n })\r\n\r\n ctx.register('ui.dialogs', {\r\n id: 'detail',\r\n titleKey: 'dialogTitle',\r\n size: 'md',\r\n component: SpaceDialog,\r\n })\r\n}\r\n"],"mappings":"AAGA,SAAS,mBAAmB;AAE5B,SAAS,mBAAmB;AAC5B,SAAS,uBAAuB;AAChC,SAAS,iBAAiB;AAC1B,SAAS,kBAAkB;AAQpB,SAAS,SAAS,KAA0B;AACjD,MAAI,SAAS,aAAa;AAAA,IACxB,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,WAAW;AAAA,IACX,YAAY;AAAA,EACd,CAAC;AAED,MAAI,SAAS,eAAe;AAAA,IAC1B,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA;AAAA,IAEN,SAAS,CAAC,YAAY,GAAG;AAAA,IACzB,WAAW;AAAA,EACb,CAAC;AAED,MAAI,SAAS,kBAAkB;AAAA,IAC7B,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,SAAS,CAAC,YAAY,GAAG;AAAA,IACzB,WAAW;AAAA,EACb,CAAC;AAED,MAAI,SAAS,cAAc;AAAA,IACzB,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,WAAW;AAAA,EACb,CAAC;AACH;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"spaces.d.ts","sourceRoot":"","sources":["../../../../src/core/plugins/hello-bim/spaces.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,wFAAwF;AACxF,MAAM,WAAW,eAAgB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC9D,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,KAAK;IACpB,6FAA6F;IAC7F,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAA;IACf,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,6DAA6D;IAC7D,SAAS,EAAE,OAAO,CAAA;CACnB;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAMxD;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB;AAKD,wBAAgB,iBAAiB,IAAI;IAAE,UAAU,EAAE,eAAe,EAAE,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAiDxF;AAgBD;;;GAGG;AACH,wBAAgB,SAAS;;;;;;kBAoET,MAAM,QAAQ,MAAM;qBAS1B,MAAM,UAAU,MAAM;iBAMhB,MAAM;EAiBrB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB;;;EAuB/B;AAED,4DAA4D;AAC5D,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE/C"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/core/plugins/hello-bim/spaces.ts"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport * as React from 'react'\r\n\r\nimport { stringToColour } from '../sdk'\r\nimport { usePluginBimAppearance, useBimViewer } from '../sdk/bimViewer'\r\nimport { usePluginState } from '../sdk/state'\r\nimport { usePluginStore } from '../sdk/store'\r\n\r\nimport type { ModelIdMap } from '../sdk/bimViewer'\r\n\r\n/** What the plugin stores about one space. The IFC model itself is never written to. */\r\nexport interface SpaceAnnotation extends Record<string, unknown> {\r\n /** Replaces the IFC name in this plugin's own surfaces. */\r\n name: string\r\n colour: string\r\n}\r\n\r\nexport interface Space {\r\n /** `<modelId>::<localId>` — stable for as long as the model is, and safe as a record key. */\r\n key: string\r\n modelId: string\r\n localId: number\r\n /** From the IFC, and never changed. */\r\n ifcName: string\r\n /** The annotation's name when there is one, otherwise the IFC's. */\r\n name: string\r\n colour: string\r\n /** Whether the plugin has stored anything for this space. */\r\n annotated: boolean\r\n}\r\n\r\nexport function spaceKey(modelId: string, localId: number): string {\r\n return `${modelId}::${localId}`\r\n}\r\n\r\n/** Sets, not arrays: `ModelIdMap` is `Record<string, Set<number>>`. */\r\nexport function toModelIdMap(spaces: Space[]): ModelIdMap {\r\n const items: ModelIdMap = {}\r\n for (const space of spaces) {\r\n (items[space.modelId] ??= new Set<number>()).add(space.localId)\r\n }\r\n return items\r\n}\r\n\r\nexport interface DiscoveredSpace {\r\n modelId: string\r\n localId: number\r\n ifcName: string\r\n}\r\n\r\n// Module scope, not plugin state: a state claim is an effect dep, so it cancels its own scan.\r\nconst scans = new Map<string, Promise<DiscoveredSpace[]>>()\r\n\r\nexport function useSpaceDiscovery(): { discovered: DiscoveredSpace[]; scanning: boolean } {\r\n const { components, modelIds, getItemsOfCategory, getProperties } = useBimViewer()\r\n const [discovered, setDiscovered] = usePluginState<DiscoveredSpace[]>('discovered', [])\r\n const [scannedFor, setScannedFor] = usePluginState<string | null>('scannedFor', null)\r\n\r\n const modelKey = modelIds.join('|')\r\n\r\n React.useEffect(() => {\r\n if (!components || modelKey === scannedFor) return\r\n\r\n if (modelIds.length === 0) {\r\n setDiscovered([])\r\n setScannedFor(modelKey)\r\n return\r\n }\r\n\r\n let cancelled = false\r\n\r\n const scan = scans.get(modelKey) ?? (async () => {\r\n const items = await getItemsOfCategory('IFCSPACE')\r\n const properties = await getProperties(items, ['Name', 'LongName'])\r\n\r\n return properties.map(entry => ({\r\n modelId: entry.modelId,\r\n localId: entry.localId,\r\n ifcName: readName(entry) ?? `Space ${entry.localId}`,\r\n }))\r\n })()\r\n\r\n scans.set(modelKey, scan)\r\n\r\n void scan\r\n .then((found) => {\r\n if (cancelled) return\r\n setDiscovered(found)\r\n // Only once there is a result, or a cancelled surface marks it looked-at.\r\n setScannedFor(modelKey)\r\n })\r\n .catch((error) => {\r\n console.error('[hello-bim] could not read the model\\'s spaces:', error)\r\n scans.delete(modelKey)\r\n })\r\n\r\n return () => {\r\n cancelled = true\r\n }\r\n }, [components, modelKey, modelIds, scannedFor, getItemsOfCategory, getProperties, setDiscovered, setScannedFor])\r\n\r\n return { discovered, scanning: components !== null && modelKey !== scannedFor }\r\n}\r\n\r\n/** IFC attributes arrive bare or wrapped in `{ value }`, depending on the model. */\r\nfunction readName(entry: Record<string, unknown>): string | null {\r\n for (const key of ['LongName', 'Name']) {\r\n const raw = entry[key]\r\n if (typeof raw === 'string' && raw.trim()) return raw.trim()\r\n\r\n if (raw && typeof raw === 'object' && 'value' in raw) {\r\n const value = (raw as { value: unknown }).value\r\n if (typeof value === 'string' && value.trim()) return value.trim()\r\n }\r\n }\r\n return null\r\n}\r\n\r\n/**\r\n * The spaces, plus the annotations this plugin stores against them. The IFC is read-only, so\r\n * a rename is an annotation, never a write to the model.\r\n */\r\nexport function useSpaces() {\r\n const { discovered, scanning } = useSpaceDiscovery()\r\n const store = usePluginStore<SpaceAnnotation>('spaces')\r\n const [selectedKey, setSelectedKey] = usePluginState<string | null>('selected', null)\r\n const [lastError, setLastError] = usePluginState<string | null>('lastError', null)\r\n\r\n const attempt = React.useCallback(\r\n async (action: () => Promise<void>) => {\r\n try {\r\n await action()\r\n setLastError(null)\r\n return true\r\n }\r\n catch (error) {\r\n const message = error instanceof Error ? error.message : String(error)\r\n console.error('[hello-bim] save failed:', error)\r\n setLastError(message)\r\n return false\r\n }\r\n },\r\n [setLastError],\r\n )\r\n\r\n const annotations = React.useMemo(\r\n () => new Map(store.items.map(item => [item.key, item.data])),\r\n [store.items],\r\n )\r\n\r\n const spaces = React.useMemo<Space[]>(\r\n () => discovered.map((found) => {\r\n const key = spaceKey(found.modelId, found.localId)\r\n const annotation = annotations.get(key)\r\n\r\n return {\r\n key,\r\n modelId: found.modelId,\r\n localId: found.localId,\r\n ifcName: found.ifcName,\r\n name: annotation?.name ?? found.ifcName,\r\n // Hashed, so an unpicked colour is stable per space rather than shuffling.\r\n colour: annotation?.colour ?? stringToColour(key),\r\n annotated: annotation !== undefined,\r\n }\r\n }),\r\n [discovered, annotations],\r\n )\r\n\r\n const byKey = React.useMemo(\r\n () => new Map(spaces.map(space => [space.key, space])),\r\n [spaces],\r\n )\r\n\r\n /** One edit path, so a field added to the annotation cannot be dropped by a rename. */\r\n const patch = React.useCallback(\r\n async (key: string, changes: Partial<SpaceAnnotation>) => {\r\n const current = byKey.get(key)\r\n if (!current) return\r\n\r\n await attempt(() => store.put(key, {\r\n name: current.name,\r\n colour: current.colour,\r\n ...changes,\r\n }))\r\n },\r\n [store, byKey, attempt],\r\n )\r\n\r\n const rename = React.useCallback(\r\n async (key: string, name: string) => {\r\n const trimmed = name.trim()\r\n if (!trimmed || trimmed === byKey.get(key)?.name) return\r\n await patch(key, { name: trimmed })\r\n },\r\n [patch, byKey],\r\n )\r\n\r\n const setColour = React.useCallback(\r\n (key: string, colour: string) => patch(key, { colour }),\r\n [patch],\r\n )\r\n\r\n /** Drops the annotation, so the space goes back to its IFC name and a hashed colour. */\r\n const reset = React.useCallback(\r\n async (key: string) => {\r\n if (!byKey.get(key)?.annotated) return\r\n await attempt(() => store.remove(key))\r\n },\r\n [store, byKey, attempt],\r\n )\r\n\r\n return {\r\n spaces,\r\n isLoading: store.isLoading || scanning,\r\n lastError,\r\n selected: selectedKey === null ? null : byKey.get(selectedKey) ?? null,\r\n select: setSelectedKey,\r\n rename,\r\n setColour,\r\n reset,\r\n }\r\n}\r\n\r\n/**\r\n * Whether the spaces are painted, applied from an effect so a recolour repaints at once.\r\n * The flag is plugin state, so the toolbar and the tab agree on it.\r\n */\r\nexport function useSpacePainting() {\r\n const { spaces } = useSpaces()\r\n const { setItemsVisible } = useBimViewer()\r\n const { setAppearance, clearAppearance } = usePluginBimAppearance()\r\n const [painted, setPainted] = usePluginState('painted', false)\r\n\r\n React.useEffect(() => {\r\n if (!painted) {\r\n clearAppearance()\r\n return\r\n }\r\n if (spaces.length === 0) return\r\n\r\n // IfcSpaces start hidden, so painting them without this colours nothing visible.\r\n void setItemsVisible(toModelIdMap(spaces), true)\r\n\r\n setAppearance(spaces.map(space => ({\r\n items: toModelIdMap([space]),\r\n appearance: { color: hexToInt(space.colour) },\r\n })))\r\n }, [painted, spaces, setAppearance, clearAppearance, setItemsVisible])\r\n\r\n return { painted, setPainted }\r\n}\r\n\r\n/** `#rrggbb` to the `0xRRGGBB` the appearance API takes. */\r\nexport function hexToInt(colour: string): number {\r\n return Number.parseInt(colour.replace('#', ''), 16)\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;AAKA,YAAY,WAAW;AAEvB,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB,oBAAoB;AACrD,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAyBxB,SAAS,SAAS,SAAiB,SAAyB;AACjE,SAAO,GAAG,OAAO,KAAK,OAAO;AAC/B;AAGO,SAAS,aAAa,QAA6B;AAxC1D;AAyCE,QAAM,QAAoB,CAAC;AAC3B,aAAW,SAAS,QAAQ;AAC1B,MAAC,gBAAM,MAAM,aAAZ,wBAAyB,oBAAI,IAAY,GAAG,IAAI,MAAM,OAAO;AAAA,EAChE;AACA,SAAO;AACT;A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,MAAA,MAAM,IAAI,GAAG,MAAb,gBAAAA,IAAgB,WAAW;AAChC,YAAM,QAAQ,MAAM,MAAM,OAAO,GAAG,CAAC;AAAA,IACvC;AAAA,IACA,CAAC,OAAO,OAAO,OAAO;AAAA,EACxB;AAEA,SAAO;AAAA,IACL;AAAA,IACA,WAAW,MAAM,aAAa;AAAA,IAC9B;AAAA,IACA,UAAU,gBAAgB,OAAO,QAAO,WAAM,IAAI,WAAW,MAArB,YAA0B;AAAA,IAClE,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAMO,SAAS,mBAAmB;AACjC,QAAM,EAAE,OAAO,IAAI,UAAU;AAC7B,QAAM,EAAE,gBAAgB,IAAI,aAAa;AACzC,QAAM,EAAE,eAAe,gBAAgB,IAAI,uBAAuB;AAClE,QAAM,CAAC,SAAS,UAAU,IAAI,eAAe,WAAW,KAAK;AAE7D,QAAM,UAAU,MAAM;AACpB,QAAI,CAAC,SAAS;AACZ,sBAAgB;AAChB;AAAA,IACF;AACA,QAAI,OAAO,WAAW,EAAG;AAGzB,SAAK,gBAAgB,aAAa,MAAM,GAAG,IAAI;AAE/C,kBAAc,OAAO,IAAI,YAAU;AAAA,MACjC,OAAO,aAAa,CAAC,KAAK,CAAC;AAAA,MAC3B,YAAY,EAAE,OAAO,SAAS,MAAM,MAAM,EAAE;AAAA,IAC9C,EAAE,CAAC;AAAA,EACL,GAAG,CAAC,SAAS,QAAQ,eAAe,iBAAiB,eAAe,CAAC;AAErE,SAAO,EAAE,SAAS,WAAW;AAC/B;AAGO,SAAS,SAAS,QAAwB;AAC/C,SAAO,OAAO,SAAS,OAAO,QAAQ,KAAK,EAAE,GAAG,EAAE;AACpD;","names":["_a"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"MapTool.d.ts","sourceRoot":"","sources":["../../../../../src/core/plugins/hello-map/components/MapTool.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAMvD;;;GAGG;AACH,wBAAgB,OAAO,CAAC,EAAE,GAAG,EAAE,EAAE,gBAAgB,GAAG,YAAY,qBA4E/D"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/core/plugins/hello-map/components/MapTool.tsx"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport * as React from 'react'\r\n\r\nimport { Button, Separator } from '../../sdk/components'\r\nimport { usePluginConfig } from '../../sdk/config'\r\nimport { usePluginTranslations } from '../../sdk/messages'\r\nimport { useMarkers } from '../markers'\r\n\r\nimport type { MapToolProps } from '../../sdk/mapViewer'\r\nimport type { ToolbarToolProps } from '../../sdk/types'\r\n\r\ninterface Config extends Record<string, unknown> {\r\n decimals?: number\r\n}\r\n\r\n/**\r\n * Where the map is, and a button to record it. The marker itself is drawn by `MarkersLayer`,\r\n * because this panel unmounts as soon as the dropdown closes.\r\n */\r\nexport function MapTool({ map }: ToolbarToolProps & MapToolProps) {\r\n const t = usePluginTranslations()\r\n const { decimals = 5 } = usePluginConfig<Config>()\r\n const { add, markers, lastError } = useMarkers()\r\n\r\n const [view, setView] = React.useState<{ lng: number; lat: number; zoom: number } | null>(null)\r\n const [saving, setSaving] = React.useState(false)\r\n\r\n React.useEffect(() => {\r\n if (!map) return\r\n\r\n const read = () => {\r\n const centre = map.getCenter()\r\n setView({ lng: centre.lng, lat: centre.lat, zoom: map.getZoom() })\r\n }\r\n\r\n read()\r\n map.on('move', read)\r\n return () => {\r\n map.off('move', read)\r\n }\r\n }, [map])\r\n\r\n const record = async () => {\r\n if (!view || saving) return\r\n\r\n setSaving(true)\r\n try {\r\n await add(view.lat, view.lng, view.zoom)\r\n } finally {\r\n setSaving(false)\r\n }\r\n }\r\n\r\n return (\r\n <div className=\"w-64 p-1\">\r\n <p className=\"px-2 py-1 text-sm font-medium\">{t('title', 'Hello Map')}</p>\r\n <Separator className=\"my-1\" />\r\n\r\n {view ? (\r\n <>\r\n <dl className=\"px-2 py-1 text-sm\">\r\n <Row label={t('latitude', 'Latitude')} value={view.lat.toFixed(decimals)} />\r\n <Row label={t('longitude', 'Longitude')} value={view.lng.toFixed(decimals)} />\r\n <Row label={t('zoom', 'Zoom')} value={view.zoom.toFixed(2)} />\r\n </dl>\r\n\r\n <Separator className=\"my-1\" />\r\n\r\n <Button\r\n size=\"sm\"\r\n variant=\"ghost\"\r\n className=\"w-full justify-start font-normal\"\r\n disabled={saving}\r\n onClick={() => { void record() }}\r\n >\r\n {saving ? t('recording', 'Recording…') : t('record', 'Record a marker here')}\r\n </Button>\r\n\r\n <p className=\"px-2 py-1 text-xs text-muted-foreground\">\r\n {t('markerCount', 'Markers: ')}{markers.length}\r\n </p>\r\n\r\n {lastError && (\r\n <p className=\"px-2 py-1 text-xs text-destructive\">\r\n {t('saveFailed', 'Could not save: ')}{lastError}\r\n </p>\r\n )}\r\n </>\r\n ) : (\r\n <p className=\"px-2 py-1 text-sm text-muted-foreground\">\r\n {t('waiting', 'Waiting for the map…')}\r\n </p>\r\n )}\r\n </div>\r\n )\r\n}\r\n\r\nfunction Row({ label, value }: { label: string; value: string }) {\r\n return (\r\n <div className=\"flex items-baseline justify-between gap-3 py-0.5\">\r\n <dt className=\"text-muted-foreground\">{label}</dt>\r\n <dd className=\"tabular-nums\">{value}</dd>\r\n </div>\r\n )\r\n}\r\n"],"mappings":";AA2DM,SAIE,UAJF,KAKI,YALJ;AAtDN,YAAY,WAAW;AAEvB,SAAS,QAAQ,iBAAiB;AAClC,SAAS,uBAAuB;AAChC,SAAS,6BAA6B;AACtC,SAAS,kBAAkB;AAapB,SAAS,QAAQ,EAAE,IAAI,GAAoC;AAChE,QAAM,IAAI,sBAAsB;AAChC,QAAM,EAAE,WAAW,EAAE,IA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AE5B;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAQ;AAAA,UACR,WAAU;AAAA,UACV,UAAU;AAAA,UACV,SAAS,MAAM;AAAE,iBAAK,OAAO;AAAA,UAAE;AAAA,UAE9B,mBAAS,EAAE,aAAa,iBAAY,IAAI,EAAE,UAAU,sBAAsB;AAAA;AAAA,MAC7E;AAAA,MAEA,qBAAC,OAAE,WAAU,2CACV;AAAA,UAAE,eAAe,WAAW;AAAA,QAAG,QAAQ;AAAA,SAC1C;AAAA,MAEC,aACC,qBAAC,OAAE,WAAU,sCACV;AAAA,UAAE,cAAc,kBAAkB;AAAA,QAAG;AAAA,SACxC;AAAA,OAEJ,IAEA,oBAAC,OAAE,WAAU,2CACV,YAAE,WAAW,2BAAsB,GACtC;AAAA,KAEJ;AAEJ;AAEA,SAAS,IAAI,EAAE,OAAO,MAAM,GAAqC;AAC/D,SACE,qBAAC,SAAI,WAAU,oDACb;AAAA,wBAAC,QAAG,WAAU,yBAAyB,iBAAM;AAAA,IAC7C,oBAAC,QAAG,WAAU,gBAAgB,iBAAM;AAAA,KACtC;AAEJ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"MarkerDialog.d.ts","sourceRoot":"","sources":["../../../../../src/core/plugins/hello-map/components/MarkerDialog.tsx"],"names":[],"mappings":"AASA,UAAU,KAAK;IACb,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,yFAAyF;IACzF,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,8FAA8F;AAC9F,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,KAAK,+BAwCvD"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/core/plugins/hello-map/components/MarkerDialog.tsx"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport { Button } from '../../sdk/components'\r\nimport { usePluginTranslations } from '../../sdk/messages'\r\nimport { useMarkers } from '../markers'\r\n\r\ninterface Props {\r\n close: () => void\r\n /** Supplied by whichever surface opened this — the sidebar tab, or a row on the page. */\r\n markerKey?: string\r\n}\r\n\r\n/** One marker in full. Core owns the overlay and Escape; this outlives whatever opened it. */\r\nexport function MarkerDialog({ close, markerKey }: Props) {\r\n const t = usePluginTranslations()\r\n const { markers, selected } = useMarkers()\r\n\r\n const marker = markerKey\r\n ? markers.find(candidate => candidate.key === markerKey) ?? null\r\n : selected\r\n\r\n if (!marker) {\r\n return (\r\n <div className=\"flex flex-col gap-4\">\r\n <p className=\"text-sm text-muted-foreground\">\r\n {t('gone', 'That marker no longer exists.')}\r\n </p>\r\n <Button className=\"self-end\" onClick={close}>{t('close', 'Close')}</Button>\r\n </div>\r\n )\r\n }\r\n\r\n return (\r\n <div className=\"flex flex-col gap-4\">\r\n <div className=\"flex items-center gap-2\">\r\n <span\r\n aria-hidden=\"true\"\r\n className=\"inline-block h-4 w-4 rounded-full border border-white\"\r\n style={{ backgroundColor: marker.colour }}\r\n />\r\n <p className=\"font-medium\">{marker.name}</p>\r\n </div>\r\n\r\n <dl className=\"text-sm\">\r\n <Row label={t('columnLatitude', 'Latitude')} value={marker.latitude.toFixed(5)} />\r\n <Row label={t('columnLongitude', 'Longitude')} value={marker.longitude.toFixed(5)} />\r\n <Row label={t('zoom', 'Zoom')} value={marker.zoom.toFixed(2)} />\r\n <Row label={t('colour', 'Colour')} value={marker.colour} />\r\n </dl>\r\n\r\n <Button className=\"self-end\" onClick={close}>{t('close', 'Close')}</Button>\r\n </div>\r\n )\r\n}\r\n\r\nfunction Row({ label, value }: { label: string; value: string }) {\r\n return (\r\n <div className=\"flex items-baseline justify-between gap-3 py-0.5\">\r\n <dt className=\"text-muted-foreground\">{label}</dt>\r\n <dd className=\"tabular-nums\">{value}</dd>\r\n </div>\r\n )\r\n}\r\n"],"mappings":";AA0BM,SACE,KADF;AArBN,SAAS,cAAc;AACvB,SAAS,6BAA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M,GAAqC;AAC/D,SACE,qBAAC,SAAI,WAAU,oDACb;AAAA,wBAAC,QAAG,WAAU,yBAAyB,iBAAM;AAAA,IAC7C,oBAAC,QAAG,WAAU,gBAAgB,iBAAM;AAAA,KACtC;AAEJ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"MarkersLayer.d.ts","sourceRoot":"","sources":["../../../../../src/core/plugins/hello-map/components/MarkersLayer.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAMvD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAAE,GAAG,EAAE,EAAE,YAAY,qBAmEjD"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/core/plugins/hello-map/components/MarkersLayer.tsx"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport * as React from 'react'\r\nimport { createPortal } from 'react-dom'\r\n\r\nimport { usePluginTranslations } from '../../sdk/messages'\r\nimport { useMarkers } from '../markers'\r\n\r\nimport type { MapToolProps } from '../../sdk/mapViewer'\r\nimport type { Marker } from '../markers'\r\n\r\nconst SOURCE = 'hello-map-markers'\r\nconst LAYER = 'hello-map-markers'\r\n\r\n/**\r\n * The markers and the open popup. A `map.layers` contribution, not part of the tool, whose\r\n * panel unmounts. A GeoJSON source, because a plugin cannot import `maplibre-gl`.\r\n */\r\nexport function MarkersLayer({ map }: MapToolProps) {\r\n const { markers, open } = useMarkers()\r\n\r\n const featuresRef = React.useRef<Marker[]>(markers)\r\n featuresRef.current = markers\r\n\r\n React.useEffect(() => {\r\n if (!map) return\r\n\r\n // Re-run on every style change: the basemap switcher drops every source and layer.\r\n const ensureLayer = () => {\r\n if (!map.getStyle() || map.getSource(SOURCE)) return\r\n\r\n map.addSource(SOURCE, { type: 'geojson', data: toFeatureCollection(featuresRef.current) })\r\n\r\n map.addLayer({\r\n id: LAYER,\r\n type: 'circle',\r\n source: SOURCE,\r\n paint: {\r\n // Read per feature, so recolouring one marker needs no layer change.\r\n 'circle-color': ['get', 'colour'],\r\n 'circle-radius': 7,\r\n 'circle-stroke-width': 2,\r\n 'circle-stroke-color': '#ffffff',\r\n },\r\n })\r\n }\r\n\r\n const openFeature = (event: { features?: Array<{ properties?: Record<string, unknown> }> }) => {\r\n const key = event.features?.[0]?.properties?.key\r\n if (typeof key === 'string') open(key)\r\n }\r\n\r\n const pointer = () => { map.getCanvas().style.cursor = 'pointer' }\r\n const clearPointer = () => { map.getCanvas().style.cursor = '' }\r\n\r\n if (map.isStyleLoaded()) ensureLayer()\r\n map.on('styledata', ensureLayer)\r\n map.on('click', LAYER, openFeature)\r\n map.on('mouseenter', LAYER, pointer)\r\n map.on('mouseleave', LAYER, clearPointer)\r\n\r\n return () => {\r\n map.off('styledata', ensureLayer)\r\n map.off('click', LAYER, openFeature)\r\n map.off('mouseenter', LAYER, pointer)\r\n map.off('mouseleave', LAYER, clearPointer)\r\n\r\n // Guarded: the style may be gone, and removing what is already gone throws.\r\n if (map.getLayer(LAYER)) map.removeLayer(LAYER)\r\n if (map.getSource(SOURCE)) map.removeSource(SOURCE)\r\n clearPointer()\r\n }\r\n }, [map, open])\r\n\r\n // setData, not a teardown: re-adding the layer would make the markers flicker.\r\n React.useEffect(() => {\r\n if (!map) return\r\n\r\n const source = map.getSource(SOURCE)\r\n if (source && 'setData' in source) {\r\n (source as { setData: (data: unknown) => void }).setData(toFeatureCollection(markers))\r\n }\r\n }, [map, markers])\r\n\r\n return <MarkerPopup map={map} />\r\n}\r\n\r\nfunction toFeatureCollection(markers: Marker[]) {\r\n return {\r\n type: 'FeatureCollection' as const,\r\n features: markers.map(marker => ({\r\n type: 'Feature' as const,\r\n geometry: { type: 'Point' as const, coordinates: [marker.longitude, marker.latitude] },\r\n // Only what the layer and the click handler read. Everything else stays in the store.\r\n properties: { key: marker.key, colour: marker.colour },\r\n })),\r\n }\r\n}\r\n\r\n/**\r\n * The popup for the open marker, portalled into the map's own container so it sits over the\r\n * canvas. Positioned with `map.project`, which is why it has to follow every move.\r\n */\r\nfunction MarkerPopup({ map }: MapToolProps) {\r\n const t = usePluginTranslations()\r\n const { openMarker, open } = useMarkers()\r\n const [, forceReposition] = React.useState(0)\r\n\r\n React.useEffect(() => {\r\n if (!map || !openMarker) return\r\n\r\n const reposition = () => forceReposition(tick => tick + 1)\r\n\r\n map.on('move', reposition)\r\n return () => {\r\n map.off('move', reposition)\r\n }\r\n }, [map, openMarker])\r\n\r\n if (!map || !openMarker) return null\r\n\r\n const { x, y } = map.project([openMarker.longitude, openMarker.latitude])\r\n\r\n return createPortal(\r\n <div\r\n className=\"absolute z-10 -translate-x-1/2 -translate-y-full pb-3\"\r\n style={{ left: x, top: y }}\r\n >\r\n <div className=\"rounded-md border bg-background px-3 py-2 shadow-lg\">\r\n <div className=\"flex items-start gap-2\">\r\n <span\r\n aria-hidden=\"true\"\r\n className=\"mt-1 inline-block h-3 w-3 shrink-0 rounded-full border border-white\"\r\n style={{ backgroundColor: openMarker.colour }}\r\n />\r\n <div className=\"text-xs\">\r\n <p className=\"font-medium\">{openMarker.name}</p>\r\n <p className=\"tabular-nums text-muted-foreground\">\r\n {openMarker.latitude.toFixed(5)}, {openMarker.longitude.toFixed(5)}\r\n </p>\r\n </div>\r\n <button\r\n type=\"button\"\r\n className=\"ml-2 text-muted-foreground hover:text-foreground\"\r\n aria-label={t('close', 'Close')}\r\n onClick={() => open(null)}\r\n >\r\n ×\r\n </button>\r\n </div>\r\n </div>\r\n </div>,\r\n map.getContainer(),\r\n )\r\n}\r\n"],"mappings":";AAuFS,cAqDG,YArDH;AAlFT,YAAY,WAAW;AACvB,SAAS,oBAAoB;AAE7B,SAAS,6BAA6B;AACtC,SAAS,kBAAkB;AAK3B,MAAM,SAAS;AACf,MAAM,QAAQ;AAMP,SAAS,aAAa,EAAE,IAAI,GA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AAExE,SAAO;AAAA,IACL;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,OAAO,EAAE,MAAM,GAAG,KAAK,EAAE;AAAA,QAEzB,8BAAC,SAAI,WAAU,uDACb,+BAAC,SAAI,WAAU,0BACb;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,eAAY;AAAA,cACZ,WAAU;AAAA,cACV,OAAO,EAAE,iBAAiB,WAAW,OAAO;AAAA;AAAA,UAC9C;AAAA,UACA,qBAAC,SAAI,WAAU,WACb;AAAA,gCAAC,OAAE,WAAU,eAAe,qBAAW,MAAK;AAAA,YAC5C,qBAAC,OAAE,WAAU,sCACV;AAAA,yBAAW,SAAS,QAAQ,CAAC;AAAA,cAAE;AAAA,cAAG,WAAW,UAAU,QAAQ,CAAC;AAAA,eACnE;AAAA,aACF;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,WAAU;AAAA,cACV,cAAY,EAAE,SAAS,OAAO;AAAA,cAC9B,SAAS,MAAM,KAAK,IAAI;AAAA,cACzB;AAAA;AAAA,UAED;AAAA,WACF,GACF;AAAA;AAAA,IACF;AAAA,IACA,IAAI,aAAa;AAAA,EACnB;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"MarkersLegend.d.ts","sourceRoot":"","sources":["../../../../../src/core/plugins/hello-map/components/MarkersLegend.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,EAAE,CAAA;CAAE,CAczF"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/core/plugins/hello-map/components/MarkersLegend.ts"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport { usePluginTranslations } from '../../sdk/messages'\r\nimport { useMarkers } from '../markers'\r\n\r\nimport type { LegendRow } from '../../sdk/types'\r\n\r\n/**\r\n * One row per marker, live as they are added, renamed and recoloured. Every marker gets a row;\r\n * the host's card caps its body at 40vh and scrolls.\r\n */\r\nexport function useMarkersLegend(): { active: boolean; title?: string; rows: LegendRow[] } {\r\n const t = usePluginTranslations()\r\n const { markers } = useMarkers()\r\n\r\n const rows: LegendRow[] = markers.map(marker => ({\r\n label: marker.name,\r\n color: marker.colour,\r\n }))\r\n\r\n return {\r\n active: rows.length > 0,\r\n title: t('legendTitle', 'Markers'),\r\n rows,\r\n }\r\n}\r\n"],"mappings":";AAKA,SAAS,6BAA6B;AACtC,SAAS,kBAAkB;AAQpB,SAAS,mBAA2E;AACzF,QAAM,IAAI,sBAAsB;AAChC,QAAM,EAAE,QAAQ,IAAI,WAAW;AAE/B,QAAM,OAAoB,QAAQ,IAAI,aAAW;AAAA,IAC/C,OAAO,OAAO;AAAA,IACd,OAAO,OAAO;AAAA,EAChB,EAAE;AAEF,SAAO;AAAA,IACL,QAAQ,KAAK,SAAS;AAAA,IACtB,OAAO,EAAE,eAAe,SAAS;AAAA,IACjC;AAAA,EACF;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"MarkersPage.d.ts","sourceRoot":"","sources":["../../../../../src/core/plugins/hello-map/components/MarkersPage.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAExC,0EAA0E;AAC1E,wBAAgB,aAAa,IAAI,YAAY,CAAC,MAAM,CAAC,CAapD;AAGD,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,MAAM,CAAC,EAgBjD,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/core/plugins/hello-map/components/MarkersPage.tsx"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport { usePluginDialogs } from '../../sdk/ui'\r\nimport { useMarkers } from '../markers'\r\n\r\nimport type { DataPageColumn, DataPageRows } from '../../sdk/types'\r\nimport type { Marker } from '../markers'\r\n\r\n/** Rows and the click handler both need hooks, so both come from here. */\r\nexport function useMarkerRows(): DataPageRows<Marker> {\r\n const { markers, isLoading, select, open } = useMarkers()\r\n const { open: openDialog } = usePluginDialogs()\r\n\r\n return {\r\n rows: markers,\r\n isLoading,\r\n onRowClick: (row) => {\r\n select(row.key)\r\n open(row.key)\r\n openDialog('detail', { markerKey: row.key })\r\n },\r\n }\r\n}\r\n\r\n// `labelKey` falls back to the literal, so this reads before any translation exists.\r\nexport const markerColumns: DataPageColumn<Marker>[] = [\r\n {\r\n key: 'colour',\r\n labelKey: 'colour',\r\n render: row => (\r\n <span\r\n aria-label={row.colour}\r\n className=\"inline-block h-3 w-3 rounded-full border border-white\"\r\n style={{ backgroundColor: row.colour }}\r\n />\r\n ),\r\n },\r\n { key: 'name', labelKey: 'columnName' },\r\n { key: 'latitude', labelKey: 'columnLatitude', render: row => row.latitude.toFixed(5) },\r\n { key: 'longitude', labelKey: 'columnLongitude', render: row => row.longitude.toFixed(5) },\r\n { key: 'zoom', labelKey: 'zoom', render: row => row.zoom.toFixed(2) },\r\n]\r\n"],"mappings":";AAiCM;AA5BN,SAAS,wBAAwB;AACjC,SAAS,kBAAkB;AAMpB,SAAS,gBAAsC;AACpD,QAAM,EAAE,SAAS,WAAW,QAAQ,KAAK,IAAI,WAAW;AACxD,QAAM,EAAE,MAAM,WAAW,IAAI,iBAAiB;AAE9C,SAAO;AAAA,IACL,MAAM;AAAA,IACN;AAAA,IACA,YAAY,CAAC,QAAQ;AACnB,aAAO,IAAI,GAAG;AACd,WAAK,IAAI,GAAG;AACZ,iBAAW,UAAU,EAAE,WAAW,IAAI,IAAI,CAAC;AAAA,IAC7C;AAAA,EACF;AACF;AAGO,MAAM,gBAA0C;AAAA,EACrD;AAAA,IACE,KAAK;AAAA,IACL,UAAU;AAAA,IACV,QAAQ,SACN;AAAA,MAAC;AAAA;AAAA,QACC,cAAY,IAAI;AAAA,QAChB,WAAU;AAAA,QACV,OAAO,EAAE,iBAAiB,IAAI,OAAO;AAAA;AAAA,IACvC;AAAA,EAEJ;AAAA,EACA,EAAE,KAAK,QAAQ,UAAU,aAAa;AAAA,EACtC,EAAE,KAAK,YAAY,UAAU,kBAAkB,QAAQ,SAAO,IAAI,SAAS,QAAQ,CAAC,EAAE;AAAA,EACtF,EAAE,KAAK,aAAa,UAAU,mBAAmB,QAAQ,SAAO,IAAI,UAAU,QAAQ,CAAC,EAAE;AAAA,EACzF,EAAE,KAAK,QAAQ,UAAU,QAAQ,QAAQ,SAAO,IAAI,KAAK,QAAQ,CAAC,EAAE;AACtE;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"MarkersTab.d.ts","sourceRoot":"","sources":["../../../../../src/core/plugins/hello-map/components/MarkersTab.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AA4I9B,2EAA2E;AAC3E,wBAAgB,UAAU,sBAoJzB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/core/plugins/hello-map/components/MarkersTab.tsx"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport * as React from 'react'\r\n\r\nimport { MAP_COLOUR_PALETTE } from '../../sdk'\r\nimport { Button, Input, Separator } from '../../sdk/components'\r\nimport { useMapViewer } from '../../sdk/mapViewer'\r\nimport { usePluginTranslations } from '../../sdk/messages'\r\nimport { useMarkers } from '../markers'\r\n\r\n/** How many palette entries to offer as swatches before the free colour input. */\r\nconst SWATCHES = 8\r\n\r\n/**\r\n * The name, saved only when confirmed. Not on blur: with a confirm button, blurring to reach\r\n * it would save first, and blurring elsewhere would commit an unconfirmed edit.\r\n */\r\nfunction NameField({\r\n name,\r\n label,\r\n saveLabel,\r\n revertLabel,\r\n onCommit,\r\n}: {\r\n name: string\r\n label: string\r\n saveLabel: string\r\n revertLabel: string\r\n onCommit: (name: string) => void\r\n}) {\r\n const [draft, setDraft] = React.useState(name)\r\n const inputId = React.useId()\r\n\r\n const trimmed = draft.trim()\r\n const canSave = trimmed.length > 0 && trimmed !== name\r\n\r\n const commit = () => {\r\n if (!canSave) return\r\n onCommit(trimmed)\r\n }\r\n\r\n return (\r\n <div className=\"flex flex-col gap-1\">\r\n <label className=\"text-xs font-medium\" htmlFor={inputId}>{label}</label>\r\n\r\n {/* Laid out like the app's other inline text edits (see the comment editor): the field\r\n takes the row, then a confirm and a revert, both h-8 w-8 icon buttons. */}\r\n <div className=\"flex items-center gap-1\">\r\n <Input\r\n id={inputId}\r\n value={draft}\r\n onChange={event => setDraft(event.target.value)}\r\n onKeyDown={(event) => {\r\n if (event.key === 'Enter') { event.preventDefault(); commit() }\r\n if (event.key === 'Escape') setDraft(name)\r\n }}\r\n className=\"h-8 flex-1\"\r\n />\r\n\r\n <Button\r\n size=\"icon\"\r\n className=\"h-8 w-8 shrink-0 p-0\"\r\n disabled={!canSave}\r\n aria-label={saveLabel}\r\n title={saveLabel}\r\n onClick={commit}\r\n >\r\n <CheckIcon />\r\n </Button>\r\n\r\n <Button\r\n size=\"icon\"\r\n variant=\"ghost\"\r\n className=\"h-8 w-8 shrink-0 p-0\"\r\n disabled={!canSave}\r\n aria-label={revertLabel}\r\n title={revertLabel}\r\n onClick={() => setDraft(name)}\r\n >\r\n <XIcon />\r\n </Button>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\n// Drawn here: `lucide-react` is unshimmed, so a plugin cannot import it.\r\nfunction Glyph({ children }: { children: React.ReactNode }) {\r\n return (\r\n <svg\r\n viewBox=\"0 0 24 24\"\r\n className=\"h-4 w-4\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n aria-hidden=\"true\"\r\n >\r\n {children}\r\n </svg>\r\n )\r\n}\r\n\r\nfunction CheckIcon() {\r\n return <Glyph><path d=\"M20 6 9 17l-5-5\" /></Glyph>\r\n}\r\n\r\nfunction XIcon() {\r\n return <Glyph><path d=\"M18 6 6 18\" /><path d=\"m6 6 12 12\" /></Glyph>\r\n}\r\n\r\n/** Smaller than the button glyphs — it sits inside a 24px swatch, not a 32px button. */\r\nfunction PlusIcon() {\r\n return (\r\n <svg\r\n viewBox=\"0 0 24 24\"\r\n className=\"h-3 w-3\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n strokeWidth=\"2.5\"\r\n strokeLinecap=\"round\"\r\n aria-hidden=\"true\"\r\n >\r\n <path d=\"M5 12h14\" />\r\n <path d=\"M12 5v14\" />\r\n </svg>\r\n )\r\n}\r\n\r\n/** Traces lucide's `map-pin-plus`, the same icon the toolbar registration names. */\r\nfunction MarkerPlusIcon() {\r\n return (\r\n <Glyph>\r\n <path d=\"M19.914 11.105A7.298 7.298 0 0 0 20 10a8 8 0 0 0-16 0c0 4.993 5.539 10.193 7.399 11.799a1 1 0 0 0 1.202 0 32 32 0 0 0 .824-.738\" />\r\n <circle cx=\"12\" cy=\"10\" r=\"3\" />\r\n <path d=\"M16 18h6\" />\r\n <path d=\"M19 15v6\" />\r\n </Glyph>\r\n )\r\n}\r\n\r\n/** The markers in the viewer sidebar, in the map and BIM viewers alike. */\r\nexport function MarkersTab() {\r\n const t = usePluginTranslations()\r\n const { map } = useMapViewer()\r\n const {\r\n markers, isLoading, lastError, selected,\r\n select, open, add, setColour, rename, remove,\r\n } = useMarkers()\r\n\r\n const addHere = async () => {\r\n if (!map) return\r\n const centre = map.getCenter()\r\n await add(centre.lat, centre.lng, map.getZoom())\r\n }\r\n\r\n /** Back to exactly the view the marker was recorded at, zoom included. */\r\n const flyTo = () => {\r\n if (!map || !selected) return\r\n\r\n map.flyTo({ center: [selected.longitude, selected.latitude], zoom: selected.zoom })\r\n open(selected.key)\r\n }\r\n\r\n if (isLoading && markers.length === 0) {\r\n return <p className=\"p-4 text-sm text-muted-foreground\">{t('loading', 'Loading…')}</p>\r\n }\r\n\r\n return (\r\n <div className=\"flex flex-col gap-3 p-4\">\r\n <Button\r\n size=\"sm\"\r\n variant=\"outline\"\r\n className=\"gap-2\"\r\n disabled={!map}\r\n onClick={() => { void addHere() }}\r\n >\r\n <MarkerPlusIcon />\r\n {t('addHere', 'Add a marker at the map centre')}\r\n </Button>\r\n\r\n {!map && (\r\n <p className=\"text-xs text-muted-foreground\">\r\n {t('mapOnly', 'Switch to the map to add a marker.')}\r\n </p>\r\n )}\r\n\r\n {lastError && (\r\n <p className=\"rounded-md bg-destructive/10 px-2 py-1 text-xs text-destructive\">\r\n {t('saveFailed', 'Could not save: ')}{lastError}\r\n </p>\r\n )}\r\n\r\n {markers.length === 0 ? (\r\n <p className=\"text-sm text-muted-foreground\">\r\n {t('empty', 'No markers yet. Record one from the map toolbar.')}\r\n </p>\r\n ) : (\r\n <ul className=\"flex flex-col gap-1\">\r\n {markers.map(marker => (\r\n <li key={marker.key}>\r\n <button\r\n type=\"button\"\r\n onClick={() => { select(marker.key); open(marker.key) }}\r\n className={`flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm ${\r\n selected?.key === marker.key ? 'bg-accent' : 'hover:bg-accent/50'\r\n }`}\r\n >\r\n <span\r\n aria-hidden=\"true\"\r\n className=\"inline-block h-3 w-3 shrink-0 rounded-full border border-white\"\r\n style={{ backgroundColor: marker.colour }}\r\n />\r\n <span className=\"flex-1 truncate\">{marker.name}</span>\r\n <span className=\"tabular-nums text-xs text-muted-foreground\">\r\n {marker.latitude.toFixed(2)}, {marker.longitude.toFixed(2)}\r\n </span>\r\n </button>\r\n </li>\r\n ))}\r\n </ul>\r\n )}\r\n\r\n {selected && (\r\n <>\r\n <Separator />\r\n\r\n <NameField\r\n key={selected.key}\r\n name={selected.name}\r\n label={t('nameLabel', 'Name')}\r\n saveLabel={t('saveName', 'Save name')}\r\n revertLabel={t('revertName', 'Discard the change')}\r\n onCommit={name => { void rename(selected.key, name) }}\r\n />\r\n\r\n <Button size=\"sm\" variant=\"outline\" disabled={!map} onClick={flyTo}>\r\n {t('flyTo', 'Fly to on the map')}\r\n </Button>\r\n\r\n <div className=\"flex flex-col gap-2\">\r\n <p className=\"text-xs font-medium\">{t('colour', 'Colour')}</p>\r\n\r\n <div className=\"flex flex-wrap items-center gap-1\">\r\n {MAP_COLOUR_PALETTE.slice(0, SWATCHES).map(colour => (\r\n <button\r\n key={colour}\r\n type=\"button\"\r\n aria-label={colour}\r\n aria-pressed={selected.colour === colour}\r\n onClick={() => { void setColour(selected.key, colour) }}\r\n className={`h-6 w-6 rounded-full border-2 ${\r\n selected.colour === colour ? 'border-foreground' : 'border-transparent'\r\n }`}\r\n style={{ backgroundColor: colour }}\r\n />\r\n ))}\r\n\r\n {/* Last in the row, set apart by a border and a margin: the palette is the\r\n default, not a limit. A plus rather than a swatch — a swatch of the current\r\n colour was indistinguishable from the presets beside it. The native input\r\n cannot be made round reliably across browsers, so it sits invisible on top. */}\r\n <label\r\n title={t('customColour', 'Pick any colour')}\r\n className=\"relative ml-1 flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-full border border-input bg-background text-muted-foreground hover:text-foreground\"\r\n >\r\n <PlusIcon />\r\n <input\r\n type=\"color\"\r\n value={selected.colour}\r\n onChange={event => { void setColour(selected.key, event.target.value) }}\r\n className=\"absolute inset-0 h-full w-full cursor-pointer opacity-0\"\r\n />\r\n <span className=\"sr-only\">{t('customColour', 'Pick any colour')}</span>\r\n </label>\r\n </div>\r\n </div>\r\n\r\n <Button\r\n size=\"sm\"\r\n variant=\"ghost\"\r\n className=\"self-start\"\r\n onClick={() => { void remove(selected.key) }}\r\n >\r\n {t('delete', 'Delete')}\r\n </Button>\r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c,SAAS,WAAW;AAAA,cAClC,SAAS,MAAM;AAAE,qBAAK,UAAU,SAAS,KAAK,MAAM;AAAA,cAAE;AAAA,cACtD,WAAW,iCACT,SAAS,WAAW,SAAS,sBAAsB,oBACrD;AAAA,cACA,OAAO,EAAE,iBAAiB,OAAO;AAAA;AAAA,YAR5B;AAAA,UASP,CACD;AAAA,UAMD;AAAA,YAAC;AAAA;AAAA,cACC,OAAO,EAAE,gBAAgB,iBAAiB;AAAA,cAC1C,WAAU;AAAA,cAEV;AAAA,oCAAC,YAAS;AAAA,gBACV;AAAA,kBAAC;AAAA;AAAA,oBACC,MAAK;AAAA,oBACL,OAAO,SAAS;AAAA,oBAChB,UAAU,WAAS;AAAE,2BAAK,UAAU,SAAS,KAAK,MAAM,OAAO,KAAK;AAAA,oBAAE;AAAA,oBACtE,WAAU;AAAA;AAAA,gBACZ;AAAA,gBACA,oBAAC,UAAK,WAAU,WAAW,YAAE,gBAAgB,iBAAiB,GAAE;AAAA;AAAA;AAAA,UAClE;AAAA,WACF;AAAA,SACF;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAQ;AAAA,UACR,WAAU;AAAA,UACV,SAAS,MAAM;AAAE,iBAAK,OAAO,SAAS,GAAG;AAAA,UAAE;AAAA,UAE1C,YAAE,UAAU,QAAQ;AAAA;AAAA,MACvB;AAAA,OACF;AAAA,KAEJ;AAEJ;","names":[]}
@@ -1,7 +0,0 @@
1
- import type { PluginContext } from '../sdk/types';
2
- /**
3
- * Six surfaces over one store and one selection, in React subtrees with no common ancestor.
4
- * Without that shared state this would be six unrelated widgets in one bundle.
5
- */
6
- export declare function activate(ctx: PluginContext): void;
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/plugins/hello-map/index.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAgDjD"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/core/plugins/hello-map/index.ts"],"sourcesContent":["// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport { ViewerNames } from '../sdk/types'\r\n\r\nimport { MapTool } from './components/MapTool'\r\nimport { MarkerDialog } from './components/MarkerDialog'\r\nimport { MarkersLayer } from './components/MarkersLayer'\r\nimport { useMarkersLegend } from './components/MarkersLegend'\r\nimport { markerColumns, useMarkerRows } from './components/MarkersPage'\r\nimport { MarkersTab } from './components/MarkersTab'\r\n\r\nimport type { PluginContext } from '../sdk/types'\r\n\r\n/**\r\n * Six surfaces over one store and one selection, in React subtrees with no common ancestor.\r\n * Without that shared state this would be six unrelated widgets in one bundle.\r\n */\r\nexport function activate(ctx: PluginContext): void {\r\n ctx.register('map.tools', {\r\n id: 'hello-map',\r\n label: 'Hello Map',\r\n icon: 'MapPinPlus',\r\n component: MapTool,\r\n stayActive: true,\r\n })\r\n\r\n // Separate from the tool, whose panel unmounts when its dropdown closes.\r\n ctx.register('map.layers', {\r\n id: 'markers',\r\n component: MarkersLayer,\r\n })\r\n\r\n ctx.register('viewer.legends', {\r\n id: 'markers',\r\n title: 'Markers',\r\n // Map only: a list of map markers means nothing in BIM.\r\n viewers: [ViewerNames.map],\r\n useLegend: useMarkersLegend,\r\n })\r\n\r\n ctx.register('viewer.tabs', {\r\n id: 'markers',\r\n labelKey: 'tabTitle',\r\n icon: 'MapPin',\r\n // Recorded on the map, read in BIM; the point cloud has nothing to do with it.\r\n viewers: [ViewerNames.map, ViewerNames.bim],\r\n component: MarkersTab,\r\n })\r\n\r\n ctx.register('data.pages', {\r\n id: 'markers',\r\n titleKey: 'pageTitle',\r\n icon: 'MapPinned',\r\n useRows: useMarkerRows,\r\n columns: markerColumns,\r\n emptyKey: 'empty',\r\n searchKeys: ['name'],\r\n })\r\n\r\n ctx.register('ui.dialogs', {\r\n id: 'detail',\r\n titleKey: 'dialogTitle',\r\n size: 'md',\r\n component: MarkerDialog,\r\n })\r\n}\r\n"],"mappings":"AAGA,SAAS,mBAAmB;AAE5B,SAAS,eAAe;AACxB,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,eAAe,qBAAqB;AAC7C,SAAS,kBAAkB;AAQpB,SAAS,SAAS,KAA0B;AACjD,MAAI,SAAS,aAAa;AAAA,IACxB,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,WAAW;AAAA,IACX,YAAY;AAAA,EACd,CAAC;AAGD,MAAI,SAAS,cAAc;AAAA,IACzB,IAAI;AAAA,IACJ,WAAW;AAAA,EACb,CAAC;AAED,MAAI,SAAS,kBAAkB;AAAA,IAC7B,IAAI;AAAA,IACJ,OAAO;AAAA;AAAA,IAEP,SAAS,CAAC,YAAY,GAAG;AAAA,IACzB,WAAW;AAAA,EACb,CAAC;AAED,MAAI,SAAS,eAAe;AAAA,IAC1B,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA;AAAA,IAEN,SAAS,CAAC,YAAY,KAAK,YAAY,GAAG;AAAA,IAC1C,WAAW;AAAA,EACb,CAAC;AAED,MAAI,SAAS,cAAc;AAAA,IACzB,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,UAAU;AAAA,IACV,YAAY,CAAC,MAAM;AAAA,EACrB,CAAC;AAED,MAAI,SAAS,cAAc;AAAA,IACzB,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,WAAW;AAAA,EACb,CAAC;AACH;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"markers.d.ts","sourceRoot":"","sources":["../../../../src/core/plugins/hello-map/markers.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,UAAW,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACzD,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,MAAO,SAAQ,UAAU;IACxC,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,oGAAoG;AACpG,eAAO,MAAM,YAAY,KAAK,CAAA;AAY9B;;;GAGG;AACH,wBAAgB,UAAU;;;IAmGtB,0EAA0E;;;;;;oBA3DzD,MAAM,aAAa,MAAM,QAAQ,MAAM;qBA8BlD,MAAM,UAAU,MAAM;kBAKhB,MAAM,QAAQ,MAAM;kBAWpB,MAAM;EAwBrB"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../src/core/plugins/hello-map/markers.ts"],"sourcesContent":["'use client'\r\n\r\n// SPDX-License-Identifier: AGPL-3.0-or-later\r\n// Copyright (C) 2025 Collab Digital Twins\r\n\r\nimport * as React from 'react'\r\n\r\nimport { stringToColour } from '../sdk'\r\nimport { usePluginState } from '../sdk/state'\r\nimport { usePluginStore } from '../sdk/store'\r\n\r\nexport interface MarkerData extends Record<string, unknown> {\r\n name: string\r\n latitude: number\r\n longitude: number\r\n /** The zoom the marker was recorded at, so flying back restores the same view. */\r\n zoom: number\r\n colour: string\r\n}\r\n\r\nexport interface Marker extends MarkerData {\r\n key: string\r\n}\r\n\r\n/** Used when a record was written before `zoom` existed — `T` is a declaration, not a guarantee. */\r\nexport const DEFAULT_ZOOM = 15\r\n\r\n/** One edit path, so a field added to `MarkerData` cannot be dropped by a rename. */\r\nfunction toData({ key: _key, ...data }: Marker): MarkerData {\r\n return data\r\n}\r\n\r\n/** Unique without a counter to keep, so two quick clicks cannot collide. */\r\nfunction nextKey(): string {\r\n return `m-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 7)}`\r\n}\r\n\r\n/**\r\n * Everything every surface reads. Markers are records, so they survive a reload; the selection\r\n * and the open popup are session state, so they do not belong in the database.\r\n */\r\nexport function useMarkers() {\r\n const store = usePluginStore<MarkerData>('markers')\r\n const [selectedKey, setSelectedKey] = usePluginState<string | null>('selected', null)\r\n const [openKey, setOpenKey] = usePluginState<string | null>('open', null)\r\n // Every write goes through `attempt`, or a rejected save looks like a dead button.\r\n const [lastError, setLastError] = usePluginState<string | null>('lastError', null)\r\n\r\n const attempt = React.useCallback(\r\n async (action: () => Promise<void>) => {\r\n try {\r\n await action()\r\n setLastError(null)\r\n return true\r\n }\r\n catch (error) {\r\n const message = error instanceof Error ? error.message : String(error)\r\n console.error('[hello-map] save failed:', error)\r\n setLastError(message)\r\n return false\r\n }\r\n },\r\n [setLastError],\r\n )\r\n\r\n const markers = React.useMemo<Marker[]>(\r\n () => store.items.map(item => ({\r\n key: item.key,\r\n ...item.data,\r\n // Records written before `zoom` existed have none, and flyTo would get NaN.\r\n zoom: typeof item.data.zoom === 'number' ? item.data.zoom : DEFAULT_ZOOM,\r\n })),\r\n [store.items],\r\n )\r\n\r\n const byKey = React.useMemo(\r\n () => new Map(markers.map(marker => [marker.key, marker])),\r\n [markers],\r\n )\r\n\r\n const add = React.useCallback(\r\n async (latitude: number, longitude: number, zoom: number) => {\r\n const key = nextKey()\r\n\r\n // A palette colour, so a page of markers stays readable and colourblind-safe.\r\n const saved = await attempt(() => store.put(key, {\r\n name: `Marker ${store.items.length + 1}`,\r\n latitude,\r\n longitude,\r\n zoom,\r\n colour: stringToColour(key),\r\n }))\r\n\r\n if (saved) setSelectedKey(key)\r\n return saved ? key : null\r\n },\r\n [store, setSelectedKey, attempt],\r\n )\r\n\r\n /** One edit path, so a field added to `MarkerData` cannot be dropped by a rename. */\r\n const patch = React.useCallback(\r\n async (key: string, changes: Partial<MarkerData>) => {\r\n const current = byKey.get(key)\r\n if (!current) return\r\n\r\n await attempt(() => store.put(key, { ...toData(current), ...changes }))\r\n },\r\n [store, byKey, attempt],\r\n )\r\n\r\n const setColour = React.useCallback(\r\n (key: string, colour: string) => patch(key, { colour }),\r\n [patch],\r\n )\r\n\r\n const rename = React.useCallback(\r\n async (key: string, name: string) => {\r\n const trimmed = name.trim()\r\n // An empty name would leave an unlabelled row and legend entry.\r\n if (!trimmed || trimmed === byKey.get(key)?.name) return\r\n\r\n await patch(key, { name: trimmed })\r\n },\r\n [patch, byKey],\r\n )\r\n\r\n const remove = React.useCallback(\r\n async (key: string) => {\r\n const removed = await attempt(() => store.remove(key))\r\n if (!removed) return\r\n\r\n setSelectedKey(current => (current === key ? null : current))\r\n setOpenKey(current => (current === key ? null : current))\r\n },\r\n [store, setSelectedKey, setOpenKey, attempt],\r\n )\r\n\r\n return {\r\n markers,\r\n isLoading: store.isLoading,\r\n /** The last write that failed, or null. Shown by the tool and the tab. */\r\n lastError,\r\n selected: selectedKey === null ? null : byKey.get(selectedKey) ?? null,\r\n openMarker: openKey === null ? null : byKey.get(openKey) ?? null,\r\n select: setSelectedKey,\r\n open: setOpenKey,\r\n add,\r\n setColour,\r\n rename,\r\n remove,\r\n }\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,YAAY,WAAW;AAEvB,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAC/B,SAAS,sBAAsB;AAgBxB,MAAM,eAAe;AAG5B,SAAS,OAAO,IAA4C;AAA5C,eAAE,OAAK,KA5BvB,IA4BgB,IAAgB,iBAAhB,IAAgB,CAAd;AAChB,SAAO;AACT;AAGA,SAAS,UAAkB;AACzB,SAAO,KAAK,KAAK,IAAI,EAAE,SAAS,EAAE,CAAC,IAAI,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC;AAC/E;AAMO,SAAS,aAAa;AAzC7B;AA0CE,QAAM,QAAQ,eAA2B,SAAS;AAClD,QAAM,CAAC,aAAa,cAAc,IAAI,eAA8B,YAAY,I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