@almadar/ui 5.110.0 → 5.112.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.
- package/dist/GameAudioProvider-CPGwD49P.d.cts +151 -0
- package/dist/GameAudioProvider-CPGwD49P.d.ts +151 -0
- package/dist/TraitProvider-YkK6tXDw.d.cts +236 -0
- package/dist/TraitProvider-YkK6tXDw.d.ts +236 -0
- package/dist/{providers/UISlotContext.d.ts → UISlotContext-C1FsU9GB.d.ts} +14 -10
- package/dist/UISlotContext-D8_SoDsD.d.cts +79 -0
- package/dist/UserContext-bziZwgFL.d.cts +278 -0
- package/dist/UserContext-bziZwgFL.d.ts +278 -0
- package/dist/avl/index.cjs +126 -29
- package/dist/avl/index.js +128 -31
- package/dist/avl-schema-parser-DKRm-nyh.d.cts +611 -0
- package/dist/avl-schema-parser-DKRm-nyh.d.ts +611 -0
- package/dist/cn-BbPvQLHt.d.cts +294 -0
- package/dist/cn-BbPvQLHt.d.ts +294 -0
- package/dist/components/index.cjs +56 -18
- package/dist/components/index.d.cts +11224 -0
- package/dist/components/index.d.ts +11224 -6
- package/dist/components/index.js +56 -18
- package/dist/{lib/themeTokens.d.ts → context/index.d.cts} +13 -4
- package/dist/context/index.d.ts +62 -9
- package/dist/{types/event-bus-types.d.ts → event-bus-types-Bl78kokd.d.cts} +7 -6
- package/dist/event-bus-types-Bl78kokd.d.ts +65 -0
- package/dist/hooks/index.d.cts +995 -0
- package/dist/hooks/index.d.ts +994 -32
- package/dist/lib/drawable/three/index.cjs +317 -178
- package/dist/lib/drawable/three/index.d.cts +1484 -0
- package/dist/lib/drawable/three/index.d.ts +1483 -38
- package/dist/lib/drawable/three/index.js +161 -22
- package/dist/lib/index.cjs +8 -0
- package/dist/lib/index.d.cts +504 -0
- package/dist/lib/index.d.ts +503 -18
- package/dist/lib/index.js +8 -1
- package/dist/locales/index.d.cts +22 -0
- package/dist/locales/index.d.ts +7 -5
- package/dist/offline-executor-aRuNznZx.d.cts +520 -0
- package/dist/offline-executor-aRuNznZx.d.ts +520 -0
- package/dist/providers/index.cjs +56 -18
- package/dist/providers/index.d.cts +428 -0
- package/dist/providers/index.d.ts +427 -26
- package/dist/providers/index.js +56 -18
- package/dist/renderer/index.cjs +1 -1
- package/dist/renderer/index.d.cts +343 -0
- package/dist/renderer/index.d.ts +337 -22
- package/dist/renderer/index.js +1 -1
- package/dist/runtime/index.cjs +126 -29
- package/dist/runtime/index.d.cts +426 -0
- package/dist/runtime/index.d.ts +421 -16
- package/dist/runtime/index.js +128 -31
- package/dist/useEventBus-CQWyAWpK.d.ts +65 -0
- package/dist/useEventBus-Ckr4wqW3.d.cts +65 -0
- package/dist/{hooks/useUISlots.d.ts → useUISlots-BesZYMks.d.cts} +16 -14
- package/dist/useUISlots-BesZYMks.d.ts +216 -0
- package/package.json +13 -13
- package/dist/avl/index.d.cts +0 -1853
- package/dist/avl/index.d.ts +0 -64
- package/dist/components/avl/atoms/Avl3DLabel.d.ts +0 -23
- package/dist/components/avl/atoms/Avl3DTooltip.d.ts +0 -25
- package/dist/components/avl/atoms/AvlApplication.d.ts +0 -8
- package/dist/components/avl/atoms/AvlBinding.d.ts +0 -12
- package/dist/components/avl/atoms/AvlBindingRef.d.ts +0 -7
- package/dist/components/avl/atoms/AvlEffect.d.ts +0 -10
- package/dist/components/avl/atoms/AvlEntity.d.ts +0 -9
- package/dist/components/avl/atoms/AvlEvent.d.ts +0 -7
- package/dist/components/avl/atoms/AvlField.d.ts +0 -10
- package/dist/components/avl/atoms/AvlFieldType.d.ts +0 -8
- package/dist/components/avl/atoms/AvlGuard.d.ts +0 -7
- package/dist/components/avl/atoms/AvlLiteral.d.ts +0 -7
- package/dist/components/avl/atoms/AvlOperator.d.ts +0 -8
- package/dist/components/avl/atoms/AvlOrbital.d.ts +0 -11
- package/dist/components/avl/atoms/AvlPage.d.ts +0 -7
- package/dist/components/avl/atoms/AvlPersistence.d.ts +0 -8
- package/dist/components/avl/atoms/AvlSExpr.d.ts +0 -8
- package/dist/components/avl/atoms/AvlState.d.ts +0 -15
- package/dist/components/avl/atoms/AvlTrait.d.ts +0 -13
- package/dist/components/avl/atoms/AvlTransition.d.ts +0 -18
- package/dist/components/avl/atoms/index.d.ts +0 -24
- package/dist/components/avl/hooks/useCanvasDnd.d.ts +0 -155
- package/dist/components/avl/lib/avl-3d-layout.d.ts +0 -116
- package/dist/components/avl/lib/avl-behavior-compose-converter.d.ts +0 -55
- package/dist/components/avl/lib/avl-elk-layout.d.ts +0 -55
- package/dist/components/avl/lib/avl-flow-converter.d.ts +0 -17
- package/dist/components/avl/lib/avl-layout.d.ts +0 -32
- package/dist/components/avl/lib/avl-preview-converter.d.ts +0 -71
- package/dist/components/avl/lib/avl-schema-parser.d.ts +0 -128
- package/dist/components/avl/lib/avl-story-schemas.d.ts +0 -34
- package/dist/components/avl/lib/avl-zoom-band.d.ts +0 -19
- package/dist/components/avl/lib/avl-zoom-state.d.ts +0 -72
- package/dist/components/avl/lib/derive-edit-focus.d.ts +0 -8
- package/dist/components/avl/lib/wire-validation.d.ts +0 -30
- package/dist/components/avl/molecules/Avl3DCrossWire.d.ts +0 -22
- package/dist/components/avl/molecules/Avl3DEntityCore.d.ts +0 -26
- package/dist/components/avl/molecules/Avl3DExprTree.d.ts +0 -21
- package/dist/components/avl/molecules/Avl3DOrbitalNode.d.ts +0 -29
- package/dist/components/avl/molecules/Avl3DStateNode.d.ts +0 -34
- package/dist/components/avl/molecules/Avl3DTransitionArc.d.ts +0 -38
- package/dist/components/avl/molecules/AvlBackwardEdge.d.ts +0 -8
- package/dist/components/avl/molecules/AvlBehaviorGlyph.d.ts +0 -61
- package/dist/components/avl/molecules/AvlBindingEdge.d.ts +0 -9
- package/dist/components/avl/molecules/AvlClosedCircuit.d.ts +0 -20
- package/dist/components/avl/molecules/AvlEmitListen.d.ts +0 -16
- package/dist/components/avl/molecules/AvlEventWireEdge.d.ts +0 -15
- package/dist/components/avl/molecules/AvlExprTree.d.ts +0 -13
- package/dist/components/avl/molecules/AvlOrbitalNode.d.ts +0 -12
- package/dist/components/avl/molecules/AvlOrbitalUnit.d.ts +0 -20
- package/dist/components/avl/molecules/AvlPageEdge.d.ts +0 -8
- package/dist/components/avl/molecules/AvlSlotMap.d.ts +0 -18
- package/dist/components/avl/molecules/AvlStateMachine.d.ts +0 -22
- package/dist/components/avl/molecules/AvlSwimLane.d.ts +0 -10
- package/dist/components/avl/molecules/AvlTransitionEdge.d.ts +0 -17
- package/dist/components/avl/molecules/AvlTransitionLane.d.ts +0 -18
- package/dist/components/avl/molecules/BehaviorComposeNode.d.ts +0 -13
- package/dist/components/avl/molecules/BehaviorView.d.ts +0 -12
- package/dist/components/avl/molecules/DetailView.d.ts +0 -13
- package/dist/components/avl/molecules/EventFlowEdge.d.ts +0 -13
- package/dist/components/avl/molecules/MiniStateMachine.d.ts +0 -14
- package/dist/components/avl/molecules/ModuleCard.d.ts +0 -22
- package/dist/components/avl/molecules/OrbPreviewNode.d.ts +0 -38
- package/dist/components/avl/molecules/SystemNode.d.ts +0 -12
- package/dist/components/avl/molecules/TraitCardNode.d.ts +0 -33
- package/dist/components/avl/molecules/index.d.ts +0 -38
- package/dist/components/avl/organisms/Avl3DApplicationScene.d.ts +0 -19
- package/dist/components/avl/organisms/Avl3DEffects.d.ts +0 -18
- package/dist/components/avl/organisms/Avl3DOrbitalScene.d.ts +0 -23
- package/dist/components/avl/organisms/Avl3DTraitScene.d.ts +0 -19
- package/dist/components/avl/organisms/Avl3DTransitionScene.d.ts +0 -17
- package/dist/components/avl/organisms/Avl3DViewer.d.ts +0 -40
- package/dist/components/avl/organisms/AvlClickTarget.d.ts +0 -31
- package/dist/components/avl/organisms/AvlCosmicZoom.d.ts +0 -41
- package/dist/components/avl/organisms/AvlLegend.d.ts +0 -15
- package/dist/components/avl/organisms/AvlOrbitalsCosmicZoom.d.ts +0 -54
- package/dist/components/avl/organisms/AvlTraitScene.d.ts +0 -17
- package/dist/components/avl/organisms/AvlTransitionDetail.d.ts +0 -20
- package/dist/components/avl/organisms/AvlTransitionScene.d.ts +0 -13
- package/dist/components/avl/organisms/FlowCanvas.d.ts +0 -134
- package/dist/components/avl/organisms/OrbInspector.d.ts +0 -45
- package/dist/components/avl/organisms/ZoomBreadcrumb.d.ts +0 -16
- package/dist/components/avl/organisms/ZoomLegend.d.ts +0 -10
- package/dist/components/avl/organisms/index.d.ts +0 -19
- package/dist/components/avl/providers/avl-3d-context.d.ts +0 -32
- package/dist/components/avl/types/avl-atom-types.d.ts +0 -53
- package/dist/components/avl/types/avl-behavior-compose-types.d.ts +0 -120
- package/dist/components/avl/types/avl-canvas-types.d.ts +0 -39
- package/dist/components/avl/types/avl-preview-types.d.ts +0 -240
- package/dist/components/core/atoms/Aside.d.ts +0 -15
- package/dist/components/core/atoms/AtlasImage.d.ts +0 -58
- package/dist/components/core/atoms/Avatar.d.ts +0 -61
- package/dist/components/core/atoms/Badge.d.ts +0 -29
- package/dist/components/core/atoms/Box.d.ts +0 -68
- package/dist/components/core/atoms/Button.d.ts +0 -33
- package/dist/components/core/atoms/Card.d.ts +0 -34
- package/dist/components/core/atoms/Center.d.ts +0 -33
- package/dist/components/core/atoms/Checkbox.d.ts +0 -14
- package/dist/components/core/atoms/ConditionalWrapper.d.ts +0 -69
- package/dist/components/core/atoms/ConfettiEffect.d.ts +0 -19
- package/dist/components/core/atoms/DayCell.d.ts +0 -22
- package/dist/components/core/atoms/Dialog.d.ts +0 -18
- package/dist/components/core/atoms/Divider.d.ts +0 -29
- package/dist/components/core/atoms/FilterPill.d.ts +0 -30
- package/dist/components/core/atoms/FlipContainer.d.ts +0 -21
- package/dist/components/core/atoms/GameIcon.d.ts +0 -19
- package/dist/components/core/atoms/Icon.d.ts +0 -57
- package/dist/components/core/atoms/InfiniteScrollSentinel.d.ts +0 -24
- package/dist/components/core/atoms/Input.d.ts +0 -39
- package/dist/components/core/atoms/Label.d.ts +0 -12
- package/dist/components/core/atoms/LawReferenceTooltip.d.ts +0 -48
- package/dist/components/core/atoms/Overlay.d.ts +0 -17
- package/dist/components/core/atoms/ProgressBar.d.ts +0 -63
- package/dist/components/core/atoms/Radio.d.ts +0 -35
- package/dist/components/core/atoms/RangeSlider.d.ts +0 -34
- package/dist/components/core/atoms/SectionHeader.d.ts +0 -14
- package/dist/components/core/atoms/Select.d.ts +0 -49
- package/dist/components/core/atoms/Spacer.d.ts +0 -25
- package/dist/components/core/atoms/Sparkline.d.ts +0 -30
- package/dist/components/core/atoms/Spinner.d.ts +0 -10
- package/dist/components/core/atoms/Stack.d.ts +0 -67
- package/dist/components/core/atoms/StatusDot.d.ts +0 -16
- package/dist/components/core/atoms/Switch.d.ts +0 -12
- package/dist/components/core/atoms/TextHighlight.d.ts +0 -54
- package/dist/components/core/atoms/Textarea.d.ts +0 -17
- package/dist/components/core/atoms/ThemeToggle.d.ts +0 -33
- package/dist/components/core/atoms/TimeSlotCell.d.ts +0 -23
- package/dist/components/core/atoms/TraitFrame.d.ts +0 -54
- package/dist/components/core/atoms/TrendIndicator.d.ts +0 -20
- package/dist/components/core/atoms/TypewriterText.d.ts +0 -20
- package/dist/components/core/atoms/Typography.d.ts +0 -39
- package/dist/components/core/atoms/index.d.ts +0 -52
- package/dist/components/core/atoms/svg/SvgBranch.d.ts +0 -16
- package/dist/components/core/atoms/svg/SvgConnection.d.ts +0 -17
- package/dist/components/core/atoms/svg/SvgFlow.d.ts +0 -14
- package/dist/components/core/atoms/svg/SvgGrid.d.ts +0 -18
- package/dist/components/core/atoms/svg/SvgLobe.d.ts +0 -17
- package/dist/components/core/atoms/svg/SvgMesh.d.ts +0 -16
- package/dist/components/core/atoms/svg/SvgMorph.d.ts +0 -15
- package/dist/components/core/atoms/svg/SvgNode.d.ts +0 -16
- package/dist/components/core/atoms/svg/SvgPulse.d.ts +0 -16
- package/dist/components/core/atoms/svg/SvgRing.d.ts +0 -17
- package/dist/components/core/atoms/svg/SvgShield.d.ts +0 -15
- package/dist/components/core/atoms/svg/SvgStack.d.ts +0 -17
- package/dist/components/core/atoms/svg/index.d.ts +0 -12
- package/dist/components/core/atoms/types.d.ts +0 -47
- package/dist/components/core/molecules/Accordion.d.ts +0 -71
- package/dist/components/core/molecules/ActivationBlock.d.ts +0 -22
- package/dist/components/core/molecules/Alert.d.ts +0 -25
- package/dist/components/core/molecules/AnimatedCounter.d.ts +0 -18
- package/dist/components/core/molecules/AssetPicker.d.ts +0 -21
- package/dist/components/core/molecules/BloomQuizBlock.d.ts +0 -25
- package/dist/components/core/molecules/BranchingLogicBuilder.d.ts +0 -33
- package/dist/components/core/molecules/Breadcrumb.d.ts +0 -55
- package/dist/components/core/molecules/ButtonGroup.d.ts +0 -77
- package/dist/components/core/molecules/CalendarGrid.d.ts +0 -61
- package/dist/components/core/molecules/Card.d.ts +0 -58
- package/dist/components/core/molecules/Carousel.d.ts +0 -42
- package/dist/components/core/molecules/Chart.d.ts +0 -106
- package/dist/components/core/molecules/ChartLegend.d.ts +0 -20
- package/dist/components/core/molecules/Coachmark.d.ts +0 -47
- package/dist/components/core/molecules/ConfirmDialog.d.ts +0 -49
- package/dist/components/core/molecules/ConnectionBlock.d.ts +0 -18
- package/dist/components/core/molecules/Container.d.ts +0 -30
- package/dist/components/core/molecules/ContentRenderer.d.ts +0 -23
- package/dist/components/core/molecules/DataGrid.d.ts +0 -117
- package/dist/components/core/molecules/DataList.d.ts +0 -129
- package/dist/components/core/molecules/DateRangePicker.d.ts +0 -56
- package/dist/components/core/molecules/DateRangeSelector.d.ts +0 -21
- package/dist/components/core/molecules/DocBreadcrumb.d.ts +0 -20
- package/dist/components/core/molecules/DocPagination.d.ts +0 -21
- package/dist/components/core/molecules/DocSearch.d.ts +0 -22
- package/dist/components/core/molecules/DocSidebar.d.ts +0 -24
- package/dist/components/core/molecules/DocTOC.d.ts +0 -24
- package/dist/components/core/molecules/DocumentViewer.d.ts +0 -61
- package/dist/components/core/molecules/Drawer.d.ts +0 -47
- package/dist/components/core/molecules/EdgeDecoration.d.ts +0 -36
- package/dist/components/core/molecules/EmptyState.d.ts +0 -29
- package/dist/components/core/molecules/ErrorBoundary.d.ts +0 -54
- package/dist/components/core/molecules/ErrorState.d.ts +0 -14
- package/dist/components/core/molecules/FeatureGrid.d.ts +0 -19
- package/dist/components/core/molecules/FileTree.d.ts +0 -37
- package/dist/components/core/molecules/FilterGroup.d.ts +0 -61
- package/dist/components/core/molecules/Flex.d.ts +0 -43
- package/dist/components/core/molecules/FlipCard.d.ts +0 -24
- package/dist/components/core/molecules/FloatingActionButton.d.ts +0 -83
- package/dist/components/core/molecules/FormField.d.ts +0 -16
- package/dist/components/core/molecules/FormSection.d.ts +0 -39
- package/dist/components/core/molecules/FormSectionHeader.d.ts +0 -31
- package/dist/components/core/molecules/GradientDivider.d.ts +0 -15
- package/dist/components/core/molecules/GraphCanvas.d.ts +0 -83
- package/dist/components/core/molecules/GraphView.d.ts +0 -45
- package/dist/components/core/molecules/Grid.d.ts +0 -54
- package/dist/components/core/molecules/GridPicker.d.ts +0 -44
- package/dist/components/core/molecules/Header.d.ts +0 -113
- package/dist/components/core/molecules/IconPicker.d.ts +0 -18
- package/dist/components/core/molecules/InputGroup.d.ts +0 -24
- package/dist/components/core/molecules/JazariStateMachine.d.ts +0 -34
- package/dist/components/core/molecules/JsonTreeEditor.d.ts +0 -13
- package/dist/components/core/molecules/Lightbox.d.ts +0 -26
- package/dist/components/core/molecules/LikertScale.d.ts +0 -34
- package/dist/components/core/molecules/LineChart.d.ts +0 -35
- package/dist/components/core/molecules/LoadingState.d.ts +0 -7
- package/dist/components/core/molecules/MapView.d.ts +0 -87
- package/dist/components/core/molecules/MatrixQuestion.d.ts +0 -35
- package/dist/components/core/molecules/Menu.d.ts +0 -44
- package/dist/components/core/molecules/Meter.d.ts +0 -52
- package/dist/components/core/molecules/Modal.d.ts +0 -36
- package/dist/components/core/molecules/Navigation.d.ts +0 -67
- package/dist/components/core/molecules/NodeSlotEditor.d.ts +0 -17
- package/dist/components/core/molecules/NumberStepper.d.ts +0 -28
- package/dist/components/core/molecules/OnboardingSpotlight.d.ts +0 -27
- package/dist/components/core/molecules/OptionConstraintGroup.d.ts +0 -44
- package/dist/components/core/molecules/OrbitalVisualization.d.ts +0 -48
- package/dist/components/core/molecules/PageHeader.d.ts +0 -60
- package/dist/components/core/molecules/Pagination.d.ts +0 -71
- package/dist/components/core/molecules/Popover.d.ts +0 -39
- package/dist/components/core/molecules/PositionedCanvas.d.ts +0 -40
- package/dist/components/core/molecules/ProgressDots.d.ts +0 -24
- package/dist/components/core/molecules/PropertyInspector.d.ts +0 -38
- package/dist/components/core/molecules/PullToRefresh.d.ts +0 -22
- package/dist/components/core/molecules/QrScanner.d.ts +0 -24
- package/dist/components/core/molecules/QuizBlock.d.ts +0 -20
- package/dist/components/core/molecules/ReflectionBlock.d.ts +0 -23
- package/dist/components/core/molecules/RelationSelect.d.ts +0 -48
- package/dist/components/core/molecules/RepeatableFormSection.d.ts +0 -60
- package/dist/components/core/molecules/ReplyTree.d.ts +0 -46
- package/dist/components/core/molecules/RichBlockEditor.d.ts +0 -43
- package/dist/components/core/molecules/ScaledDiagram.d.ts +0 -20
- package/dist/components/core/molecules/SearchInput.d.ts +0 -60
- package/dist/components/core/molecules/Section.d.ts +0 -43
- package/dist/components/core/molecules/SidePanel.d.ts +0 -53
- package/dist/components/core/molecules/Sidebar.d.ts +0 -72
- package/dist/components/core/molecules/SignaturePad.d.ts +0 -46
- package/dist/components/core/molecules/SimpleGrid.d.ts +0 -27
- package/dist/components/core/molecules/Skeleton.d.ts +0 -35
- package/dist/components/core/molecules/SocialProof.d.ts +0 -25
- package/dist/components/core/molecules/SortableList.d.ts +0 -19
- package/dist/components/core/molecules/Split.d.ts +0 -41
- package/dist/components/core/molecules/StarRating.d.ts +0 -27
- package/dist/components/core/molecules/StatDisplay.d.ts +0 -58
- package/dist/components/core/molecules/SwipeableRow.d.ts +0 -26
- package/dist/components/core/molecules/TableView.d.ts +0 -111
- package/dist/components/core/molecules/Tabs.d.ts +0 -60
- package/dist/components/core/molecules/TagInput.d.ts +0 -52
- package/dist/components/core/molecules/Toast.d.ts +0 -36
- package/dist/components/core/molecules/Tooltip.d.ts +0 -25
- package/dist/components/core/molecules/UploadDropZone.d.ts +0 -28
- package/dist/components/core/molecules/VersionDiff.d.ts +0 -62
- package/dist/components/core/molecules/ViolationAlert.d.ts +0 -46
- package/dist/components/core/molecules/VoteStack.d.ts +0 -35
- package/dist/components/core/molecules/WizardContainer.d.ts +0 -166
- package/dist/components/core/molecules/WizardNavigation.d.ts +0 -61
- package/dist/components/core/molecules/WizardProgress.d.ts +0 -45
- package/dist/components/core/molecules/index.d.ts +0 -138
- package/dist/components/core/molecules/lessonSegmentUtils.d.ts +0 -18
- package/dist/components/core/molecules/markdown/CodeBlock.d.ts +0 -108
- package/dist/components/core/molecules/markdown/MarkdownContent.d.ts +0 -26
- package/dist/components/core/molecules/markdown/index.d.ts +0 -2
- package/dist/components/core/molecules/parseLessonSegments.d.ts +0 -44
- package/dist/components/core/molecules/useDataDnd.d.ts +0 -63
- package/dist/components/core/organisms/CardGrid.d.ts +0 -84
- package/dist/components/core/organisms/ChatBar.d.ts +0 -31
- package/dist/components/core/organisms/CodeRunnerPanel.d.ts +0 -42
- package/dist/components/core/organisms/ComponentPatterns.d.ts +0 -185
- package/dist/components/core/organisms/CustomPattern.d.ts +0 -105
- package/dist/components/core/organisms/DataTable.d.ts +0 -79
- package/dist/components/core/organisms/DetailPanel.d.ts +0 -80
- package/dist/components/core/organisms/DrawerSlot.d.ts +0 -42
- package/dist/components/core/organisms/Form.d.ts +0 -214
- package/dist/components/core/organisms/LayoutPatterns.d.ts +0 -108
- package/dist/components/core/organisms/List.d.ts +0 -81
- package/dist/components/core/organisms/MasterDetail.d.ts +0 -35
- package/dist/components/core/organisms/MediaGallery.d.ts +0 -63
- package/dist/components/core/organisms/ModalSlot.d.ts +0 -38
- package/dist/components/core/organisms/NotifyListener.d.ts +0 -15
- package/dist/components/core/organisms/SegmentRenderer.d.ts +0 -38
- package/dist/components/core/organisms/StatCard.d.ts +0 -65
- package/dist/components/core/organisms/StateMachineView.d.ts +0 -45
- package/dist/components/core/organisms/SubagentTracePanel.d.ts +0 -50
- package/dist/components/core/organisms/Timeline.d.ts +0 -71
- package/dist/components/core/organisms/ToastSlot.d.ts +0 -41
- package/dist/components/core/organisms/UISlotRenderer.d.ts +0 -116
- package/dist/components/core/organisms/book/index.d.ts +0 -7
- package/dist/components/core/organisms/book/types.d.ts +0 -62
- package/dist/components/core/organisms/component-registry.generated.d.ts +0 -9
- package/dist/components/core/organisms/debug/RuntimeDebugger.d.ts +0 -29
- package/dist/components/core/organisms/debug/WalkMinimap.d.ts +0 -17
- package/dist/components/core/organisms/debug/hooks/useDebugData.d.ts +0 -25
- package/dist/components/core/organisms/debug/index.d.ts +0 -13
- package/dist/components/core/organisms/debug/tabs/EntitiesTab.d.ts +0 -14
- package/dist/components/core/organisms/debug/tabs/EventDispatcherTab.d.ts +0 -18
- package/dist/components/core/organisms/debug/tabs/EventFlowTab.d.ts +0 -14
- package/dist/components/core/organisms/debug/tabs/GuardsPanel.d.ts +0 -14
- package/dist/components/core/organisms/debug/tabs/ServerBridgeTab.d.ts +0 -20
- package/dist/components/core/organisms/debug/tabs/TicksTab.d.ts +0 -14
- package/dist/components/core/organisms/debug/tabs/TraitsTab.d.ts +0 -14
- package/dist/components/core/organisms/debug/tabs/TransitionTimeline.d.ts +0 -19
- package/dist/components/core/organisms/debug/tabs/VerificationTab.d.ts +0 -17
- package/dist/components/core/organisms/index.d.ts +0 -33
- package/dist/components/core/organisms/layout/DashboardGrid.d.ts +0 -33
- package/dist/components/core/organisms/layout/MasterDetailLayout.d.ts +0 -32
- package/dist/components/core/organisms/layout/SplitPane.d.ts +0 -34
- package/dist/components/core/organisms/layout/TabbedContainer.d.ts +0 -42
- package/dist/components/core/organisms/layout/index.d.ts +0 -9
- package/dist/components/core/organisms/marketing-types.d.ts +0 -8
- package/dist/components/core/organisms/trace-edit-focus.d.ts +0 -14
- package/dist/components/core/organisms/types.d.ts +0 -72
- package/dist/components/core/templates/CounterTemplate.d.ts +0 -51
- package/dist/components/core/templates/DashboardLayout.d.ts +0 -110
- package/dist/components/core/templates/GenericAppTemplate.d.ts +0 -24
- package/dist/components/core/templates/index.d.ts +0 -10
- package/dist/components/core/templates/types.d.ts +0 -35
- package/dist/components/game/atoms/ChoiceButton.d.ts +0 -29
- package/dist/components/game/atoms/ControlButton.d.ts +0 -35
- package/dist/components/game/atoms/DialogueBubble.d.ts +0 -26
- package/dist/components/game/atoms/DrawShape.d.ts +0 -50
- package/dist/components/game/atoms/DrawSprite.d.ts +0 -47
- package/dist/components/game/atoms/DrawText.d.ts +0 -31
- package/dist/components/game/atoms/GameAudioToggle.d.ts +0 -34
- package/dist/components/game/atoms/HealthBar.d.ts +0 -32
- package/dist/components/game/atoms/MiniMap.d.ts +0 -40
- package/dist/components/game/atoms/ScoreDisplay.d.ts +0 -25
- package/dist/components/game/atoms/StateIndicator.d.ts +0 -29
- package/dist/components/game/atoms/TimerDisplay.d.ts +0 -22
- package/dist/components/game/molecules/ActionPalette.d.ts +0 -34
- package/dist/components/game/molecules/ActionTile.d.ts +0 -30
- package/dist/components/game/molecules/Canvas.d.ts +0 -96
- package/dist/components/game/molecules/Canvas2D.d.ts +0 -120
- package/dist/components/game/molecules/ControlGrid.d.ts +0 -49
- package/dist/components/game/molecules/DrawShapeLayer.d.ts +0 -19
- package/dist/components/game/molecules/DrawSpriteLayer.d.ts +0 -21
- package/dist/components/game/molecules/DrawTextLayer.d.ts +0 -22
- package/dist/components/game/molecules/GameHud.d.ts +0 -52
- package/dist/components/game/molecules/GameMenu.d.ts +0 -42
- package/dist/components/game/molecules/SequenceBar.d.ts +0 -51
- package/dist/components/game/molecules/StatBadge.d.ts +0 -39
- package/dist/components/game/molecules/StateGraph.d.ts +0 -38
- package/dist/components/game/molecules/StateJsonView.d.ts +0 -37
- package/dist/components/game/molecules/StateNode.d.ts +0 -31
- package/dist/components/game/molecules/TraitSlot.d.ts +0 -99
- package/dist/components/game/molecules/TraitStateViewer.d.ts +0 -52
- package/dist/components/game/molecules/TransitionArrow.d.ts +0 -31
- package/dist/components/game/molecules/index.d.ts +0 -39
- package/dist/components/game/patterns.d.ts +0 -20
- package/dist/components/game/templates/GameShell.d.ts +0 -35
- package/dist/components/learning/atoms/LearningCanvas.d.ts +0 -80
- package/dist/components/learning/molecules/AlgorithmCanvas.d.ts +0 -58
- package/dist/components/learning/molecules/BiologyCanvas.d.ts +0 -47
- package/dist/components/learning/molecules/ChemistryCanvas.d.ts +0 -55
- package/dist/components/learning/molecules/MathCanvas.d.ts +0 -61
- package/dist/components/learning/molecules/PhysicsCanvas.d.ts +0 -54
- package/dist/components/marketing/atoms/AnimatedCounter.d.ts +0 -20
- package/dist/components/marketing/atoms/AnimatedGraphic.d.ts +0 -32
- package/dist/components/marketing/atoms/AnimatedReveal.d.ts +0 -26
- package/dist/components/marketing/atoms/ContentSection.d.ts +0 -16
- package/dist/components/marketing/atoms/MarketingStatCard.d.ts +0 -13
- package/dist/components/marketing/atoms/PatternTile.d.ts +0 -41
- package/dist/components/marketing/molecules/ArticleSection.d.ts +0 -18
- package/dist/components/marketing/molecules/CTABanner.d.ts +0 -26
- package/dist/components/marketing/molecules/CaseStudyCard.d.ts +0 -24
- package/dist/components/marketing/molecules/CommunityLinks.d.ts +0 -28
- package/dist/components/marketing/molecules/FeatureCard.d.ts +0 -26
- package/dist/components/marketing/molecules/GeometricPattern.d.ts +0 -33
- package/dist/components/marketing/molecules/HeroSection.d.ts +0 -28
- package/dist/components/marketing/molecules/InstallBox.d.ts +0 -16
- package/dist/components/marketing/molecules/MarketingFooter.d.ts +0 -29
- package/dist/components/marketing/molecules/PricingCard.d.ts +0 -19
- package/dist/components/marketing/molecules/PricingGrid.d.ts +0 -13
- package/dist/components/marketing/molecules/PullQuote.d.ts +0 -14
- package/dist/components/marketing/molecules/ServiceCatalog.d.ts +0 -19
- package/dist/components/marketing/molecules/ShowcaseCard.d.ts +0 -18
- package/dist/components/marketing/molecules/SplitSection.d.ts +0 -19
- package/dist/components/marketing/molecules/StatsGrid.d.ts +0 -18
- package/dist/components/marketing/molecules/StepFlow.d.ts +0 -21
- package/dist/components/marketing/molecules/TagCloud.d.ts +0 -18
- package/dist/components/marketing/molecules/TeamCard.d.ts +0 -19
- package/dist/components/marketing/organisms/CaseStudyOrganism.d.ts +0 -29
- package/dist/components/marketing/organisms/FeatureGridOrganism.d.ts +0 -30
- package/dist/components/marketing/organisms/HeroOrganism.d.ts +0 -42
- package/dist/components/marketing/organisms/PricingOrganism.d.ts +0 -33
- package/dist/components/marketing/organisms/ShowcaseOrganism.d.ts +0 -34
- package/dist/components/marketing/organisms/StatsOrganism.d.ts +0 -23
- package/dist/components/marketing/organisms/StepFlowOrganism.d.ts +0 -29
- package/dist/components/marketing/organisms/TeamOrganism.d.ts +0 -28
- package/dist/components/marketing/organisms/book/BookChapterView.d.ts +0 -21
- package/dist/components/marketing/organisms/book/BookCoverPage.d.ts +0 -21
- package/dist/components/marketing/organisms/book/BookNavBar.d.ts +0 -19
- package/dist/components/marketing/organisms/book/BookTableOfContents.d.ts +0 -20
- package/dist/components/marketing/organisms/book/BookViewer.d.ts +0 -31
- package/dist/components/marketing/templates/AboutPageTemplate.d.ts +0 -53
- package/dist/components/marketing/templates/AuthLayout.d.ts +0 -15
- package/dist/components/marketing/templates/FeatureDetailPageTemplate.d.ts +0 -37
- package/dist/components/marketing/templates/LandingPageTemplate.d.ts +0 -70
- package/dist/components/marketing/templates/PricingPageTemplate.d.ts +0 -44
- package/dist/hooks/useAgentChat.d.ts +0 -105
- package/dist/hooks/useAlmadarDndCollision.d.ts +0 -34
- package/dist/hooks/useAuthContext.d.ts +0 -25
- package/dist/hooks/useCamera.d.ts +0 -57
- package/dist/hooks/useCanvasGestures.d.ts +0 -44
- package/dist/hooks/useClientEffects.d.ts +0 -88
- package/dist/hooks/useCompile.d.ts +0 -18
- package/dist/hooks/useDeepAgentGeneration.d.ts +0 -46
- package/dist/hooks/useDragReorder.d.ts +0 -26
- package/dist/hooks/useDraggable.d.ts +0 -25
- package/dist/hooks/useDropZone.d.ts +0 -23
- package/dist/hooks/useEventBus.d.ts +0 -99
- package/dist/hooks/useExtensions.d.ts +0 -32
- package/dist/hooks/useFileEditor.d.ts +0 -32
- package/dist/hooks/useFileSystem.d.ts +0 -50
- package/dist/hooks/useGameAudio.d.ts +0 -47
- package/dist/hooks/useGitHub.d.ts +0 -58
- package/dist/hooks/useImageCache.d.ts +0 -16
- package/dist/hooks/useInfiniteScroll.d.ts +0 -13
- package/dist/hooks/useLongPress.d.ts +0 -16
- package/dist/hooks/useOrbitalHistory.d.ts +0 -39
- package/dist/hooks/usePreview.d.ts +0 -57
- package/dist/hooks/usePullToRefresh.d.ts +0 -25
- package/dist/hooks/useQuerySingleton.d.ts +0 -79
- package/dist/hooks/useRenderInterpolation.d.ts +0 -33
- package/dist/hooks/useResolvedSchema.d.ts +0 -45
- package/dist/hooks/useSharedEntityStore.d.ts +0 -53
- package/dist/hooks/useSwipeGesture.d.ts +0 -26
- package/dist/hooks/useTapReveal.d.ts +0 -32
- package/dist/hooks/useTraitStateMachine.d.ts +0 -136
- package/dist/hooks/useTranslate.d.ts +0 -35
- package/dist/hooks/useUIEvents.d.ts +0 -41
- package/dist/hooks/useUnitSpriteAtlas.d.ts +0 -24
- package/dist/hooks/useValidation.d.ts +0 -46
- package/dist/lib/api-client.d.ts +0 -43
- package/dist/lib/atlasSlice.d.ts +0 -58
- package/dist/lib/boardEntity.d.ts +0 -44
- package/dist/lib/client-effect-executor.d.ts +0 -57
- package/dist/lib/cn.d.ts +0 -6
- package/dist/lib/createClientEffectHandlers.d.ts +0 -42
- package/dist/lib/data-resolver.d.ts +0 -55
- package/dist/lib/debug.d.ts +0 -36
- package/dist/lib/debugRegistry.d.ts +0 -30
- package/dist/lib/debugUtils.d.ts +0 -27
- package/dist/lib/drawable/contract.d.ts +0 -68
- package/dist/lib/drawable/hitTest.d.ts +0 -23
- package/dist/lib/drawable/paintDispatch.d.ts +0 -22
- package/dist/lib/drawable/projector.d.ts +0 -14
- package/dist/lib/drawable/projector3d.d.ts +0 -20
- package/dist/lib/drawable/three/Camera3D.d.ts +0 -60
- package/dist/lib/drawable/three/Canvas3DErrorBoundary.d.ts +0 -51
- package/dist/lib/drawable/three/Canvas3DHost.d.ts +0 -178
- package/dist/lib/drawable/three/Canvas3DLoadingState.d.ts +0 -44
- package/dist/lib/drawable/three/Drawable3D.d.ts +0 -20
- package/dist/lib/drawable/three/GameCamera3D.d.ts +0 -16
- package/dist/lib/drawable/three/Lighting3D.d.ts +0 -55
- package/dist/lib/drawable/three/ModelLoader.d.ts +0 -52
- package/dist/lib/drawable/three/Scene3D.d.ts +0 -37
- package/dist/lib/drawable/three/game3dTheme.d.ts +0 -14
- package/dist/lib/drawable/three/hooks/useAssetLoader.d.ts +0 -58
- package/dist/lib/drawable/three/hooks/useGameCanvas3DEvents.d.ts +0 -124
- package/dist/lib/drawable/three/hooks/useRaycaster.d.ts +0 -86
- package/dist/lib/drawable/three/hooks/useSceneGraph.d.ts +0 -67
- package/dist/lib/drawable/three/hooks/useThree.d.ts +0 -58
- package/dist/lib/drawable/three/lib/AssetLoader.d.ts +0 -80
- package/dist/lib/drawable/three/lib/culling.d.ts +0 -134
- package/dist/lib/drawable/three/lib/grid3D.d.ts +0 -154
- package/dist/lib/drawable/three/mesh3d.d.ts +0 -28
- package/dist/lib/editorUtils.d.ts +0 -114
- package/dist/lib/embedded-traits.d.ts +0 -39
- package/dist/lib/entityDebug.d.ts +0 -39
- package/dist/lib/fn-form-lambda.d.ts +0 -27
- package/dist/lib/game.d.ts +0 -92
- package/dist/lib/gameShared.d.ts +0 -18
- package/dist/lib/getNestedValue.d.ts +0 -34
- package/dist/lib/guardRegistry.d.ts +0 -33
- package/dist/lib/iconFamily.d.ts +0 -41
- package/dist/lib/imageCache.d.ts +0 -9
- package/dist/lib/init.d.ts +0 -14
- package/dist/lib/isometric.d.ts +0 -121
- package/dist/lib/isometricTypes.d.ts +0 -141
- package/dist/lib/jazari/index.d.ts +0 -5
- package/dist/lib/jazari/layout.d.ts +0 -31
- package/dist/lib/jazari/svg-paths.d.ts +0 -61
- package/dist/lib/jazari/types.d.ts +0 -91
- package/dist/lib/makeAsset.d.ts +0 -5
- package/dist/lib/mechanics.d.ts +0 -4
- package/dist/lib/offline-executor.d.ts +0 -239
- package/dist/lib/orbitalsByTrait.d.ts +0 -34
- package/dist/lib/painter2d.d.ts +0 -81
- package/dist/lib/parseContentSegments.d.ts +0 -42
- package/dist/lib/pattern-resolver.d.ts +0 -88
- package/dist/lib/perf.d.ts +0 -32
- package/dist/lib/physicsPresets.d.ts +0 -4
- package/dist/lib/physicsTypes.d.ts +0 -43
- package/dist/lib/prepareSchemaForPreview.d.ts +0 -71
- package/dist/lib/puzzleObject.d.ts +0 -41
- package/dist/lib/slot-definitions.d.ts +0 -33
- package/dist/lib/spriteAnimation.d.ts +0 -85
- package/dist/lib/spriteAnimationTypes.d.ts +0 -72
- package/dist/lib/spriteSheetConstants.d.ts +0 -16
- package/dist/lib/tickRegistry.d.ts +0 -40
- package/dist/lib/trait-binding-resolver.d.ts +0 -57
- package/dist/lib/traitRegistry.d.ts +0 -34
- package/dist/lib/verificationRegistry.d.ts +0 -91
- package/dist/lib/visualizer/browser.d.ts +0 -48
- package/dist/lib/visualizer/index.d.ts +0 -144
- package/dist/lib/webPainter2d.d.ts +0 -7
- package/dist/lib/wrapCallbackForEvent.d.ts +0 -16
- package/dist/marketing/index.d.cts +0 -1067
- package/dist/marketing/index.d.ts +0 -72
- package/dist/providers/CurrentPagePathContext.d.ts +0 -9
- package/dist/providers/DesignThemeContext.d.ts +0 -21
- package/dist/providers/EntitySchemaContext.d.ts +0 -81
- package/dist/providers/EventBusProvider.d.ts +0 -47
- package/dist/providers/GameAudioProvider.d.ts +0 -53
- package/dist/providers/OfflineModeProvider.d.ts +0 -79
- package/dist/providers/OrbitalProvider.d.ts +0 -110
- package/dist/providers/OrbitalThemeProvider.d.ts +0 -37
- package/dist/providers/SelectionProvider.d.ts +0 -82
- package/dist/providers/ServerBridge.d.ts +0 -102
- package/dist/providers/ThemeContext.d.ts +0 -104
- package/dist/providers/TraitProvider.d.ts +0 -53
- package/dist/providers/TraitScopeProvider.d.ts +0 -43
- package/dist/providers/UserContext.d.ts +0 -112
- package/dist/providers/VerificationProvider.d.ts +0 -64
- package/dist/providers/navigation.d.ts +0 -142
- package/dist/runtime/BrowserPlayground.d.ts +0 -34
- package/dist/runtime/OrbPreview.d.ts +0 -84
- package/dist/scripts/audit-tailwind-safelist.d.ts +0 -27
- package/dist/scripts/generate-design-system.d.ts +0 -29
- package/dist/scripts/generate-theme-from-schema.d.ts +0 -10
- package/dist/scripts/generate.d.ts +0 -12
- package/dist/scripts/suggest-components.d.ts +0 -31
- package/dist/scripts/types.d.ts +0 -129
- package/dist/tsup.config.d.ts +0 -3
- package/dist/types/renderer-types.d.ts +0 -146
- package/dist/types/runtime-types.d.ts +0 -21
- package/dist/types/slot-types.d.ts +0 -49
- package/dist/vitest.config.d.ts +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React3 = require('react');
|
|
4
4
|
var providers = require('@almadar/ui/providers');
|
|
5
5
|
var logger = require('@almadar/logger');
|
|
6
6
|
var fiber = require('@react-three/fiber');
|
|
@@ -37,7 +37,7 @@ function _interopNamespace(e) {
|
|
|
37
37
|
return Object.freeze(n);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var React3__default = /*#__PURE__*/_interopDefault(React3);
|
|
41
41
|
var THREE9__namespace = /*#__PURE__*/_interopNamespace(THREE9);
|
|
42
42
|
|
|
43
43
|
var __defProp = Object.defineProperty;
|
|
@@ -117,10 +117,10 @@ var fallbackEventBus = {
|
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
119
|
function useEventBus() {
|
|
120
|
-
const context =
|
|
120
|
+
const context = React3.useContext(providers.EventBusContext);
|
|
121
121
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
122
122
|
const scope = providers.useTraitScope();
|
|
123
|
-
return
|
|
123
|
+
return React3.useMemo(() => {
|
|
124
124
|
if (!scope) {
|
|
125
125
|
return {
|
|
126
126
|
...baseBus,
|
|
@@ -156,7 +156,7 @@ function useEventBus() {
|
|
|
156
156
|
}
|
|
157
157
|
function useEmitEvent() {
|
|
158
158
|
const eventBus = useEventBus();
|
|
159
|
-
return
|
|
159
|
+
return React3.useCallback(
|
|
160
160
|
(type, payload, source) => {
|
|
161
161
|
eventBus.emit(type, payload, source);
|
|
162
162
|
},
|
|
@@ -208,9 +208,9 @@ function useGameCanvas3DEvents(options) {
|
|
|
208
208
|
onUnitAnimation
|
|
209
209
|
} = options;
|
|
210
210
|
const emit = useEmitEvent();
|
|
211
|
-
const optionsRef =
|
|
211
|
+
const optionsRef = React3.useRef(options);
|
|
212
212
|
optionsRef.current = options;
|
|
213
|
-
const handleTileClick =
|
|
213
|
+
const handleTileClick = React3.useCallback(
|
|
214
214
|
(tile, event) => {
|
|
215
215
|
if (tileClickEvent) {
|
|
216
216
|
emit(tileClickEvent, {
|
|
@@ -226,7 +226,7 @@ function useGameCanvas3DEvents(options) {
|
|
|
226
226
|
},
|
|
227
227
|
[tileClickEvent, emit]
|
|
228
228
|
);
|
|
229
|
-
const handleUnitClick =
|
|
229
|
+
const handleUnitClick = React3.useCallback(
|
|
230
230
|
(unit, event) => {
|
|
231
231
|
if (unitClickEvent) {
|
|
232
232
|
emit(unitClickEvent, {
|
|
@@ -245,7 +245,7 @@ function useGameCanvas3DEvents(options) {
|
|
|
245
245
|
},
|
|
246
246
|
[unitClickEvent, emit]
|
|
247
247
|
);
|
|
248
|
-
const handleFeatureClick =
|
|
248
|
+
const handleFeatureClick = React3.useCallback(
|
|
249
249
|
(feature, event) => {
|
|
250
250
|
if (featureClickEvent) {
|
|
251
251
|
emit(featureClickEvent, {
|
|
@@ -260,7 +260,7 @@ function useGameCanvas3DEvents(options) {
|
|
|
260
260
|
},
|
|
261
261
|
[featureClickEvent, emit]
|
|
262
262
|
);
|
|
263
|
-
const handleCanvasClick =
|
|
263
|
+
const handleCanvasClick = React3.useCallback(
|
|
264
264
|
(event) => {
|
|
265
265
|
if (canvasClickEvent) {
|
|
266
266
|
emit(canvasClickEvent, {
|
|
@@ -273,7 +273,7 @@ function useGameCanvas3DEvents(options) {
|
|
|
273
273
|
},
|
|
274
274
|
[canvasClickEvent, emit]
|
|
275
275
|
);
|
|
276
|
-
const handleTileHover =
|
|
276
|
+
const handleTileHover = React3.useCallback(
|
|
277
277
|
(tile, event) => {
|
|
278
278
|
if (tile) {
|
|
279
279
|
if (tileHoverEvent) {
|
|
@@ -293,7 +293,7 @@ function useGameCanvas3DEvents(options) {
|
|
|
293
293
|
},
|
|
294
294
|
[tileHoverEvent, tileLeaveEvent, emit]
|
|
295
295
|
);
|
|
296
|
-
const handleUnitAnimation =
|
|
296
|
+
const handleUnitAnimation = React3.useCallback(
|
|
297
297
|
(unitId, state) => {
|
|
298
298
|
if (unitAnimationEvent) {
|
|
299
299
|
emit(unitAnimationEvent, {
|
|
@@ -306,7 +306,7 @@ function useGameCanvas3DEvents(options) {
|
|
|
306
306
|
},
|
|
307
307
|
[unitAnimationEvent, emit]
|
|
308
308
|
);
|
|
309
|
-
const handleCameraChange =
|
|
309
|
+
const handleCameraChange = React3.useCallback(
|
|
310
310
|
(position) => {
|
|
311
311
|
if (cameraChangeEvent) {
|
|
312
312
|
emit(cameraChangeEvent, {
|
|
@@ -373,7 +373,7 @@ function Canvas3DLoadingState({
|
|
|
373
373
|
] });
|
|
374
374
|
}
|
|
375
375
|
var log2 = logger.createLogger("almadar:ui:game:canvas3d:error-boundary");
|
|
376
|
-
var Canvas3DErrorBoundary = class extends
|
|
376
|
+
var Canvas3DErrorBoundary = class extends React3.Component {
|
|
377
377
|
constructor(props) {
|
|
378
378
|
super(props);
|
|
379
379
|
__publicField(this, "handleReset", () => {
|
|
@@ -502,7 +502,7 @@ function CameraController3D({
|
|
|
502
502
|
onCameraChange
|
|
503
503
|
}) {
|
|
504
504
|
const { camera } = fiber.useThree();
|
|
505
|
-
|
|
505
|
+
React3.useEffect(() => {
|
|
506
506
|
if (onCameraChange) {
|
|
507
507
|
onCameraChange({
|
|
508
508
|
x: camera.position.x,
|
|
@@ -518,8 +518,8 @@ function FollowCamera3D({
|
|
|
518
518
|
offset
|
|
519
519
|
}) {
|
|
520
520
|
const { camera } = fiber.useThree();
|
|
521
|
-
const look =
|
|
522
|
-
const goal =
|
|
521
|
+
const look = React3.useRef(new THREE9__namespace.Vector3(target[0], target[1], target[2]));
|
|
522
|
+
const goal = React3.useRef(new THREE9__namespace.Vector3());
|
|
523
523
|
fiber.useFrame((_, delta) => {
|
|
524
524
|
const t = Math.min(1, delta * 5);
|
|
525
525
|
goal.current.set(target[0] + offset[0], target[1] + offset[1], target[2] + offset[2]);
|
|
@@ -529,6 +529,54 @@ function FollowCamera3D({
|
|
|
529
529
|
});
|
|
530
530
|
return null;
|
|
531
531
|
}
|
|
532
|
+
|
|
533
|
+
// lib/atlasSlice.ts
|
|
534
|
+
var atlasCache = /* @__PURE__ */ new Map();
|
|
535
|
+
function isTilesheet(a) {
|
|
536
|
+
return typeof a.tileWidth === "number";
|
|
537
|
+
}
|
|
538
|
+
function getAtlas(url, onReady) {
|
|
539
|
+
if (atlasCache.has(url)) return atlasCache.get(url) ?? void 0;
|
|
540
|
+
atlasCache.set(url, void 0);
|
|
541
|
+
fetch(url).then((r) => r.json()).then((json) => {
|
|
542
|
+
atlasCache.set(url, json);
|
|
543
|
+
onReady();
|
|
544
|
+
}).catch(() => {
|
|
545
|
+
atlasCache.set(url, null);
|
|
546
|
+
});
|
|
547
|
+
return void 0;
|
|
548
|
+
}
|
|
549
|
+
function subRectFor(atlas, sprite) {
|
|
550
|
+
if (isTilesheet(atlas)) {
|
|
551
|
+
let col;
|
|
552
|
+
let row;
|
|
553
|
+
if (sprite.includes(",")) {
|
|
554
|
+
const [c, r] = sprite.split(",").map((n) => Number(n.trim()));
|
|
555
|
+
col = c;
|
|
556
|
+
row = r;
|
|
557
|
+
} else {
|
|
558
|
+
const i = Number(sprite);
|
|
559
|
+
if (!Number.isFinite(i)) return null;
|
|
560
|
+
col = i % atlas.columns;
|
|
561
|
+
row = Math.floor(i / atlas.columns);
|
|
562
|
+
}
|
|
563
|
+
if (!Number.isFinite(col) || !Number.isFinite(row) || col < 0 || row < 0 || col >= atlas.columns || row >= atlas.rows) return null;
|
|
564
|
+
const margin = atlas.margin ?? 0;
|
|
565
|
+
const spacing = atlas.spacing ?? 0;
|
|
566
|
+
return {
|
|
567
|
+
sx: margin + col * (atlas.tileWidth + spacing),
|
|
568
|
+
sy: margin + row * (atlas.tileHeight + spacing),
|
|
569
|
+
sw: atlas.tileWidth,
|
|
570
|
+
sh: atlas.tileHeight
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
const st = atlas.subTextures[sprite];
|
|
574
|
+
if (!st) return null;
|
|
575
|
+
return { sx: st.x, sy: st.y, sw: st.width, sh: st.height };
|
|
576
|
+
}
|
|
577
|
+
function isAtlasAsset(asset) {
|
|
578
|
+
return !!asset && typeof asset.atlas === "string" && typeof asset.sprite === "string";
|
|
579
|
+
}
|
|
532
580
|
var log3 = logger.createLogger("almadar:ui:game:model-loader");
|
|
533
581
|
var gltfCache = /* @__PURE__ */ new Map();
|
|
534
582
|
function loadGltfCached(url, assetRoot) {
|
|
@@ -573,10 +621,10 @@ function stateFromEntry(entry) {
|
|
|
573
621
|
return { model: null, clips: [], isLoading: !entry.error, error: entry.error ?? null };
|
|
574
622
|
}
|
|
575
623
|
function useGLTFModel(url, resourceBasePath) {
|
|
576
|
-
const [state, setState] =
|
|
624
|
+
const [state, setState] = React3.useState(
|
|
577
625
|
() => stateFromEntry(url ? loadGltfCached(url, resourceBasePath || detectAssetRoot(url)) : null)
|
|
578
626
|
);
|
|
579
|
-
|
|
627
|
+
React3.useEffect(() => {
|
|
580
628
|
if (!url) {
|
|
581
629
|
setState({ model: null, clips: [], isLoading: false, error: null });
|
|
582
630
|
return;
|
|
@@ -611,7 +659,7 @@ function ModelLoader({
|
|
|
611
659
|
tint
|
|
612
660
|
}) {
|
|
613
661
|
const { model: loadedModel, clips, isLoading, error } = useGLTFModel(url, resourceBasePath);
|
|
614
|
-
const model =
|
|
662
|
+
const model = React3.useMemo(() => {
|
|
615
663
|
if (!loadedModel) return null;
|
|
616
664
|
const cloned = SkeletonUtils.clone(loadedModel);
|
|
617
665
|
cloned.updateMatrixWorld(true);
|
|
@@ -629,8 +677,8 @@ function ModelLoader({
|
|
|
629
677
|
});
|
|
630
678
|
return cloned;
|
|
631
679
|
}, [loadedModel, castShadow, receiveShadow, tint]);
|
|
632
|
-
const mixer =
|
|
633
|
-
|
|
680
|
+
const mixer = React3.useMemo(() => model ? new THREE9__namespace.AnimationMixer(model) : null, [model]);
|
|
681
|
+
React3.useEffect(() => {
|
|
634
682
|
if (!mixer || !animation || clips.length === 0) return;
|
|
635
683
|
const wanted = animation.toLowerCase();
|
|
636
684
|
const clip = clips.find((c) => c.name === animation) ?? clips.find((c) => c.name.toLowerCase() === wanted);
|
|
@@ -644,7 +692,7 @@ function ModelLoader({
|
|
|
644
692
|
fiber.useFrame((_, delta) => {
|
|
645
693
|
mixer?.update(delta);
|
|
646
694
|
});
|
|
647
|
-
const normFactor =
|
|
695
|
+
const normFactor = React3.useMemo(() => {
|
|
648
696
|
if (!model) return 1;
|
|
649
697
|
const box = new THREE9__namespace.Box3().setFromObject(model);
|
|
650
698
|
const size = new THREE9__namespace.Vector3();
|
|
@@ -653,11 +701,11 @@ function ModelLoader({
|
|
|
653
701
|
if (!Number.isFinite(maxDim) || maxDim < 0.05) return 1;
|
|
654
702
|
return 1 / maxDim;
|
|
655
703
|
}, [model]);
|
|
656
|
-
const scaleArray =
|
|
704
|
+
const scaleArray = React3.useMemo(() => {
|
|
657
705
|
const base = typeof scale === "number" ? [scale, scale, scale] : scale;
|
|
658
706
|
return [base[0] * normFactor, base[1] * normFactor, base[2] * normFactor];
|
|
659
707
|
}, [scale, normFactor]);
|
|
660
|
-
const rotationRad =
|
|
708
|
+
const rotationRad = React3.useMemo(() => {
|
|
661
709
|
return [
|
|
662
710
|
rotation[0] * Math.PI / 180,
|
|
663
711
|
rotation[1] * Math.PI / 180,
|
|
@@ -730,22 +778,113 @@ function ModelLoader({
|
|
|
730
778
|
}
|
|
731
779
|
);
|
|
732
780
|
}
|
|
781
|
+
var CrossOriginTextureLoader = class extends THREE9__namespace.TextureLoader {
|
|
782
|
+
constructor() {
|
|
783
|
+
super();
|
|
784
|
+
this.crossOrigin = "anonymous";
|
|
785
|
+
}
|
|
786
|
+
};
|
|
787
|
+
function useBillboardTexture(url) {
|
|
788
|
+
const [state, setState] = React3__default.default.useState({
|
|
789
|
+
texture: null,
|
|
790
|
+
error: false
|
|
791
|
+
});
|
|
792
|
+
React3__default.default.useEffect(() => {
|
|
793
|
+
let active = true;
|
|
794
|
+
const loader = new CrossOriginTextureLoader();
|
|
795
|
+
loader.load(
|
|
796
|
+
url,
|
|
797
|
+
(texture) => {
|
|
798
|
+
if (!active) return;
|
|
799
|
+
texture.colorSpace = THREE9__namespace.SRGBColorSpace;
|
|
800
|
+
setState({ texture, error: false });
|
|
801
|
+
},
|
|
802
|
+
void 0,
|
|
803
|
+
() => {
|
|
804
|
+
if (!active) return;
|
|
805
|
+
setState({ texture: null, error: true });
|
|
806
|
+
}
|
|
807
|
+
);
|
|
808
|
+
return () => {
|
|
809
|
+
active = false;
|
|
810
|
+
};
|
|
811
|
+
}, [url]);
|
|
812
|
+
return state;
|
|
813
|
+
}
|
|
814
|
+
function useAtlasFrame(asset) {
|
|
815
|
+
const [tick, setTick] = React3__default.default.useState(0);
|
|
816
|
+
React3__default.default.useEffect(() => {
|
|
817
|
+
if (!isAtlasAsset(asset)) return;
|
|
818
|
+
getAtlas(asset.atlas, () => setTick((t) => t + 1));
|
|
819
|
+
}, [asset, tick]);
|
|
820
|
+
return React3__default.default.useMemo(() => {
|
|
821
|
+
if (!isAtlasAsset(asset)) return { frame: null, ready: true };
|
|
822
|
+
const atlas = getAtlas(asset.atlas, () => setTick((t) => t + 1));
|
|
823
|
+
if (!atlas) {
|
|
824
|
+
return { frame: null, ready: false };
|
|
825
|
+
}
|
|
826
|
+
const r = subRectFor(atlas, asset.sprite);
|
|
827
|
+
if (!r) return { frame: null, ready: true };
|
|
828
|
+
return { frame: { x: r.sx, y: r.sy, w: r.sw, h: r.sh }, ready: true };
|
|
829
|
+
}, [asset, tick]);
|
|
830
|
+
}
|
|
733
831
|
function SpriteBillboard({ node, world }) {
|
|
734
|
-
const texture =
|
|
735
|
-
const
|
|
736
|
-
const
|
|
737
|
-
const
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
832
|
+
const { texture, error: textureError } = useBillboardTexture(node.asset.url);
|
|
833
|
+
const { frame: atlasFrame, ready: atlasReady } = useAtlasFrame(node.asset);
|
|
834
|
+
const frame = node.frame ?? atlasFrame;
|
|
835
|
+
const anchor = node.anchor ?? "top-left";
|
|
836
|
+
const size = React3__default.default.useMemo(() => {
|
|
837
|
+
const img = texture?.image;
|
|
838
|
+
const imgW = img?.width || 1;
|
|
839
|
+
const imgH = img?.height || 1;
|
|
840
|
+
const aspect = frame ? frame.w / frame.h : imgW / imgH;
|
|
841
|
+
if (anchor === "top-left") {
|
|
842
|
+
const width2 = node.width ?? 1;
|
|
843
|
+
const height2 = node.height ?? 1;
|
|
844
|
+
return { width: width2, height: height2, imgW, imgH };
|
|
845
|
+
}
|
|
846
|
+
const height = node.height ?? 1;
|
|
847
|
+
const width = node.width ?? height * aspect;
|
|
848
|
+
return { width, height, imgW, imgH };
|
|
849
|
+
}, [texture, frame, node.height, node.width, anchor]);
|
|
850
|
+
const groundGeometry = React3__default.default.useMemo(() => {
|
|
851
|
+
if (anchor !== "top-left" || !texture || !atlasReady) return null;
|
|
852
|
+
const g = new THREE9__namespace.PlaneGeometry(size.width, size.height);
|
|
853
|
+
g.rotateX(-Math.PI / 2);
|
|
854
|
+
return g;
|
|
855
|
+
}, [anchor, texture, atlasReady, size.width, size.height]);
|
|
856
|
+
if (!texture || !atlasReady) {
|
|
857
|
+
if (anchor === "top-left") {
|
|
858
|
+
return /* @__PURE__ */ jsxRuntime.jsx("group", { position: [world[0] + size.width / 2, 0.02, world[2] + size.height / 2], children: /* @__PURE__ */ jsxRuntime.jsxs("mesh", { rotation: [-Math.PI / 2, 0, 0], children: [
|
|
859
|
+
/* @__PURE__ */ jsxRuntime.jsx("planeGeometry", { args: [size.width, size.height] }),
|
|
860
|
+
/* @__PURE__ */ jsxRuntime.jsx("meshBasicMaterial", { color: textureError ? 16729156 : 8947848, transparent: true, opacity: 0.6, side: THREE9__namespace.DoubleSide })
|
|
861
|
+
] }) });
|
|
862
|
+
}
|
|
863
|
+
return /* @__PURE__ */ jsxRuntime.jsx("group", { position: [world[0], world[1] + size.height / 2, world[2]], children: /* @__PURE__ */ jsxRuntime.jsxs("mesh", { children: [
|
|
864
|
+
/* @__PURE__ */ jsxRuntime.jsx("planeGeometry", { args: [size.width, size.height] }),
|
|
865
|
+
/* @__PURE__ */ jsxRuntime.jsx("meshBasicMaterial", { color: textureError ? 16729156 : 8947848, transparent: true, opacity: 0.6, side: THREE9__namespace.DoubleSide })
|
|
866
|
+
] }) });
|
|
867
|
+
}
|
|
868
|
+
texture.magFilter = texture.minFilter = THREE9__namespace.NearestFilter;
|
|
869
|
+
texture.needsUpdate = true;
|
|
870
|
+
if (frame) {
|
|
871
|
+
texture.repeat.set(frame.w / size.imgW, frame.h / size.imgH);
|
|
872
|
+
texture.offset.set(frame.x / size.imgW, 1 - (frame.y + frame.h) / size.imgH);
|
|
873
|
+
}
|
|
874
|
+
if (anchor === "top-left") {
|
|
875
|
+
return /* @__PURE__ */ jsxRuntime.jsx("group", { position: [world[0] + size.width / 2, 0.01, world[2] + size.height / 2], children: /* @__PURE__ */ jsxRuntime.jsx("mesh", { geometry: groundGeometry ?? void 0, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
876
|
+
"meshBasicMaterial",
|
|
877
|
+
{
|
|
878
|
+
map: texture,
|
|
879
|
+
transparent: true,
|
|
880
|
+
alphaTest: 0.1,
|
|
881
|
+
side: THREE9__namespace.DoubleSide,
|
|
882
|
+
opacity: node.opacity ?? 1
|
|
883
|
+
}
|
|
884
|
+
) }) });
|
|
743
885
|
}
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
const width = node.width ?? height * aspect;
|
|
747
|
-
return /* @__PURE__ */ jsxRuntime.jsx(drei.Billboard, { position: [world[0], world[1] + height / 2, world[2]], children: /* @__PURE__ */ jsxRuntime.jsxs("mesh", { children: [
|
|
748
|
-
/* @__PURE__ */ jsxRuntime.jsx("planeGeometry", { args: [width, height] }),
|
|
886
|
+
return /* @__PURE__ */ jsxRuntime.jsx(drei.Billboard, { position: [world[0], world[1] + size.height / 2, world[2]], children: /* @__PURE__ */ jsxRuntime.jsxs("mesh", { children: [
|
|
887
|
+
/* @__PURE__ */ jsxRuntime.jsx("planeGeometry", { args: [size.width, size.height] }),
|
|
749
888
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
750
889
|
"meshBasicMaterial",
|
|
751
890
|
{
|
|
@@ -868,7 +1007,7 @@ var DEFAULT_GRID_CONFIG = {
|
|
|
868
1007
|
offsetX: 0,
|
|
869
1008
|
offsetZ: 0
|
|
870
1009
|
};
|
|
871
|
-
var Canvas3DHost =
|
|
1010
|
+
var Canvas3DHost = React3.forwardRef(
|
|
872
1011
|
({
|
|
873
1012
|
cameraMode = "isometric",
|
|
874
1013
|
followTarget,
|
|
@@ -894,12 +1033,12 @@ var Canvas3DHost = React6.forwardRef(
|
|
|
894
1033
|
children,
|
|
895
1034
|
drawables
|
|
896
1035
|
}, ref) => {
|
|
897
|
-
const containerRef =
|
|
898
|
-
const controlsRef =
|
|
899
|
-
const [internalError, setInternalError] =
|
|
1036
|
+
const containerRef = React3.useRef(null);
|
|
1037
|
+
const controlsRef = React3.useRef(null);
|
|
1038
|
+
const [internalError, setInternalError] = React3.useState(null);
|
|
900
1039
|
const eventBus = useEventBus();
|
|
901
|
-
const keysRef =
|
|
902
|
-
|
|
1040
|
+
const keysRef = React3.useRef(/* @__PURE__ */ new Set());
|
|
1041
|
+
React3.useEffect(() => {
|
|
903
1042
|
if (!keyMap && !keyUpMap) return;
|
|
904
1043
|
const down = (e) => {
|
|
905
1044
|
if (keysRef.current.has(e.code)) return;
|
|
@@ -932,10 +1071,10 @@ var Canvas3DHost = React6.forwardRef(
|
|
|
932
1071
|
unitAnimationEvent,
|
|
933
1072
|
cameraChangeEvent
|
|
934
1073
|
});
|
|
935
|
-
const drawnItems =
|
|
936
|
-
const scenePositions =
|
|
937
|
-
const hitIndex =
|
|
938
|
-
const gridBounds =
|
|
1074
|
+
const drawnItems = React3.useMemo(() => collectDrawnItems(drawables ?? []), [drawables]);
|
|
1075
|
+
const scenePositions = React3.useMemo(() => drawnItems.map((i) => i.pos), [drawnItems]);
|
|
1076
|
+
const hitIndex = React3.useMemo(() => buildHitIndex(drawnItems), [drawnItems]);
|
|
1077
|
+
const gridBounds = React3.useMemo(() => {
|
|
939
1078
|
if (scenePositions.length === 0) {
|
|
940
1079
|
return { minX: 0, maxX: 10, minZ: 0, maxZ: 10 };
|
|
941
1080
|
}
|
|
@@ -951,7 +1090,7 @@ var Canvas3DHost = React6.forwardRef(
|
|
|
951
1090
|
}
|
|
952
1091
|
return { minX, maxX, minZ, maxZ };
|
|
953
1092
|
}, [scenePositions]);
|
|
954
|
-
const cameraTarget =
|
|
1093
|
+
const cameraTarget = React3.useMemo(
|
|
955
1094
|
() => [
|
|
956
1095
|
(gridBounds.minX + gridBounds.maxX) / 2,
|
|
957
1096
|
0,
|
|
@@ -959,7 +1098,7 @@ var Canvas3DHost = React6.forwardRef(
|
|
|
959
1098
|
],
|
|
960
1099
|
[gridBounds]
|
|
961
1100
|
);
|
|
962
|
-
const gridConfig =
|
|
1101
|
+
const gridConfig = React3.useMemo(
|
|
963
1102
|
() => ({
|
|
964
1103
|
...DEFAULT_GRID_CONFIG,
|
|
965
1104
|
offsetX: -(gridBounds.maxX - gridBounds.minX) / 2,
|
|
@@ -967,7 +1106,7 @@ var Canvas3DHost = React6.forwardRef(
|
|
|
967
1106
|
}),
|
|
968
1107
|
[gridBounds]
|
|
969
1108
|
);
|
|
970
|
-
const drawableProjector =
|
|
1109
|
+
const drawableProjector = React3.useMemo(
|
|
971
1110
|
() => create3DProjector({
|
|
972
1111
|
cellSize: gridConfig.cellSize,
|
|
973
1112
|
offsetX: -gridBounds.minX * gridConfig.cellSize,
|
|
@@ -975,7 +1114,7 @@ var Canvas3DHost = React6.forwardRef(
|
|
|
975
1114
|
}),
|
|
976
1115
|
[gridBounds, gridConfig]
|
|
977
1116
|
);
|
|
978
|
-
|
|
1117
|
+
React3.useImperativeHandle(ref, () => ({
|
|
979
1118
|
getCameraPosition: () => {
|
|
980
1119
|
if (controlsRef.current) {
|
|
981
1120
|
const pos = controlsRef.current.object.position;
|
|
@@ -1008,7 +1147,7 @@ var Canvas3DHost = React6.forwardRef(
|
|
|
1008
1147
|
return null;
|
|
1009
1148
|
}
|
|
1010
1149
|
}));
|
|
1011
|
-
const cameraConfig =
|
|
1150
|
+
const cameraConfig = React3.useMemo(() => {
|
|
1012
1151
|
const size = Math.max(
|
|
1013
1152
|
gridBounds.maxX - gridBounds.minX,
|
|
1014
1153
|
gridBounds.maxZ - gridBounds.minZ,
|
|
@@ -1030,15 +1169,15 @@ var Canvas3DHost = React6.forwardRef(
|
|
|
1030
1169
|
return { position: [cx + d, d, cz + d], fov: 45 };
|
|
1031
1170
|
}
|
|
1032
1171
|
}, [cameraMode, gridBounds]);
|
|
1033
|
-
const followWorld =
|
|
1172
|
+
const followWorld = React3.useMemo(() => {
|
|
1034
1173
|
if (followTarget) return drawableProjector.toWorld(followTarget);
|
|
1035
1174
|
return cameraTarget;
|
|
1036
1175
|
}, [followTarget, drawableProjector, cameraTarget]);
|
|
1037
|
-
const followOffset =
|
|
1176
|
+
const followOffset = React3.useMemo(
|
|
1038
1177
|
() => cameraMode === "chase" ? [0, 4, -7] : [5, 7, 5],
|
|
1039
1178
|
[cameraMode]
|
|
1040
1179
|
);
|
|
1041
|
-
const handleGroundClick =
|
|
1180
|
+
const handleGroundClick = React3.useCallback((e) => {
|
|
1042
1181
|
if (!tileClickEvent && !unitClickEvent) return;
|
|
1043
1182
|
e.stopPropagation();
|
|
1044
1183
|
const cell = {
|
|
@@ -1191,8 +1330,8 @@ var Canvas3DHost = React6.forwardRef(
|
|
|
1191
1330
|
Canvas3DHost.displayName = "Canvas3DHost";
|
|
1192
1331
|
function Scene3D({ background = "#1a1a2e", fog, children }) {
|
|
1193
1332
|
const { scene } = fiber.useThree();
|
|
1194
|
-
const initializedRef =
|
|
1195
|
-
|
|
1333
|
+
const initializedRef = React3.useRef(false);
|
|
1334
|
+
React3.useEffect(() => {
|
|
1196
1335
|
if (initializedRef.current) return;
|
|
1197
1336
|
initializedRef.current = true;
|
|
1198
1337
|
if (background.startsWith("#") || background.startsWith("rgb")) {
|
|
@@ -1213,7 +1352,7 @@ function Scene3D({ background = "#1a1a2e", fog, children }) {
|
|
|
1213
1352
|
}, [scene, background, fog]);
|
|
1214
1353
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
1215
1354
|
}
|
|
1216
|
-
var Camera3D =
|
|
1355
|
+
var Camera3D = React3.forwardRef(
|
|
1217
1356
|
({
|
|
1218
1357
|
mode = "isometric",
|
|
1219
1358
|
position = [10, 10, 10],
|
|
@@ -1226,10 +1365,10 @@ var Camera3D = React6.forwardRef(
|
|
|
1226
1365
|
onChange
|
|
1227
1366
|
}, ref) => {
|
|
1228
1367
|
const { camera, set, viewport } = fiber.useThree();
|
|
1229
|
-
const controlsRef =
|
|
1230
|
-
const initialPosition =
|
|
1231
|
-
const initialTarget =
|
|
1232
|
-
|
|
1368
|
+
const controlsRef = React3.useRef(null);
|
|
1369
|
+
const initialPosition = React3.useRef(new THREE9__namespace.Vector3(...position));
|
|
1370
|
+
const initialTarget = React3.useRef(new THREE9__namespace.Vector3(...target));
|
|
1371
|
+
React3.useEffect(() => {
|
|
1233
1372
|
let newCamera;
|
|
1234
1373
|
if (mode === "isometric") {
|
|
1235
1374
|
const aspect = viewport.aspect;
|
|
@@ -1260,7 +1399,7 @@ var Camera3D = React6.forwardRef(
|
|
|
1260
1399
|
onChange(camera);
|
|
1261
1400
|
}
|
|
1262
1401
|
});
|
|
1263
|
-
|
|
1402
|
+
React3.useImperativeHandle(ref, () => ({
|
|
1264
1403
|
getCamera: () => camera,
|
|
1265
1404
|
setPosition: (x, y, z) => {
|
|
1266
1405
|
camera.position.set(x, y, z);
|
|
@@ -1514,21 +1653,21 @@ var DEFAULT_OPTIONS = {
|
|
|
1514
1653
|
};
|
|
1515
1654
|
function useThree4(options = {}) {
|
|
1516
1655
|
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
1517
|
-
const containerRef =
|
|
1518
|
-
const canvasRef =
|
|
1519
|
-
const rendererRef =
|
|
1520
|
-
const sceneRef =
|
|
1521
|
-
const cameraRef =
|
|
1522
|
-
const controlsRef =
|
|
1523
|
-
const gridHelperRef =
|
|
1524
|
-
const rafRef =
|
|
1525
|
-
const [isReady, setIsReady] =
|
|
1526
|
-
const [dimensions, setDimensions] =
|
|
1527
|
-
const initialCameraPosition =
|
|
1656
|
+
const containerRef = React3.useRef(null);
|
|
1657
|
+
const canvasRef = React3.useRef(null);
|
|
1658
|
+
const rendererRef = React3.useRef(null);
|
|
1659
|
+
const sceneRef = React3.useRef(null);
|
|
1660
|
+
const cameraRef = React3.useRef(null);
|
|
1661
|
+
const controlsRef = React3.useRef(null);
|
|
1662
|
+
const gridHelperRef = React3.useRef(null);
|
|
1663
|
+
const rafRef = React3.useRef(0);
|
|
1664
|
+
const [isReady, setIsReady] = React3.useState(false);
|
|
1665
|
+
const [dimensions, setDimensions] = React3.useState({ width: 0, height: 0 });
|
|
1666
|
+
const initialCameraPosition = React3.useMemo(
|
|
1528
1667
|
() => new THREE9__namespace.Vector3(...opts.cameraPosition),
|
|
1529
1668
|
[]
|
|
1530
1669
|
);
|
|
1531
|
-
|
|
1670
|
+
React3.useEffect(() => {
|
|
1532
1671
|
if (!containerRef.current) return;
|
|
1533
1672
|
const container = containerRef.current;
|
|
1534
1673
|
const { clientWidth, clientHeight } = container;
|
|
@@ -1621,7 +1760,7 @@ function useThree4(options = {}) {
|
|
|
1621
1760
|
scene.clear();
|
|
1622
1761
|
};
|
|
1623
1762
|
}, []);
|
|
1624
|
-
|
|
1763
|
+
React3.useEffect(() => {
|
|
1625
1764
|
if (!cameraRef.current || !containerRef.current) return;
|
|
1626
1765
|
const container = containerRef.current;
|
|
1627
1766
|
const { clientWidth, clientHeight } = container;
|
|
@@ -1656,20 +1795,20 @@ function useThree4(options = {}) {
|
|
|
1656
1795
|
animate();
|
|
1657
1796
|
}
|
|
1658
1797
|
}, [opts.cameraMode]);
|
|
1659
|
-
const setCameraPosition =
|
|
1798
|
+
const setCameraPosition = React3.useCallback((x, y, z) => {
|
|
1660
1799
|
if (cameraRef.current) {
|
|
1661
1800
|
cameraRef.current.position.set(x, y, z);
|
|
1662
1801
|
controlsRef.current?.update();
|
|
1663
1802
|
}
|
|
1664
1803
|
}, []);
|
|
1665
|
-
const lookAt =
|
|
1804
|
+
const lookAt = React3.useCallback((x, y, z) => {
|
|
1666
1805
|
if (cameraRef.current) {
|
|
1667
1806
|
cameraRef.current.lookAt(x, y, z);
|
|
1668
1807
|
controlsRef.current?.target.set(x, y, z);
|
|
1669
1808
|
controlsRef.current?.update();
|
|
1670
1809
|
}
|
|
1671
1810
|
}, []);
|
|
1672
|
-
const resetCamera =
|
|
1811
|
+
const resetCamera = React3.useCallback(() => {
|
|
1673
1812
|
if (cameraRef.current) {
|
|
1674
1813
|
cameraRef.current.position.copy(initialCameraPosition);
|
|
1675
1814
|
cameraRef.current.lookAt(0, 0, 0);
|
|
@@ -1679,7 +1818,7 @@ function useThree4(options = {}) {
|
|
|
1679
1818
|
}
|
|
1680
1819
|
}
|
|
1681
1820
|
}, [initialCameraPosition]);
|
|
1682
|
-
const fitView =
|
|
1821
|
+
const fitView = React3.useCallback(
|
|
1683
1822
|
(bounds) => {
|
|
1684
1823
|
if (!cameraRef.current) return;
|
|
1685
1824
|
const centerX = (bounds.minX + bounds.maxX) / 2;
|
|
@@ -1710,20 +1849,20 @@ function useThree4(options = {}) {
|
|
|
1710
1849
|
}
|
|
1711
1850
|
function useAssetLoader(options = {}) {
|
|
1712
1851
|
const { preloadUrls = [], loader: customLoader } = options;
|
|
1713
|
-
const loaderRef =
|
|
1714
|
-
const [state, setState] =
|
|
1852
|
+
const loaderRef = React3.useRef(customLoader || new AssetLoader());
|
|
1853
|
+
const [state, setState] = React3.useState({
|
|
1715
1854
|
isLoading: false,
|
|
1716
1855
|
progress: 0,
|
|
1717
1856
|
loaded: 0,
|
|
1718
1857
|
total: 0,
|
|
1719
1858
|
errors: []
|
|
1720
1859
|
});
|
|
1721
|
-
|
|
1860
|
+
React3.useEffect(() => {
|
|
1722
1861
|
if (preloadUrls.length > 0) {
|
|
1723
1862
|
preload(preloadUrls);
|
|
1724
1863
|
}
|
|
1725
1864
|
}, []);
|
|
1726
|
-
const updateProgress =
|
|
1865
|
+
const updateProgress = React3.useCallback((loaded, total) => {
|
|
1727
1866
|
setState((prev) => ({
|
|
1728
1867
|
...prev,
|
|
1729
1868
|
loaded,
|
|
@@ -1731,7 +1870,7 @@ function useAssetLoader(options = {}) {
|
|
|
1731
1870
|
progress: total > 0 ? Math.round(loaded / total * 100) : 0
|
|
1732
1871
|
}));
|
|
1733
1872
|
}, []);
|
|
1734
|
-
const loadModel =
|
|
1873
|
+
const loadModel = React3.useCallback(
|
|
1735
1874
|
async (url) => {
|
|
1736
1875
|
setState((prev) => ({ ...prev, isLoading: true }));
|
|
1737
1876
|
try {
|
|
@@ -1754,7 +1893,7 @@ function useAssetLoader(options = {}) {
|
|
|
1754
1893
|
},
|
|
1755
1894
|
[]
|
|
1756
1895
|
);
|
|
1757
|
-
const loadOBJ =
|
|
1896
|
+
const loadOBJ = React3.useCallback(
|
|
1758
1897
|
async (url) => {
|
|
1759
1898
|
setState((prev) => ({ ...prev, isLoading: true }));
|
|
1760
1899
|
try {
|
|
@@ -1777,7 +1916,7 @@ function useAssetLoader(options = {}) {
|
|
|
1777
1916
|
},
|
|
1778
1917
|
[]
|
|
1779
1918
|
);
|
|
1780
|
-
const loadTexture =
|
|
1919
|
+
const loadTexture = React3.useCallback(
|
|
1781
1920
|
async (url) => {
|
|
1782
1921
|
setState((prev) => ({ ...prev, isLoading: true }));
|
|
1783
1922
|
try {
|
|
@@ -1800,7 +1939,7 @@ function useAssetLoader(options = {}) {
|
|
|
1800
1939
|
},
|
|
1801
1940
|
[]
|
|
1802
1941
|
);
|
|
1803
|
-
const preload =
|
|
1942
|
+
const preload = React3.useCallback(
|
|
1804
1943
|
async (urls) => {
|
|
1805
1944
|
setState((prev) => ({
|
|
1806
1945
|
...prev,
|
|
@@ -1839,27 +1978,27 @@ function useAssetLoader(options = {}) {
|
|
|
1839
1978
|
},
|
|
1840
1979
|
[updateProgress]
|
|
1841
1980
|
);
|
|
1842
|
-
const hasModel =
|
|
1981
|
+
const hasModel = React3.useCallback((url) => {
|
|
1843
1982
|
return loaderRef.current.hasModel(url);
|
|
1844
1983
|
}, []);
|
|
1845
|
-
const hasTexture =
|
|
1984
|
+
const hasTexture = React3.useCallback((url) => {
|
|
1846
1985
|
return loaderRef.current.hasTexture(url);
|
|
1847
1986
|
}, []);
|
|
1848
|
-
const getModel =
|
|
1987
|
+
const getModel = React3.useCallback((url) => {
|
|
1849
1988
|
try {
|
|
1850
1989
|
return loaderRef.current.getModel(url);
|
|
1851
1990
|
} catch {
|
|
1852
1991
|
return void 0;
|
|
1853
1992
|
}
|
|
1854
1993
|
}, []);
|
|
1855
|
-
const getTexture =
|
|
1994
|
+
const getTexture = React3.useCallback((url) => {
|
|
1856
1995
|
try {
|
|
1857
1996
|
return loaderRef.current.getTexture(url);
|
|
1858
1997
|
} catch {
|
|
1859
1998
|
return void 0;
|
|
1860
1999
|
}
|
|
1861
2000
|
}, []);
|
|
1862
|
-
const clearCache =
|
|
2001
|
+
const clearCache = React3.useCallback(() => {
|
|
1863
2002
|
loaderRef.current.clearCache();
|
|
1864
2003
|
setState({
|
|
1865
2004
|
isLoading: false,
|
|
@@ -1883,25 +2022,25 @@ function useAssetLoader(options = {}) {
|
|
|
1883
2022
|
};
|
|
1884
2023
|
}
|
|
1885
2024
|
function useSceneGraph() {
|
|
1886
|
-
const nodesRef =
|
|
1887
|
-
const addNode =
|
|
2025
|
+
const nodesRef = React3.useRef(/* @__PURE__ */ new Map());
|
|
2026
|
+
const addNode = React3.useCallback((node) => {
|
|
1888
2027
|
const existing = nodesRef.current.get(node.id);
|
|
1889
2028
|
if (existing) {
|
|
1890
2029
|
existing.mesh.removeFromParent();
|
|
1891
2030
|
}
|
|
1892
2031
|
nodesRef.current.set(node.id, node);
|
|
1893
2032
|
}, []);
|
|
1894
|
-
const removeNode =
|
|
2033
|
+
const removeNode = React3.useCallback((id) => {
|
|
1895
2034
|
const node = nodesRef.current.get(id);
|
|
1896
2035
|
if (node) {
|
|
1897
2036
|
node.mesh.removeFromParent();
|
|
1898
2037
|
nodesRef.current.delete(id);
|
|
1899
2038
|
}
|
|
1900
2039
|
}, []);
|
|
1901
|
-
const getNode =
|
|
2040
|
+
const getNode = React3.useCallback((id) => {
|
|
1902
2041
|
return nodesRef.current.get(id);
|
|
1903
2042
|
}, []);
|
|
1904
|
-
const updateNodePosition =
|
|
2043
|
+
const updateNodePosition = React3.useCallback(
|
|
1905
2044
|
(id, x, y, z) => {
|
|
1906
2045
|
const node = nodesRef.current.get(id);
|
|
1907
2046
|
if (node) {
|
|
@@ -1911,7 +2050,7 @@ function useSceneGraph() {
|
|
|
1911
2050
|
},
|
|
1912
2051
|
[]
|
|
1913
2052
|
);
|
|
1914
|
-
const updateNodeGridPosition =
|
|
2053
|
+
const updateNodeGridPosition = React3.useCallback(
|
|
1915
2054
|
(id, gridX, gridZ) => {
|
|
1916
2055
|
const node = nodesRef.current.get(id);
|
|
1917
2056
|
if (node) {
|
|
@@ -1920,7 +2059,7 @@ function useSceneGraph() {
|
|
|
1920
2059
|
},
|
|
1921
2060
|
[]
|
|
1922
2061
|
);
|
|
1923
|
-
const getNodeAtGrid =
|
|
2062
|
+
const getNodeAtGrid = React3.useCallback(
|
|
1924
2063
|
(x, z, type) => {
|
|
1925
2064
|
return Array.from(nodesRef.current.values()).find((node) => {
|
|
1926
2065
|
const matchesGrid = node.gridPosition.x === x && node.gridPosition.z === z;
|
|
@@ -1929,10 +2068,10 @@ function useSceneGraph() {
|
|
|
1929
2068
|
},
|
|
1930
2069
|
[]
|
|
1931
2070
|
);
|
|
1932
|
-
const getNodesByType =
|
|
2071
|
+
const getNodesByType = React3.useCallback((type) => {
|
|
1933
2072
|
return Array.from(nodesRef.current.values()).filter((node) => node.type === type);
|
|
1934
2073
|
}, []);
|
|
1935
|
-
const getNodesInBounds =
|
|
2074
|
+
const getNodesInBounds = React3.useCallback(
|
|
1936
2075
|
(minX, maxX, minZ, maxZ) => {
|
|
1937
2076
|
return Array.from(nodesRef.current.values()).filter((node) => {
|
|
1938
2077
|
const { x, z } = node.gridPosition;
|
|
@@ -1941,13 +2080,13 @@ function useSceneGraph() {
|
|
|
1941
2080
|
},
|
|
1942
2081
|
[]
|
|
1943
2082
|
);
|
|
1944
|
-
const clearNodes =
|
|
2083
|
+
const clearNodes = React3.useCallback(() => {
|
|
1945
2084
|
nodesRef.current.forEach((node) => {
|
|
1946
2085
|
node.mesh.removeFromParent();
|
|
1947
2086
|
});
|
|
1948
2087
|
nodesRef.current.clear();
|
|
1949
2088
|
}, []);
|
|
1950
|
-
const countNodes =
|
|
2089
|
+
const countNodes = React3.useCallback((type) => {
|
|
1951
2090
|
if (!type) {
|
|
1952
2091
|
return nodesRef.current.size;
|
|
1953
2092
|
}
|
|
@@ -1969,9 +2108,9 @@ function useSceneGraph() {
|
|
|
1969
2108
|
}
|
|
1970
2109
|
function useRaycaster(options) {
|
|
1971
2110
|
const { camera, canvas, cellSize = 1, offsetX = 0, offsetZ = 0 } = options;
|
|
1972
|
-
const raycaster =
|
|
1973
|
-
const mouse =
|
|
1974
|
-
const clientToNDC =
|
|
2111
|
+
const raycaster = React3.useRef(new THREE9__namespace.Raycaster());
|
|
2112
|
+
const mouse = React3.useRef(new THREE9__namespace.Vector2());
|
|
2113
|
+
const clientToNDC = React3.useCallback(
|
|
1975
2114
|
(clientX, clientY) => {
|
|
1976
2115
|
if (!canvas) {
|
|
1977
2116
|
return { x: 0, y: 0 };
|
|
@@ -1984,7 +2123,7 @@ function useRaycaster(options) {
|
|
|
1984
2123
|
},
|
|
1985
2124
|
[canvas]
|
|
1986
2125
|
);
|
|
1987
|
-
const isWithinCanvas =
|
|
2126
|
+
const isWithinCanvas = React3.useCallback(
|
|
1988
2127
|
(clientX, clientY) => {
|
|
1989
2128
|
if (!canvas) return false;
|
|
1990
2129
|
const rect = canvas.getBoundingClientRect();
|
|
@@ -1992,7 +2131,7 @@ function useRaycaster(options) {
|
|
|
1992
2131
|
},
|
|
1993
2132
|
[canvas]
|
|
1994
2133
|
);
|
|
1995
|
-
const getIntersection =
|
|
2134
|
+
const getIntersection = React3.useCallback(
|
|
1996
2135
|
(clientX, clientY, objects) => {
|
|
1997
2136
|
if (!camera || !canvas) return null;
|
|
1998
2137
|
const ndc = clientToNDC(clientX, clientY);
|
|
@@ -2015,7 +2154,7 @@ function useRaycaster(options) {
|
|
|
2015
2154
|
},
|
|
2016
2155
|
[camera, canvas, clientToNDC]
|
|
2017
2156
|
);
|
|
2018
|
-
const getAllIntersections =
|
|
2157
|
+
const getAllIntersections = React3.useCallback(
|
|
2019
2158
|
(clientX, clientY, objects) => {
|
|
2020
2159
|
if (!camera || !canvas) return [];
|
|
2021
2160
|
const ndc = clientToNDC(clientX, clientY);
|
|
@@ -2034,7 +2173,7 @@ function useRaycaster(options) {
|
|
|
2034
2173
|
},
|
|
2035
2174
|
[camera, canvas, clientToNDC]
|
|
2036
2175
|
);
|
|
2037
|
-
const getGridCoordinates =
|
|
2176
|
+
const getGridCoordinates = React3.useCallback(
|
|
2038
2177
|
(clientX, clientY) => {
|
|
2039
2178
|
if (!camera || !canvas) return null;
|
|
2040
2179
|
const ndc = clientToNDC(clientX, clientY);
|
|
@@ -2052,7 +2191,7 @@ function useRaycaster(options) {
|
|
|
2052
2191
|
},
|
|
2053
2192
|
[camera, canvas, cellSize, offsetX, offsetZ, clientToNDC]
|
|
2054
2193
|
);
|
|
2055
|
-
const getTileAtPosition =
|
|
2194
|
+
const getTileAtPosition = React3.useCallback(
|
|
2056
2195
|
(clientX, clientY, scene) => {
|
|
2057
2196
|
if (!camera || !canvas) return null;
|
|
2058
2197
|
const tileMeshes = [];
|
|
@@ -2387,24 +2526,24 @@ var SpatialHashGrid = class {
|
|
|
2387
2526
|
};
|
|
2388
2527
|
function useTapReveal(options = {}) {
|
|
2389
2528
|
const { onReveal, onDismiss, refs, enabled = true } = options;
|
|
2390
|
-
const [revealed, setRevealed] =
|
|
2391
|
-
const onRevealRef =
|
|
2392
|
-
const onDismissRef =
|
|
2529
|
+
const [revealed, setRevealed] = React3.useState(false);
|
|
2530
|
+
const onRevealRef = React3.useRef(onReveal);
|
|
2531
|
+
const onDismissRef = React3.useRef(onDismiss);
|
|
2393
2532
|
onRevealRef.current = onReveal;
|
|
2394
2533
|
onDismissRef.current = onDismiss;
|
|
2395
|
-
const reveal =
|
|
2534
|
+
const reveal = React3.useCallback(() => {
|
|
2396
2535
|
setRevealed((wasRevealed) => {
|
|
2397
2536
|
if (!wasRevealed) onRevealRef.current?.();
|
|
2398
2537
|
return true;
|
|
2399
2538
|
});
|
|
2400
2539
|
}, []);
|
|
2401
|
-
const dismiss =
|
|
2540
|
+
const dismiss = React3.useCallback(() => {
|
|
2402
2541
|
setRevealed((wasRevealed) => {
|
|
2403
2542
|
if (wasRevealed) onDismissRef.current?.();
|
|
2404
2543
|
return false;
|
|
2405
2544
|
});
|
|
2406
2545
|
}, []);
|
|
2407
|
-
const onPointerDown =
|
|
2546
|
+
const onPointerDown = React3.useCallback(
|
|
2408
2547
|
(e) => {
|
|
2409
2548
|
if (!enabled || e.pointerType === "mouse") return;
|
|
2410
2549
|
if (revealed) dismiss();
|
|
@@ -2412,7 +2551,7 @@ function useTapReveal(options = {}) {
|
|
|
2412
2551
|
},
|
|
2413
2552
|
[enabled, revealed, reveal, dismiss]
|
|
2414
2553
|
);
|
|
2415
|
-
|
|
2554
|
+
React3.useEffect(() => {
|
|
2416
2555
|
if (!revealed || typeof document === "undefined") return;
|
|
2417
2556
|
const onDocDown = (ev) => {
|
|
2418
2557
|
const target = ev.target;
|
|
@@ -2532,7 +2671,7 @@ var positionStyles = {
|
|
|
2532
2671
|
fixed: "fixed",
|
|
2533
2672
|
sticky: "sticky"
|
|
2534
2673
|
};
|
|
2535
|
-
var Box =
|
|
2674
|
+
var Box = React3__default.default.forwardRef(
|
|
2536
2675
|
({
|
|
2537
2676
|
padding,
|
|
2538
2677
|
paddingX,
|
|
@@ -2564,20 +2703,20 @@ var Box = React6__default.default.forwardRef(
|
|
|
2564
2703
|
...rest
|
|
2565
2704
|
}, ref) => {
|
|
2566
2705
|
const eventBus = useEventBus();
|
|
2567
|
-
const handleClick =
|
|
2706
|
+
const handleClick = React3.useCallback((e) => {
|
|
2568
2707
|
if (action) {
|
|
2569
2708
|
e.stopPropagation();
|
|
2570
2709
|
eventBus.emit(`UI:${action}`, actionPayload ?? {});
|
|
2571
2710
|
}
|
|
2572
2711
|
onClick?.(e);
|
|
2573
2712
|
}, [action, actionPayload, eventBus, onClick]);
|
|
2574
|
-
const handleMouseEnter =
|
|
2713
|
+
const handleMouseEnter = React3.useCallback((e) => {
|
|
2575
2714
|
if (hoverEvent) {
|
|
2576
2715
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
|
|
2577
2716
|
}
|
|
2578
2717
|
onMouseEnter?.(e);
|
|
2579
2718
|
}, [hoverEvent, eventBus, onMouseEnter]);
|
|
2580
|
-
const handleMouseLeave =
|
|
2719
|
+
const handleMouseLeave = React3.useCallback((e) => {
|
|
2581
2720
|
if (hoverEvent) {
|
|
2582
2721
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
2583
2722
|
}
|
|
@@ -2585,19 +2724,19 @@ var Box = React6__default.default.forwardRef(
|
|
|
2585
2724
|
}, [hoverEvent, eventBus, onMouseLeave]);
|
|
2586
2725
|
const { triggerProps } = useTapReveal({
|
|
2587
2726
|
enabled: tapReveal && !!hoverEvent,
|
|
2588
|
-
onReveal:
|
|
2727
|
+
onReveal: React3.useCallback(() => {
|
|
2589
2728
|
if (hoverEvent) eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
|
|
2590
2729
|
}, [hoverEvent, eventBus]),
|
|
2591
|
-
onDismiss:
|
|
2730
|
+
onDismiss: React3.useCallback(() => {
|
|
2592
2731
|
if (hoverEvent) eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
2593
2732
|
}, [hoverEvent, eventBus])
|
|
2594
2733
|
});
|
|
2595
|
-
const handlePointerDown =
|
|
2734
|
+
const handlePointerDown = React3.useCallback((e) => {
|
|
2596
2735
|
if (hoverEvent && tapReveal) triggerProps.onPointerDown(e);
|
|
2597
2736
|
onPointerDown?.(e);
|
|
2598
2737
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
2599
2738
|
const isClickable = action || onClick;
|
|
2600
|
-
return
|
|
2739
|
+
return React3__default.default.createElement(
|
|
2601
2740
|
Component2,
|
|
2602
2741
|
{
|
|
2603
2742
|
ref,
|
|
@@ -2718,7 +2857,7 @@ var Typography = ({
|
|
|
2718
2857
|
}) => {
|
|
2719
2858
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
2720
2859
|
const Component2 = as || defaultElements[variant];
|
|
2721
|
-
return
|
|
2860
|
+
return React3__default.default.createElement(
|
|
2722
2861
|
Component2,
|
|
2723
2862
|
{
|
|
2724
2863
|
id,
|
|
@@ -2791,7 +2930,7 @@ var Stack = ({
|
|
|
2791
2930
|
};
|
|
2792
2931
|
const isHorizontal = direction === "horizontal";
|
|
2793
2932
|
const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
|
|
2794
|
-
return
|
|
2933
|
+
return React3__default.default.createElement(
|
|
2795
2934
|
Component2,
|
|
2796
2935
|
{
|
|
2797
2936
|
className: cn(
|
|
@@ -3538,10 +3677,10 @@ var Avl3DOrbitalNode = ({
|
|
|
3538
3677
|
position,
|
|
3539
3678
|
onClick
|
|
3540
3679
|
}) => {
|
|
3541
|
-
const groupRef =
|
|
3542
|
-
const [hovered, setHovered] =
|
|
3543
|
-
const scale =
|
|
3544
|
-
const currentScale =
|
|
3680
|
+
const groupRef = React3.useRef(null);
|
|
3681
|
+
const [hovered, setHovered] = React3.useState(false);
|
|
3682
|
+
const scale = React3.useMemo(() => 0.6 + Math.min(traitCount, 8) * 0.3, [traitCount]);
|
|
3683
|
+
const currentScale = React3.useRef(scale);
|
|
3545
3684
|
const targetScale = hovered ? scale * 1.06 : scale;
|
|
3546
3685
|
fiber.useFrame((_, delta) => {
|
|
3547
3686
|
if (!groupRef.current) return;
|
|
@@ -3683,7 +3822,7 @@ var Avl3DCrossWire = ({
|
|
|
3683
3822
|
eventName,
|
|
3684
3823
|
color = AVL_3D_COLORS.crossWire
|
|
3685
3824
|
}) => {
|
|
3686
|
-
const { tubeArgs, midpoint } =
|
|
3825
|
+
const { tubeArgs, midpoint } = React3.useMemo(() => {
|
|
3687
3826
|
const curve = arcCurve3D(from, to, 2);
|
|
3688
3827
|
const mid = curve.getPoint(0.5);
|
|
3689
3828
|
return {
|
|
@@ -3722,9 +3861,9 @@ var Avl3DApplicationScene = ({
|
|
|
3722
3861
|
data,
|
|
3723
3862
|
onOrbitalClick
|
|
3724
3863
|
}) => {
|
|
3725
|
-
const groupRef =
|
|
3726
|
-
const [, setHoverTrigger] =
|
|
3727
|
-
const orbitalPositions =
|
|
3864
|
+
const groupRef = React3.useRef(null);
|
|
3865
|
+
const [, setHoverTrigger] = React3.useState(0);
|
|
3866
|
+
const orbitalPositions = React3.useMemo(() => {
|
|
3728
3867
|
const baseRadius = Math.max(4, data.orbitals.length * 1.5);
|
|
3729
3868
|
if (data.crossLinks.length === 0) {
|
|
3730
3869
|
return goldenSpiralPositions(data.orbitals.length, baseRadius);
|
|
@@ -3737,7 +3876,7 @@ var Avl3DApplicationScene = ({
|
|
|
3737
3876
|
})).filter((e) => e.from >= 0 && e.to >= 0);
|
|
3738
3877
|
return forceDirectedPositions(data.orbitals.length, edges, baseRadius);
|
|
3739
3878
|
}, [data.orbitals, data.crossLinks]);
|
|
3740
|
-
const positionByName =
|
|
3879
|
+
const positionByName = React3.useMemo(() => {
|
|
3741
3880
|
const map = /* @__PURE__ */ new Map();
|
|
3742
3881
|
data.orbitals.forEach((orb, i) => {
|
|
3743
3882
|
const pos = orbitalPositions[i];
|
|
@@ -3820,7 +3959,7 @@ var Avl3DEntityCore = ({
|
|
|
3820
3959
|
position,
|
|
3821
3960
|
fields
|
|
3822
3961
|
}) => {
|
|
3823
|
-
const coreRef =
|
|
3962
|
+
const coreRef = React3.useRef(null);
|
|
3824
3963
|
fiber.useFrame((_, delta) => {
|
|
3825
3964
|
if (!coreRef.current) return;
|
|
3826
3965
|
coreRef.current.rotation.y += delta * 0.3;
|
|
@@ -3973,8 +4112,8 @@ function TraitOrbit({
|
|
|
3973
4112
|
onClick,
|
|
3974
4113
|
onHover
|
|
3975
4114
|
}) {
|
|
3976
|
-
const groupRef =
|
|
3977
|
-
const angleRef =
|
|
4115
|
+
const groupRef = React3.useRef(null);
|
|
4116
|
+
const angleRef = React3.useRef(Math.random() * Math.PI * 2);
|
|
3978
4117
|
fiber.useFrame((_, delta) => {
|
|
3979
4118
|
angleRef.current += delta * speed;
|
|
3980
4119
|
if (!groupRef.current) return;
|
|
@@ -4105,9 +4244,9 @@ var Avl3DOrbitalScene = ({
|
|
|
4105
4244
|
highlightedTrait,
|
|
4106
4245
|
onTraitHighlight
|
|
4107
4246
|
}) => {
|
|
4108
|
-
const [localHighlight, setLocalHighlight] =
|
|
4247
|
+
const [localHighlight, setLocalHighlight] = React3.useState(null);
|
|
4109
4248
|
const activeHighlight = highlightedTrait ?? localHighlight;
|
|
4110
|
-
const traitOrbits =
|
|
4249
|
+
const traitOrbits = React3.useMemo(() => {
|
|
4111
4250
|
return data.traits.map((trait, i) => ({
|
|
4112
4251
|
name: trait.name,
|
|
4113
4252
|
radius: 3 + i * 1.2,
|
|
@@ -4118,7 +4257,7 @@ var Avl3DOrbitalScene = ({
|
|
|
4118
4257
|
transitionCount: trait.transitionCount
|
|
4119
4258
|
}));
|
|
4120
4259
|
}, [data.traits]);
|
|
4121
|
-
const pagePositions =
|
|
4260
|
+
const pagePositions = React3.useMemo(() => {
|
|
4122
4261
|
const outerRadius = 3 + data.traits.length * 1.2 + 1.5;
|
|
4123
4262
|
return data.pages.map((_, i) => {
|
|
4124
4263
|
const angle = 2 * Math.PI * i / data.pages.length - Math.PI / 2;
|
|
@@ -4182,12 +4321,12 @@ var Avl3DStateNode = ({
|
|
|
4182
4321
|
outgoingCount = 0,
|
|
4183
4322
|
onClick
|
|
4184
4323
|
}) => {
|
|
4185
|
-
const [hovered, setHovered] =
|
|
4324
|
+
const [hovered, setHovered] = React3.useState(false);
|
|
4186
4325
|
const baseColor = active ? AVL_3D_COLORS.stateActive : AVL_3D_COLORS.stateIdle;
|
|
4187
4326
|
const emissiveColor = active ? AVL_3D_COLORS.stateActive : AVL_3D_COLORS.stateEdge;
|
|
4188
4327
|
const emissiveIntensity = active ? 2 : hovered ? 0.8 : 0.3;
|
|
4189
4328
|
const targetScale = hovered ? 1.08 : 1;
|
|
4190
|
-
const currentScale =
|
|
4329
|
+
const currentScale = React3.useRef(1);
|
|
4191
4330
|
fiber.useFrame((_, delta) => {
|
|
4192
4331
|
currentScale.current = THREE9.MathUtils.damp(currentScale.current, targetScale, 6, delta);
|
|
4193
4332
|
});
|
|
@@ -4361,8 +4500,8 @@ var Avl3DTransitionArc = ({
|
|
|
4361
4500
|
onClick,
|
|
4362
4501
|
color = AVL_3D_COLORS.transitionArc
|
|
4363
4502
|
}) => {
|
|
4364
|
-
const [hovered, setHovered] =
|
|
4365
|
-
const { tubeArgs, labelPos, guardPos, arrowPos, arrowQuat, effectPositions } =
|
|
4503
|
+
const [hovered, setHovered] = React3.useState(false);
|
|
4504
|
+
const { tubeArgs, labelPos, guardPos, arrowPos, arrowQuat, effectPositions } = React3.useMemo(() => {
|
|
4366
4505
|
const offset = 1.5 + index * 0.8;
|
|
4367
4506
|
const curve = isSelf ? selfLoopCurve3D(from, 1.2) : arcCurve3D(from, to, offset);
|
|
4368
4507
|
const mid = curve.getPoint(0.5);
|
|
@@ -4495,7 +4634,7 @@ var Avl3DTraitScene = ({
|
|
|
4495
4634
|
data,
|
|
4496
4635
|
onTransitionClick
|
|
4497
4636
|
}) => {
|
|
4498
|
-
const statePositions =
|
|
4637
|
+
const statePositions = React3.useMemo(() => {
|
|
4499
4638
|
const radius = Math.max(3, data.states.length * 0.8);
|
|
4500
4639
|
const positions = fibonacciSpherePositions(data.states.length, radius);
|
|
4501
4640
|
const posMap = /* @__PURE__ */ new Map();
|
|
@@ -4505,7 +4644,7 @@ var Avl3DTraitScene = ({
|
|
|
4505
4644
|
});
|
|
4506
4645
|
return posMap;
|
|
4507
4646
|
}, [data.states]);
|
|
4508
|
-
const transitionIndices =
|
|
4647
|
+
const transitionIndices = React3.useMemo(() => {
|
|
4509
4648
|
const pairCount = /* @__PURE__ */ new Map();
|
|
4510
4649
|
return data.transitions.map((t) => {
|
|
4511
4650
|
const key = `${t.from}->${t.to}`;
|
|
@@ -4514,7 +4653,7 @@ var Avl3DTraitScene = ({
|
|
|
4514
4653
|
return idx;
|
|
4515
4654
|
});
|
|
4516
4655
|
}, [data.transitions]);
|
|
4517
|
-
const transitionCounts =
|
|
4656
|
+
const transitionCounts = React3.useMemo(() => {
|
|
4518
4657
|
const incoming = /* @__PURE__ */ new Map();
|
|
4519
4658
|
const outgoing = /* @__PURE__ */ new Map();
|
|
4520
4659
|
for (const t of data.transitions) {
|
|
@@ -4624,11 +4763,11 @@ var Avl3DExprTree = ({
|
|
|
4624
4763
|
expression,
|
|
4625
4764
|
position
|
|
4626
4765
|
}) => {
|
|
4627
|
-
const layoutResults =
|
|
4766
|
+
const layoutResults = React3.useMemo(() => {
|
|
4628
4767
|
const origin = { x: position[0], y: position[1], z: position[2] };
|
|
4629
4768
|
return treeLayout3D(expression, origin, 2.5, 1.5);
|
|
4630
4769
|
}, [expression, position]);
|
|
4631
|
-
const edges =
|
|
4770
|
+
const edges = React3.useMemo(() => {
|
|
4632
4771
|
const result = [];
|
|
4633
4772
|
function collectEdges(node, parentPos) {
|
|
4634
4773
|
const entry = layoutResults.find((r) => r.node === node);
|
|
@@ -4908,7 +5047,7 @@ var Avl3DEffects = ({
|
|
|
4908
5047
|
const dof = DOF_CONFIG[level];
|
|
4909
5048
|
const sparkles = SPARKLE_CONFIGS[level];
|
|
4910
5049
|
const stars = STARS_CONFIG[level];
|
|
4911
|
-
const starsKey =
|
|
5050
|
+
const starsKey = React3.useMemo(() => `stars-${level}`, [level]);
|
|
4912
5051
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4913
5052
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4914
5053
|
drei.Stars,
|
|
@@ -4972,16 +5111,16 @@ var DEFAULT_CONFIG2 = {
|
|
|
4972
5111
|
modelOverrides: {},
|
|
4973
5112
|
effectsEnabled: true
|
|
4974
5113
|
};
|
|
4975
|
-
var Avl3DContext =
|
|
5114
|
+
var Avl3DContext = React3.createContext(DEFAULT_CONFIG2);
|
|
4976
5115
|
function useAvl3DConfig() {
|
|
4977
|
-
return
|
|
5116
|
+
return React3.useContext(Avl3DContext);
|
|
4978
5117
|
}
|
|
4979
5118
|
function CameraController({ targetPosition, targetLookAt, animated }) {
|
|
4980
5119
|
const { camera } = fiber.useThree();
|
|
4981
|
-
const targetPosVec =
|
|
4982
|
-
const targetLookVec =
|
|
4983
|
-
const isAnimating =
|
|
4984
|
-
|
|
5120
|
+
const targetPosVec = React3.useRef(new THREE9__namespace.Vector3(...targetPosition));
|
|
5121
|
+
const targetLookVec = React3.useRef(new THREE9__namespace.Vector3(...targetLookAt));
|
|
5122
|
+
const isAnimating = React3.useRef(false);
|
|
5123
|
+
React3.useEffect(() => {
|
|
4985
5124
|
const newTarget = new THREE9__namespace.Vector3(...targetPosition);
|
|
4986
5125
|
const newLookAt = new THREE9__namespace.Vector3(...targetLookAt);
|
|
4987
5126
|
if (!newTarget.equals(targetPosVec.current) || !newLookAt.equals(targetLookVec.current)) {
|
|
@@ -5010,8 +5149,8 @@ function CameraController({ targetPosition, targetLookAt, animated }) {
|
|
|
5010
5149
|
return null;
|
|
5011
5150
|
}
|
|
5012
5151
|
function SceneFade({ animating, children }) {
|
|
5013
|
-
const groupRef =
|
|
5014
|
-
const opacityRef =
|
|
5152
|
+
const groupRef = React3.useRef(null);
|
|
5153
|
+
const opacityRef = React3.useRef(1);
|
|
5015
5154
|
fiber.useFrame((_, delta) => {
|
|
5016
5155
|
if (!groupRef.current) return;
|
|
5017
5156
|
const target = animating ? 0 : 1;
|
|
@@ -5035,7 +5174,7 @@ var Avl3DViewer = ({
|
|
|
5035
5174
|
modelOverrides = {}
|
|
5036
5175
|
}) => {
|
|
5037
5176
|
const { t } = hooks.useTranslate();
|
|
5038
|
-
const schema =
|
|
5177
|
+
const schema = React3.useMemo(() => {
|
|
5039
5178
|
if (typeof schemaProp === "string") {
|
|
5040
5179
|
try {
|
|
5041
5180
|
return JSON.parse(schemaProp);
|
|
@@ -5045,12 +5184,12 @@ var Avl3DViewer = ({
|
|
|
5045
5184
|
}
|
|
5046
5185
|
return schemaProp;
|
|
5047
5186
|
}, [schemaProp]);
|
|
5048
|
-
const configValue =
|
|
5187
|
+
const configValue = React3.useMemo(() => ({
|
|
5049
5188
|
modelOverrides,
|
|
5050
5189
|
effectsEnabled: effects
|
|
5051
5190
|
}), [modelOverrides, effects]);
|
|
5052
|
-
const [state, dispatch] =
|
|
5053
|
-
|
|
5191
|
+
const [state, dispatch] = React3.useReducer(zoomReducer, initialZoomState);
|
|
5192
|
+
React3.useEffect(() => {
|
|
5054
5193
|
if (initialOrbital) {
|
|
5055
5194
|
dispatch({ type: "ZOOM_INTO_ORBITAL", orbital: initialOrbital, targetPosition: { x: 0, y: 0 } });
|
|
5056
5195
|
setTimeout(() => dispatch({ type: "ANIMATION_COMPLETE" }), 0);
|
|
@@ -5062,35 +5201,35 @@ var Avl3DViewer = ({
|
|
|
5062
5201
|
}
|
|
5063
5202
|
}
|
|
5064
5203
|
}, [initialOrbital, initialTrait]);
|
|
5065
|
-
|
|
5204
|
+
React3.useEffect(() => {
|
|
5066
5205
|
onZoomChange?.(state.level, {
|
|
5067
5206
|
orbital: state.selectedOrbital ?? void 0,
|
|
5068
5207
|
trait: state.selectedTrait ?? void 0
|
|
5069
5208
|
});
|
|
5070
5209
|
}, [state.level, state.selectedOrbital, state.selectedTrait, onZoomChange]);
|
|
5071
|
-
|
|
5210
|
+
React3.useEffect(() => {
|
|
5072
5211
|
if (!state.animating) return;
|
|
5073
5212
|
const timer = setTimeout(() => {
|
|
5074
5213
|
dispatch({ type: "ANIMATION_COMPLETE" });
|
|
5075
5214
|
}, 800);
|
|
5076
5215
|
return () => clearTimeout(timer);
|
|
5077
5216
|
}, [state.animating]);
|
|
5078
|
-
const handleKeyDown =
|
|
5217
|
+
const handleKeyDown = React3.useCallback((e) => {
|
|
5079
5218
|
if (e.key === "Escape") {
|
|
5080
5219
|
dispatch({ type: "ZOOM_OUT" });
|
|
5081
5220
|
}
|
|
5082
5221
|
}, []);
|
|
5083
|
-
const handleOrbitalClick =
|
|
5222
|
+
const handleOrbitalClick = React3.useCallback((name) => {
|
|
5084
5223
|
dispatch({ type: "ZOOM_INTO_ORBITAL", orbital: name, targetPosition: { x: 0, y: 0 } });
|
|
5085
5224
|
}, []);
|
|
5086
|
-
const handleTraitClick =
|
|
5225
|
+
const handleTraitClick = React3.useCallback((name) => {
|
|
5087
5226
|
dispatch({ type: "ZOOM_INTO_TRAIT", trait: name, targetPosition: { x: 0, y: 0 } });
|
|
5088
5227
|
}, []);
|
|
5089
|
-
const [highlightedTrait, setHighlightedTrait] =
|
|
5090
|
-
const handleTransitionClick =
|
|
5228
|
+
const [highlightedTrait, setHighlightedTrait] = React3__default.default.useState(null);
|
|
5229
|
+
const handleTransitionClick = React3.useCallback((index) => {
|
|
5091
5230
|
dispatch({ type: "ZOOM_INTO_TRANSITION", transitionIndex: index, targetPosition: { x: 0, y: 0 } });
|
|
5092
5231
|
}, []);
|
|
5093
|
-
const handleBreadcrumbClick =
|
|
5232
|
+
const handleBreadcrumbClick = React3.useCallback((targetLevel) => {
|
|
5094
5233
|
const levelOrder = ["application", "orbital", "trait", "transition"];
|
|
5095
5234
|
const currentIdx = levelOrder.indexOf(state.level);
|
|
5096
5235
|
const targetIdx = levelOrder.indexOf(targetLevel);
|
|
@@ -5099,7 +5238,7 @@ var Avl3DViewer = ({
|
|
|
5099
5238
|
}
|
|
5100
5239
|
}, [state.level]);
|
|
5101
5240
|
const cameraConfig = CAMERA_POSITIONS[state.level];
|
|
5102
|
-
const sceneContent =
|
|
5241
|
+
const sceneContent = React3.useMemo(() => {
|
|
5103
5242
|
switch (state.level) {
|
|
5104
5243
|
case "application": {
|
|
5105
5244
|
const data = parseApplicationLevel(schema);
|
|
@@ -5173,7 +5312,7 @@ var Avl3DViewer = ({
|
|
|
5173
5312
|
gap: "xs",
|
|
5174
5313
|
align: "center",
|
|
5175
5314
|
className: "absolute top-2 left-2 z-10 bg-surface/80 backdrop-blur rounded-md px-3 py-1.5",
|
|
5176
|
-
children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5315
|
+
children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxRuntime.jsxs(React3__default.default.Fragment, { children: [
|
|
5177
5316
|
i > 0 && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", color: "muted", className: "mx-1", children: "/" }),
|
|
5178
5317
|
i < breadcrumbs.length - 1 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5179
5318
|
Box,
|