@ifc-lite/viewer 1.29.0 → 1.30.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 (80) hide show
  1. package/.turbo/turbo-build.log +32 -31
  2. package/CHANGELOG.md +58 -0
  3. package/dist/assets/{basketViewActivator-BSRgF1Hw.js → basketViewActivator-BHNb23Vw.js} +6 -6
  4. package/dist/assets/{bcf-3uE1MvcT.js → bcf-C0XZ2DSl.js} +1 -1
  5. package/dist/assets/{deflate-BLlUfw9-.js → deflate-DvvFcUtV.js} +1 -1
  6. package/dist/assets/{exporters-BL6UmxRa.js → exporters-CvORJOLn.js} +1345 -1434
  7. package/dist/assets/geometry.worker-B7X9DQQY.js +1 -0
  8. package/dist/assets/{geotiff-BydcIud8.js → geotiff-fSD_sVw_.js} +10 -10
  9. package/dist/assets/{ids-DFl74rTt.js → ids-BUOe5QQl.js} +951 -713
  10. package/dist/assets/idsValidation.worker-DEodXb0f.js +190468 -0
  11. package/dist/assets/ifc-lite_bg-CmMuB1zf.wasm +0 -0
  12. package/dist/assets/{index-BNTlm2lP.js → index-B6T42T86.js} +35235 -32937
  13. package/dist/assets/index-D0tqJL0X.css +1 -0
  14. package/dist/assets/{index.es-Bk4nLsyS.js → index.es-YGMensDM.js} +7 -7
  15. package/dist/assets/{jpeg-BvMO8-Tc.js → jpeg-0Sla88_N.js} +1 -1
  16. package/dist/assets/{jspdf.es.min-BZ_ed66E.js → jspdf.es.min-mnbLNj-p.js} +4 -4
  17. package/dist/assets/{lerc-CNnDpLpV.js → lerc-C7xUDHpL.js} +1 -1
  18. package/dist/assets/{lzw-DBaPrGGZ.js → lzw-CK480t0_.js} +1 -1
  19. package/dist/assets/{native-bridge-DFOoBvTg.js → native-bridge-sLWRanza.js} +1 -1
  20. package/dist/assets/{packbits-C7uyD2Bi.js → packbits-DcL4imYS.js} +1 -1
  21. package/dist/assets/parser.worker-BsGV6ml7.js +182 -0
  22. package/dist/assets/{pdf-DlqdjX9e.js → pdf-BARGfLmx.js} +8 -8
  23. package/dist/assets/raw-BMWh6mDy.js +1 -0
  24. package/dist/assets/{sandbox-0Z2NzeOJ.js → sandbox-BSiO04m8.js} +2801 -2609
  25. package/dist/assets/server-client-AlpWMVq9.js +741 -0
  26. package/dist/assets/{webimage-zN-oCabb.js → webimage-uy5DjZLk.js} +1 -1
  27. package/dist/assets/{xlsx-N2LbIR1G.js → xlsx-D02ho69_.js} +6 -6
  28. package/dist/assets/{zstd-Jk3QKIeb.js → zstd-DcR1TBwT.js} +1 -1
  29. package/dist/index.html +7 -7
  30. package/package.json +27 -32
  31. package/src/components/viewer/CesiumOverlay.tsx +195 -8
  32. package/src/components/viewer/IDSPanel.tsx +23 -7
  33. package/src/components/viewer/MainToolbar.tsx +31 -0
  34. package/src/components/viewer/SunSkyPanel.tsx +363 -0
  35. package/src/components/viewer/Viewport.tsx +49 -1
  36. package/src/components/viewer/ViewportContainer.tsx +20 -1
  37. package/src/components/viewer/useAnimationLoop.ts +19 -1
  38. package/src/disable-react-dev-perf-track.ts +38 -0
  39. package/src/hooks/has-entity-type.ts +33 -0
  40. package/src/hooks/ids/idsWorkerClient.ts +136 -0
  41. package/src/hooks/ingest/federationAlign.ts +1 -1
  42. package/src/hooks/ingest/pointCloudIngest.ts +22 -98
  43. package/src/hooks/ingest/viewerModelIngest.ts +8 -13
  44. package/src/hooks/useAlignmentLines3D.ts +5 -0
  45. package/src/hooks/useGridLines3D.ts +4 -0
  46. package/src/hooks/useIDS.ts +77 -13
  47. package/src/hooks/useIfcCache.ts +1 -1
  48. package/src/hooks/useIfcFederation.ts +1 -1
  49. package/src/hooks/useIfcServer.ts +1 -1
  50. package/src/hooks/useModelSelection.ts +1 -1
  51. package/src/hooks/useSolarEnvironment.ts +114 -0
  52. package/src/hooks/useSolarSweep.ts +66 -0
  53. package/src/hooks/useSymbolicAnnotations.ts +10 -0
  54. package/src/hooks/useViewerSelectors.ts +1 -1
  55. package/src/lib/geo/cesium-sun.ts +277 -0
  56. package/src/lib/geo/solar-direction.test.ts +70 -0
  57. package/src/lib/geo/solar-direction.ts +94 -0
  58. package/src/lib/lighting-presets.ts +128 -0
  59. package/src/lib/recent-files.ts +4 -24
  60. package/src/lib/solar-time.ts +55 -0
  61. package/src/main.tsx +5 -0
  62. package/src/store/index.ts +8 -0
  63. package/src/store/slices/annotationsSlice.test.ts +0 -16
  64. package/src/store/slices/cesiumSlice.ts +3 -3
  65. package/src/store/slices/dataSlice.test.ts +0 -40
  66. package/src/store/slices/environmentSlice.ts +101 -0
  67. package/src/store/slices/idsSlice.ts +6 -1
  68. package/src/store/slices/selectionSlice.test.ts +0 -43
  69. package/src/store/slices/solarSlice.ts +121 -0
  70. package/src/store/slices/visibilitySlice.test.ts +15 -45
  71. package/src/utils/loadingUtils.ts +1 -1
  72. package/src/workers/idsValidation.worker.ts +98 -0
  73. package/dist/assets/geometry.worker-DVwFYHTq.js +0 -1
  74. package/dist/assets/ifc-lite_bg-FPffpFK_.wasm +0 -0
  75. package/dist/assets/index-DpoJvkdg.css +0 -1
  76. package/dist/assets/parser.worker-U_PVhLNi.js +0 -182
  77. package/dist/assets/raw-p_2cfl6T.js +0 -1
  78. package/dist/assets/server-client-DUMy2mXg.js +0 -719
  79. package/src/components/ui/context-menu.tsx +0 -174
  80. package/src/store.ts +0 -80
@@ -1,174 +0,0 @@
1
- /* This Source Code Form is subject to the terms of the Mozilla Public
2
- * License, v. 2.0. If a copy of the MPL was not distributed with this
3
- * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
-
5
- import * as React from 'react';
6
- import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
7
- import { Check, ChevronRight, Circle } from 'lucide-react';
8
- import { cn } from '@/lib/utils';
9
-
10
- const ContextMenu = ContextMenuPrimitive.Root;
11
- const ContextMenuTrigger = ContextMenuPrimitive.Trigger;
12
- const ContextMenuGroup = ContextMenuPrimitive.Group;
13
- const ContextMenuPortal = ContextMenuPrimitive.Portal;
14
- const ContextMenuSub = ContextMenuPrimitive.Sub;
15
- const ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
16
-
17
- const ContextMenuSubTrigger = React.forwardRef<
18
- React.ElementRef<typeof ContextMenuPrimitive.SubTrigger>,
19
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubTrigger> & { inset?: boolean }
20
- >(({ className, inset, children, ...props }, ref) => (
21
- <ContextMenuPrimitive.SubTrigger
22
- ref={ref}
23
- className={cn(
24
- 'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',
25
- inset && 'pl-8',
26
- className
27
- )}
28
- {...props}
29
- >
30
- {children}
31
- <ChevronRight className="ml-auto h-4 w-4" />
32
- </ContextMenuPrimitive.SubTrigger>
33
- ));
34
- ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
35
-
36
- const ContextMenuSubContent = React.forwardRef<
37
- React.ElementRef<typeof ContextMenuPrimitive.SubContent>,
38
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.SubContent>
39
- >(({ className, ...props }, ref) => (
40
- <ContextMenuPrimitive.SubContent
41
- ref={ref}
42
- className={cn(
43
- 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
44
- className
45
- )}
46
- {...props}
47
- />
48
- ));
49
- ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
50
-
51
- const ContextMenuContent = React.forwardRef<
52
- React.ElementRef<typeof ContextMenuPrimitive.Content>,
53
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Content>
54
- >(({ className, ...props }, ref) => (
55
- <ContextMenuPrimitive.Portal>
56
- <ContextMenuPrimitive.Content
57
- ref={ref}
58
- className={cn(
59
- 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
60
- className
61
- )}
62
- {...props}
63
- />
64
- </ContextMenuPrimitive.Portal>
65
- ));
66
- ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
67
-
68
- const ContextMenuItem = React.forwardRef<
69
- React.ElementRef<typeof ContextMenuPrimitive.Item>,
70
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Item> & { inset?: boolean }
71
- >(({ className, inset, ...props }, ref) => (
72
- <ContextMenuPrimitive.Item
73
- ref={ref}
74
- className={cn(
75
- 'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
76
- inset && 'pl-8',
77
- className
78
- )}
79
- {...props}
80
- />
81
- ));
82
- ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
83
-
84
- const ContextMenuCheckboxItem = React.forwardRef<
85
- React.ElementRef<typeof ContextMenuPrimitive.CheckboxItem>,
86
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.CheckboxItem>
87
- >(({ className, children, checked, ...props }, ref) => (
88
- <ContextMenuPrimitive.CheckboxItem
89
- ref={ref}
90
- className={cn(
91
- 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
92
- className
93
- )}
94
- checked={checked}
95
- {...props}
96
- >
97
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
98
- <ContextMenuPrimitive.ItemIndicator>
99
- <Check className="h-4 w-4" />
100
- </ContextMenuPrimitive.ItemIndicator>
101
- </span>
102
- {children}
103
- </ContextMenuPrimitive.CheckboxItem>
104
- ));
105
- ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
106
-
107
- const ContextMenuRadioItem = React.forwardRef<
108
- React.ElementRef<typeof ContextMenuPrimitive.RadioItem>,
109
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.RadioItem>
110
- >(({ className, children, ...props }, ref) => (
111
- <ContextMenuPrimitive.RadioItem
112
- ref={ref}
113
- className={cn(
114
- 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
115
- className
116
- )}
117
- {...props}
118
- >
119
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
120
- <ContextMenuPrimitive.ItemIndicator>
121
- <Circle className="h-2 w-2 fill-current" />
122
- </ContextMenuPrimitive.ItemIndicator>
123
- </span>
124
- {children}
125
- </ContextMenuPrimitive.RadioItem>
126
- ));
127
- ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
128
-
129
- const ContextMenuLabel = React.forwardRef<
130
- React.ElementRef<typeof ContextMenuPrimitive.Label>,
131
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Label> & { inset?: boolean }
132
- >(({ className, inset, ...props }, ref) => (
133
- <ContextMenuPrimitive.Label
134
- ref={ref}
135
- className={cn('px-2 py-1.5 text-sm font-semibold text-foreground', inset && 'pl-8', className)}
136
- {...props}
137
- />
138
- ));
139
- ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
140
-
141
- const ContextMenuSeparator = React.forwardRef<
142
- React.ElementRef<typeof ContextMenuPrimitive.Separator>,
143
- React.ComponentPropsWithoutRef<typeof ContextMenuPrimitive.Separator>
144
- >(({ className, ...props }, ref) => (
145
- <ContextMenuPrimitive.Separator
146
- ref={ref}
147
- className={cn('-mx-1 my-1 h-px bg-border', className)}
148
- {...props}
149
- />
150
- ));
151
- ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
152
-
153
- const ContextMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
154
- return <span className={cn('ml-auto text-xs tracking-widest text-muted-foreground', className)} {...props} />;
155
- };
156
- ContextMenuShortcut.displayName = 'ContextMenuShortcut';
157
-
158
- export {
159
- ContextMenu,
160
- ContextMenuTrigger,
161
- ContextMenuContent,
162
- ContextMenuItem,
163
- ContextMenuCheckboxItem,
164
- ContextMenuRadioItem,
165
- ContextMenuLabel,
166
- ContextMenuSeparator,
167
- ContextMenuShortcut,
168
- ContextMenuGroup,
169
- ContextMenuPortal,
170
- ContextMenuSub,
171
- ContextMenuSubContent,
172
- ContextMenuSubTrigger,
173
- ContextMenuRadioGroup,
174
- };
package/src/store.ts DELETED
@@ -1,80 +0,0 @@
1
- /* This Source Code Form is subject to the terms of the Mozilla Public
2
- * License, v. 2.0. If a copy of the MPL was not distributed with this
3
- * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
-
5
- /**
6
- * Re-export from modular store for backward compatibility
7
- *
8
- * The store has been refactored into domain-specific slices:
9
- * - loadingSlice: Loading, progress, error state
10
- * - selectionSlice: Entity and storey selection
11
- * - visibilitySlice: Hidden/isolated entities, type visibility
12
- * - uiSlice: Panel state, theme, mobile detection
13
- * - hoverSlice: Hover and context menu state
14
- * - cameraSlice: Camera rotation and callbacks
15
- * - sectionSlice: Section plane state
16
- * - measurementSlice: Measurements, snapping, edge lock
17
- * - dataSlice: IFC data and geometry
18
- *
19
- * See apps/viewer/src/store/ for the modular implementation.
20
- */
21
-
22
- // Re-export everything from the modular store
23
- export { getViewerStoreApi, useViewerStore } from './store/index.js';
24
- export type { ViewerState } from './store/index.js';
25
-
26
- // Re-export types for backward compatibility
27
- export type {
28
- MeasurePoint,
29
- Measurement,
30
- ActiveMeasurement,
31
- EdgeLockState,
32
- SectionPlaneAxis,
33
- SectionPlane,
34
- HoverState,
35
- ContextMenuState,
36
- SnapVisualization,
37
- TypeVisibility,
38
- CameraRotation,
39
- CameraCallbacks,
40
- // Multi-model federation types
41
- EntityRef,
42
- SchemaVersion,
43
- FederatedModel,
44
- } from './store/types.js';
45
-
46
- // Re-export utility functions for multi-model federation
47
- export { entityRefToString, stringToEntityRef, entityRefEquals, isIfcxDataStore } from './store/types.js';
48
-
49
- // Re-export single source of truth for globalId → EntityRef resolution
50
- export { resolveEntityRef } from './store/resolveEntityRef.js';
51
- export { toGlobalIdFromModels, fromGlobalIdFromModels, toGlobalIdForRef } from './store/globalId.js';
52
- export type { ForwardModelMapLike } from './store/globalId.js';
53
-
54
- // Re-export custom-section-plane geometry helper (issue #243): projects
55
- // `pickedAt` onto the live cut plane so visuals (cap basis origin, 3D
56
- // drag gizmo) follow `distance` instead of staying anchored at the
57
- // original face-pick location.
58
- export { customPlaneCenter } from './store/slices/sectionSlice.js';
59
-
60
- // Re-export last-used section mode persistence (issue #243 follow-up):
61
- // `SectionPanel` reads this on mount to restore either the user's
62
- // previous cardinal cut (axis + position + flipped) or to rearm pick
63
- // mode for first-time users / users whose last action was a face pick.
64
- export { loadLastSectionMode } from './store/slices/sectionSlice.js';
65
- export type { LastSectionMode } from './store/slices/sectionSlice.js';
66
-
67
- // Re-export Cesium placement types for backwards-compatible '@/store' imports.
68
- export type { CesiumPlacementDraft } from './store/slices/cesiumSlice.js';
69
-
70
- // Re-export Schedule (4D) types + helpers
71
- export type { ScheduleSlice, ScheduleTimeRange, GanttTimeScale } from './store/slices/scheduleSlice.js';
72
- export {
73
- computeScheduleRange,
74
- computeHiddenProductIds,
75
- computeActiveProductIds,
76
- countGeneratedTasks,
77
- taskStartEpoch,
78
- taskFinishEpoch,
79
- parseIsoDate,
80
- } from './store/slices/scheduleSlice.js';