@almadar/ui 5.111.0 → 5.113.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 +137 -18
- package/dist/avl/index.js +139 -20
- package/dist/avl-schema-parser-B8Onmfsu.d.cts +393 -0
- package/dist/avl-schema-parser-B8Onmfsu.d.ts +393 -0
- package/dist/cn-BkQrMR01.d.cts +295 -0
- package/dist/cn-CTEFm9PC.d.ts +295 -0
- package/dist/components/index.cjs +33 -6
- package/dist/components/index.d.cts +11225 -0
- package/dist/components/index.d.ts +11225 -6
- package/dist/components/index.js +33 -6
- 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 +11 -24
- package/dist/lib/drawable/three/index.d.cts +1485 -0
- package/dist/lib/drawable/three/index.d.ts +1484 -38
- package/dist/lib/drawable/three/index.js +11 -24
- package/dist/lib/index.d.cts +505 -0
- package/dist/lib/index.d.ts +504 -18
- 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/paintDispatch-DR942knx.d.cts +221 -0
- package/dist/paintDispatch-DR942knx.d.ts +221 -0
- package/dist/providers/index.cjs +33 -6
- package/dist/providers/index.d.cts +428 -0
- package/dist/providers/index.d.ts +427 -26
- package/dist/providers/index.js +33 -6
- 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 +137 -18
- package/dist/runtime/index.d.cts +426 -0
- package/dist/runtime/index.d.ts +421 -16
- package/dist/runtime/index.js +139 -20
- 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 +11 -11
- 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 -97
- 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
package/dist/runtime/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
11
11
|
import { createPortal } from 'react-dom';
|
|
12
12
|
import { useTranslate } from '@almadar/ui/hooks';
|
|
13
13
|
import { useUISlots, UISlotProvider, useTheme } from '@almadar/ui/context';
|
|
14
|
-
import { evaluateGuard, createMinimalContext, executeEffects
|
|
14
|
+
import { evaluateGuard, evaluate, createMinimalContext, executeEffects } from '@almadar/evaluator';
|
|
15
15
|
import { Link, Outlet, useLocation } from 'react-router-dom';
|
|
16
16
|
import ELK from 'elkjs/lib/elk.bundled.js';
|
|
17
17
|
import SyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-light.js';
|
|
@@ -42,8 +42,8 @@ import { DndContext, pointerWithin, rectIntersection, closestCorners, useSensors
|
|
|
42
42
|
import { useSortable, arrayMove, sortableKeyboardCoordinates, SortableContext, rectSortingStrategy, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
43
43
|
import { CSS } from '@dnd-kit/utilities';
|
|
44
44
|
import { useNodeId, ReactFlowProvider, Handle, Position } from '@xyflow/react';
|
|
45
|
-
import { getPatternDefinition, getComponentForPattern as getComponentForPattern$1 } from '@almadar/patterns';
|
|
46
|
-
import { StateMachineManager, collectDeclaredConfigDefaults, createServerEffectHandlers, EffectExecutor, createContextFromBindings, createTickScheduler, isValidCronExpression, parseDurationString, InMemoryPersistence } from '@almadar/runtime';
|
|
45
|
+
import { isDrawHostPattern, getPatternDefinition, getComponentForPattern as getComponentForPattern$1 } from '@almadar/core/patterns';
|
|
46
|
+
import { StateMachineManager, collectDeclaredConfigDefaults, createServerEffectHandlers, EffectExecutor, createContextFromBindings, createTickScheduler, isValidCronExpression, parseDurationString, InMemoryPersistence, normalizeCallSiteConfigToValues } from '@almadar/runtime';
|
|
47
47
|
import { OrbitalServerRuntime } from '@almadar/runtime/OrbitalServerRuntime';
|
|
48
48
|
|
|
49
49
|
var __defProp = Object.defineProperty;
|
|
@@ -9228,8 +9228,12 @@ var init_MiniMap = __esm({
|
|
|
9228
9228
|
MiniMap.displayName = "MiniMap";
|
|
9229
9229
|
}
|
|
9230
9230
|
});
|
|
9231
|
-
function useCamera() {
|
|
9232
|
-
const cameraRef = useRef({
|
|
9231
|
+
function useCamera(initial) {
|
|
9232
|
+
const cameraRef = useRef({
|
|
9233
|
+
x: initial?.x ?? 0,
|
|
9234
|
+
y: initial?.y ?? 0,
|
|
9235
|
+
zoom: initial?.zoom ?? 1
|
|
9236
|
+
});
|
|
9233
9237
|
const targetCameraRef = useRef(null);
|
|
9234
9238
|
const isDraggingRef = useRef(false);
|
|
9235
9239
|
const dragDistanceRef = useRef(0);
|
|
@@ -9798,8 +9802,18 @@ function Canvas2D({
|
|
|
9798
9802
|
scale = 0.4,
|
|
9799
9803
|
showMinimap = true,
|
|
9800
9804
|
followTarget,
|
|
9805
|
+
cameraPos,
|
|
9801
9806
|
bgColor
|
|
9802
9807
|
}) {
|
|
9808
|
+
const instanceId = useMemo(() => Math.random().toString(36).slice(2, 8), []);
|
|
9809
|
+
function isDrawableLayer(node) {
|
|
9810
|
+
return node.type === "draw-sprite-layer" || node.type === "draw-shape-layer" || node.type === "draw-text-layer";
|
|
9811
|
+
}
|
|
9812
|
+
const layerSummaries = drawables?.map((d) => {
|
|
9813
|
+
if (!isDrawableLayer(d)) return { type: d.type };
|
|
9814
|
+
return { type: d.type, itemsLen: d.items.length, firstItem: d.items[0] };
|
|
9815
|
+
});
|
|
9816
|
+
canvas2DLog.debug("Canvas2D render", { instanceId, projection, scale, cameraMode: camera, cameraPos: cameraPos ? JSON.stringify(cameraPos) : void 0, drawablesCount: drawables?.length, layerSummaries: layerSummaries ? JSON.stringify(layerSummaries) : void 0 });
|
|
9803
9817
|
const backgroundImage = normalizeBackdrop(backgroundImageRaw);
|
|
9804
9818
|
const isFree = projection === "free";
|
|
9805
9819
|
const squareGrid = projection === "flat" || isFree || projection === "side";
|
|
@@ -9882,7 +9896,7 @@ function Canvas2D({
|
|
|
9882
9896
|
zoomAtPoint,
|
|
9883
9897
|
screenToWorld,
|
|
9884
9898
|
lerpToTarget
|
|
9885
|
-
} = useCamera();
|
|
9899
|
+
} = useCamera({ zoom: scale });
|
|
9886
9900
|
const [atlasVersion, setAtlasVersion] = useState(0);
|
|
9887
9901
|
const bumpAtlas = useCallback(() => setAtlasVersion((v) => v + 1), []);
|
|
9888
9902
|
const miniMapTiles = useMemo(() => {
|
|
@@ -9928,6 +9942,14 @@ function Canvas2D({
|
|
|
9928
9942
|
}
|
|
9929
9943
|
if (!drawables || drawables.length === 0) return;
|
|
9930
9944
|
const cam = cameraRef.current;
|
|
9945
|
+
if (cameraPos && dragDistance() === 0) {
|
|
9946
|
+
const p = projector.anchorPoint(cameraPos, "center");
|
|
9947
|
+
cam.x = p.x - viewportSize.width / 2;
|
|
9948
|
+
cam.y = p.y - viewportSize.height / 2;
|
|
9949
|
+
}
|
|
9950
|
+
const containerRect = containerRef.current?.getBoundingClientRect();
|
|
9951
|
+
const canvasRect = canvas.getBoundingClientRect();
|
|
9952
|
+
canvas2DLog.debug("Canvas2D draw", { instanceId, viewportSize, baseOffsetX, cam: { x: cam.x, y: cam.y, zoom: cam.zoom }, cameraPos: cameraPos ? JSON.stringify(cameraPos) : void 0, containerRect: containerRect ? { width: containerRect.width, height: containerRect.height } : null, canvasRect: canvasRect ? { width: canvasRect.width, height: canvasRect.height } : null });
|
|
9931
9953
|
const painter = createWebPainter(ctx, bumpAtlas);
|
|
9932
9954
|
painter.save();
|
|
9933
9955
|
painter.translate(viewportSize.width / 2, viewportSize.height / 2);
|
|
@@ -10139,6 +10161,7 @@ function Canvas2D({
|
|
|
10139
10161
|
}
|
|
10140
10162
|
);
|
|
10141
10163
|
}
|
|
10164
|
+
var canvas2DLog;
|
|
10142
10165
|
var init_Canvas2D = __esm({
|
|
10143
10166
|
"components/game/molecules/Canvas2D.tsx"() {
|
|
10144
10167
|
"use client";
|
|
@@ -10160,6 +10183,7 @@ var init_Canvas2D = __esm({
|
|
|
10160
10183
|
init_paintDispatch();
|
|
10161
10184
|
init_hitTest();
|
|
10162
10185
|
init_isometric();
|
|
10186
|
+
canvas2DLog = createLogger("almadar:ui:game-canvas");
|
|
10163
10187
|
Canvas2D.displayName = "Canvas2D";
|
|
10164
10188
|
}
|
|
10165
10189
|
});
|
|
@@ -10198,6 +10222,7 @@ function Canvas({
|
|
|
10198
10222
|
keyMap,
|
|
10199
10223
|
keyUpMap
|
|
10200
10224
|
}) {
|
|
10225
|
+
canvasLog.debug("Canvas render", { mode, drawablesCount: drawables?.length, projection, camera: camera ? JSON.stringify(camera) : void 0 });
|
|
10201
10226
|
const zoom = camera?.zoom;
|
|
10202
10227
|
if (mode === "3d") {
|
|
10203
10228
|
const props3d = {
|
|
@@ -10237,6 +10262,7 @@ function Canvas({
|
|
|
10237
10262
|
camera: to2DCamera(camera?.mode),
|
|
10238
10263
|
...zoom !== void 0 ? { scale: zoom } : {},
|
|
10239
10264
|
...camera?.target !== void 0 ? { followTarget: camera.target } : {},
|
|
10265
|
+
...camera?.pos !== void 0 ? { cameraPos: camera.pos } : {},
|
|
10240
10266
|
showMinimap,
|
|
10241
10267
|
backgroundImage,
|
|
10242
10268
|
...backgroundColor !== void 0 ? { bgColor: backgroundColor } : {},
|
|
@@ -10249,7 +10275,7 @@ function Canvas({
|
|
|
10249
10275
|
}
|
|
10250
10276
|
);
|
|
10251
10277
|
}
|
|
10252
|
-
var Canvas3DHost;
|
|
10278
|
+
var Canvas3DHost, canvasLog;
|
|
10253
10279
|
var init_Canvas = __esm({
|
|
10254
10280
|
"components/game/molecules/Canvas.tsx"() {
|
|
10255
10281
|
"use client";
|
|
@@ -10257,6 +10283,7 @@ var init_Canvas = __esm({
|
|
|
10257
10283
|
Canvas3DHost = lazy(
|
|
10258
10284
|
() => import('@almadar/ui/components/molecules/game/three').then((m) => ({ default: m.Canvas3DHost }))
|
|
10259
10285
|
);
|
|
10286
|
+
canvasLog = createLogger("almadar:ui:game-canvas");
|
|
10260
10287
|
Canvas.displayName = "Canvas";
|
|
10261
10288
|
}
|
|
10262
10289
|
});
|
|
@@ -43651,7 +43678,7 @@ function SlotContentRenderer({
|
|
|
43651
43678
|
const childrenConfig = content.props.children;
|
|
43652
43679
|
const isSingleChild = typeof childrenConfig === "string" || typeof childrenConfig === "object" && childrenConfig !== null && !Array.isArray(childrenConfig) && "type" in childrenConfig;
|
|
43653
43680
|
const hasChildren = PATTERNS_WITH_CHILDREN.has(content.pattern) || Array.isArray(childrenConfig) && childrenConfig.length > 0 || isSingleChild;
|
|
43654
|
-
const isDrawHost =
|
|
43681
|
+
const isDrawHost = isDrawHostPattern(content.pattern);
|
|
43655
43682
|
const myPath = patternPath ?? "root";
|
|
43656
43683
|
const renderedChildren = hasChildren && !isDrawHost ? renderPatternChildren(childrenConfig, onDismiss, content.id, myPath, content.sourceTrait, {
|
|
43657
43684
|
slot: content.slot,
|
|
@@ -44170,6 +44197,8 @@ var flushLog = createLogger("almadar:ui:slot-flush");
|
|
|
44170
44197
|
var stateLog = createLogger("almadar:ui:state-transitions");
|
|
44171
44198
|
var tickLog = createLogger("almadar:ui:tick-effects");
|
|
44172
44199
|
setNamespaceLevel("almadar:ui:tick-effects", "WARN");
|
|
44200
|
+
var sharedEntityLog = createLogger("almadar:ui:shared-entity");
|
|
44201
|
+
setNamespaceLevel("almadar:ui:shared-entity", "WARN");
|
|
44173
44202
|
var SYNC_TICK_OPERATORS = /* @__PURE__ */ new Set([
|
|
44174
44203
|
"set",
|
|
44175
44204
|
"emit",
|
|
@@ -44222,6 +44251,14 @@ function effectsCallOp(effects, ops) {
|
|
|
44222
44251
|
}
|
|
44223
44252
|
return false;
|
|
44224
44253
|
}
|
|
44254
|
+
function classifySharedTick(tick) {
|
|
44255
|
+
const writes = effectsCallOp(tick.effects, SHARED_ENTITY_WRITE_OPS);
|
|
44256
|
+
const renders = effectsCallOp(tick.effects, SHARED_ENTITY_RENDER_OPS);
|
|
44257
|
+
if (writes && renders) return "both";
|
|
44258
|
+
if (writes) return "writer";
|
|
44259
|
+
if (renders) return "renderer";
|
|
44260
|
+
return "neither";
|
|
44261
|
+
}
|
|
44225
44262
|
function createSharedEntityWriter(binding, tick, traitStatesRef, emit) {
|
|
44226
44263
|
return (scratch) => {
|
|
44227
44264
|
const traitName = binding.trait.name;
|
|
@@ -44231,7 +44268,7 @@ function createSharedEntityWriter(binding, tick, traitStatesRef, emit) {
|
|
|
44231
44268
|
const writes = [];
|
|
44232
44269
|
const ctx = createMinimalContext(scratchEntity, {}, currentState);
|
|
44233
44270
|
const declaredDefaults = collectDeclaredConfigDefaults(binding.trait);
|
|
44234
|
-
const callSiteConfig = binding
|
|
44271
|
+
const callSiteConfig = getBindingConfig(binding);
|
|
44235
44272
|
if (declaredDefaults || callSiteConfig) {
|
|
44236
44273
|
ctx.config = { ...declaredDefaults ?? {}, ...callSiteConfig ?? {} };
|
|
44237
44274
|
}
|
|
@@ -44253,7 +44290,25 @@ function createSharedEntityWriter(binding, tick, traitStatesRef, emit) {
|
|
|
44253
44290
|
return writes;
|
|
44254
44291
|
};
|
|
44255
44292
|
}
|
|
44293
|
+
function getBindingConfig(binding) {
|
|
44294
|
+
const raw = binding.config;
|
|
44295
|
+
const normalized = normalizeCallSiteConfigToValues(raw);
|
|
44296
|
+
sharedEntityLog.debug("getBindingConfig", { traitName: binding.trait.name, rawKeys: raw ? Object.keys(raw) : void 0, hasTiles: raw ? "tiles" in raw : false });
|
|
44297
|
+
return normalized;
|
|
44298
|
+
}
|
|
44299
|
+
function evalFieldDefault(value) {
|
|
44300
|
+
if (!Array.isArray(value) || value.length === 0) return value;
|
|
44301
|
+
const head = value[0];
|
|
44302
|
+
const isSExpr = typeof head === "string" && (head.includes("/") || head === "let" || head === "if" || head === "lambda");
|
|
44303
|
+
if (!isSExpr) return value;
|
|
44304
|
+
try {
|
|
44305
|
+
return evaluate(value, createMinimalContext({}, {}, ""));
|
|
44306
|
+
} catch {
|
|
44307
|
+
return value;
|
|
44308
|
+
}
|
|
44309
|
+
}
|
|
44256
44310
|
function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
44311
|
+
sharedEntityLog.debug("useTraitStateMachine start", { traitBindingsCount: traitBindings.length, traitNames: traitBindings.map((b) => b.trait.name) });
|
|
44257
44312
|
const eventBus = useEventBus();
|
|
44258
44313
|
const { entities } = useEntitySchema();
|
|
44259
44314
|
const traitConfigsByName = options?.traitConfigsByName;
|
|
@@ -44272,8 +44327,17 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
44272
44327
|
if (!group) {
|
|
44273
44328
|
let defaults;
|
|
44274
44329
|
for (const field of entityDef.fields) {
|
|
44275
|
-
if (field.default !== void 0) {
|
|
44276
|
-
|
|
44330
|
+
if (field.default !== void 0 && field.default !== null) {
|
|
44331
|
+
const evaluated = evalFieldDefault(field.default);
|
|
44332
|
+
if (field.name === "tiles") {
|
|
44333
|
+
sharedEntityLog.debug("seed tiles", {
|
|
44334
|
+
linkedEntityName,
|
|
44335
|
+
type: typeof evaluated,
|
|
44336
|
+
length: Array.isArray(evaluated) ? evaluated?.length : void 0,
|
|
44337
|
+
head: Array.isArray(evaluated) && evaluated.length > 0 ? JSON.stringify(evaluated[0]).slice(0, 80) : void 0
|
|
44338
|
+
});
|
|
44339
|
+
}
|
|
44340
|
+
(defaults ?? (defaults = {}))[field.name] = evaluated;
|
|
44277
44341
|
}
|
|
44278
44342
|
}
|
|
44279
44343
|
group = { storeKey, entityName: linkedEntityName, writerBindings: [], renderBindings: [], defaults };
|
|
@@ -44286,7 +44350,15 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
44286
44350
|
return groups;
|
|
44287
44351
|
}, [traitBindings, entities, orbitalsByTrait]);
|
|
44288
44352
|
for (const group of sharedGroups.values()) {
|
|
44289
|
-
if (group.defaults)
|
|
44353
|
+
if (group.defaults) {
|
|
44354
|
+
sharedEntityStore.seed(group.storeKey, group.defaults);
|
|
44355
|
+
sharedEntityLog.debug("shared-seed", {
|
|
44356
|
+
storeKey: group.storeKey,
|
|
44357
|
+
writers: group.writerBindings.map((b) => b.trait.name),
|
|
44358
|
+
renderers: group.renderBindings.map((b) => b.trait.name),
|
|
44359
|
+
tilesLength: Array.isArray(group.defaults.tiles) ? group.defaults.tiles.length : group.defaults.tiles
|
|
44360
|
+
});
|
|
44361
|
+
}
|
|
44290
44362
|
}
|
|
44291
44363
|
const sharedKeyByTraitNameRef = useRef(/* @__PURE__ */ new Map());
|
|
44292
44364
|
useEffect(() => {
|
|
@@ -44296,12 +44368,13 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
44296
44368
|
for (const binding of group.renderBindings) map.set(binding.trait.name, group.storeKey);
|
|
44297
44369
|
}
|
|
44298
44370
|
sharedKeyByTraitNameRef.current = map;
|
|
44371
|
+
sharedEntityLog.debug("shared-map", { map: Array.from(map.entries()).map(([k, v]) => `${k}->${v}`) });
|
|
44299
44372
|
}, [sharedGroups]);
|
|
44300
44373
|
const manager = useMemo(() => {
|
|
44301
44374
|
const traitDefs = traitBindings.map(toTraitDefinition);
|
|
44302
44375
|
const m = new StateMachineManager(traitDefs);
|
|
44303
44376
|
for (const binding of traitBindings) {
|
|
44304
|
-
const cfg = binding
|
|
44377
|
+
const cfg = getBindingConfig(binding) ?? traitConfigsByName?.[binding.trait.name];
|
|
44305
44378
|
if (cfg !== void 0) {
|
|
44306
44379
|
m.setTraitConfig(binding.trait.name, cfg);
|
|
44307
44380
|
}
|
|
@@ -44484,6 +44557,9 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
44484
44557
|
const linkedEntity = binding.linkedEntity || "";
|
|
44485
44558
|
const entityId = payload?.entityId;
|
|
44486
44559
|
const sharedKey = sharedKeyByTraitNameRef.current.get(traitName);
|
|
44560
|
+
if (traitName === "Hero" || traitName === "Authority") {
|
|
44561
|
+
sharedEntityLog.debug("executeTransitionEffects sharedKey", { traitName, sharedKey, storeTilesLength: sharedKey ? sharedEntityStore.getSnapshot(sharedKey).tiles?.length : void 0 });
|
|
44562
|
+
}
|
|
44487
44563
|
let liveEntity;
|
|
44488
44564
|
if (sharedKey !== void 0) {
|
|
44489
44565
|
liveEntity = { ...sharedEntityStore.getSnapshot(sharedKey) };
|
|
@@ -44507,6 +44583,18 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
44507
44583
|
eventBus,
|
|
44508
44584
|
slotSetter: {
|
|
44509
44585
|
addPattern: (slot, pattern, props) => {
|
|
44586
|
+
if (traitName === "Hero" && slot === "main" && props && typeof props === "object") {
|
|
44587
|
+
const canvasChild = Array.isArray(props.children) ? props.children[0] : null;
|
|
44588
|
+
const grandChildren = canvasChild && typeof canvasChild === "object" && !Array.isArray(canvasChild) ? canvasChild.children : null;
|
|
44589
|
+
const firstLayer = Array.isArray(grandChildren) && grandChildren.length > 0 ? grandChildren[0] : null;
|
|
44590
|
+
const firstLayerItems = firstLayer && typeof firstLayer === "object" && !Array.isArray(firstLayer) ? firstLayer.items : null;
|
|
44591
|
+
sharedEntityLog.debug("render-ui main slot", {
|
|
44592
|
+
traitName,
|
|
44593
|
+
slot,
|
|
44594
|
+
canvasChildType: canvasChild && typeof canvasChild === "object" && !Array.isArray(canvasChild) ? canvasChild.type : "none",
|
|
44595
|
+
firstLayerItemsLength: Array.isArray(firstLayerItems) ? firstLayerItems.length : firstLayerItems
|
|
44596
|
+
});
|
|
44597
|
+
}
|
|
44510
44598
|
const existing = pendingSlots.get(slot) || [];
|
|
44511
44599
|
existing.push({ pattern, props: props || {} });
|
|
44512
44600
|
pendingSlots.set(slot, existing);
|
|
@@ -44538,7 +44626,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
44538
44626
|
state: previousState
|
|
44539
44627
|
};
|
|
44540
44628
|
const sharedDeclared = collectDeclaredConfigDefaults(binding.trait);
|
|
44541
|
-
const sharedCallSite = binding
|
|
44629
|
+
const sharedCallSite = getBindingConfig(binding);
|
|
44542
44630
|
if (sharedDeclared || sharedCallSite) {
|
|
44543
44631
|
sharedBindings.config = {
|
|
44544
44632
|
...sharedDeclared ?? {},
|
|
@@ -44589,13 +44677,21 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
44589
44677
|
state: previousState
|
|
44590
44678
|
};
|
|
44591
44679
|
const declaredDefaults = collectDeclaredConfigDefaults(binding.trait);
|
|
44592
|
-
const callSiteConfig = binding
|
|
44680
|
+
const callSiteConfig = getBindingConfig(binding);
|
|
44593
44681
|
if (declaredDefaults || callSiteConfig) {
|
|
44594
44682
|
bindingCtx.config = {
|
|
44595
44683
|
...declaredDefaults ?? {},
|
|
44596
44684
|
...callSiteConfig ?? {}
|
|
44597
44685
|
};
|
|
44598
44686
|
}
|
|
44687
|
+
if (traitName === "Authority" || traitName === "Hero") {
|
|
44688
|
+
sharedEntityLog.debug("executeTransitionEffects config tiles", {
|
|
44689
|
+
traitName,
|
|
44690
|
+
tilesType: typeof bindingCtx.config?.tiles,
|
|
44691
|
+
tilesLength: Array.isArray(bindingCtx.config?.tiles) ? bindingCtx.config?.tiles?.length : void 0,
|
|
44692
|
+
configKeys: bindingCtx.config ? Object.keys(bindingCtx.config) : void 0
|
|
44693
|
+
});
|
|
44694
|
+
}
|
|
44599
44695
|
const effectContext = {
|
|
44600
44696
|
traitName,
|
|
44601
44697
|
state: previousState,
|
|
@@ -44612,9 +44708,25 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
44612
44708
|
baseEmit(event, eventPayload, source);
|
|
44613
44709
|
}
|
|
44614
44710
|
};
|
|
44711
|
+
if (traitName === "Hero") {
|
|
44712
|
+
sharedEntityLog.debug("executeTransitionEffects effects summary", {
|
|
44713
|
+
traitName,
|
|
44714
|
+
effectsCount: effects.length,
|
|
44715
|
+
hasRenderUI: typeof handlers.renderUI === "function",
|
|
44716
|
+
effectHeads: effects.map((e) => Array.isArray(e) ? String(e[0]) : "??")
|
|
44717
|
+
});
|
|
44718
|
+
}
|
|
44615
44719
|
const executor = new EffectExecutor({ handlers: trackingHandlers, bindings: bindingCtx, context: effectContext });
|
|
44616
44720
|
try {
|
|
44617
44721
|
await executor.executeAll(effects);
|
|
44722
|
+
if (traitName === "Authority" || traitName === "Hero") {
|
|
44723
|
+
sharedEntityLog.debug("executeTransitionEffects after executeAll", {
|
|
44724
|
+
traitName,
|
|
44725
|
+
tilesType: typeof liveEntity.tiles,
|
|
44726
|
+
tilesLength: Array.isArray(liveEntity.tiles) ? liveEntity.tiles?.length : void 0,
|
|
44727
|
+
firstTilePos: Array.isArray(liveEntity.tiles) && liveEntity.tiles.length > 0 ? JSON.stringify(liveEntity.tiles[0]).slice(0, 120) : void 0
|
|
44728
|
+
});
|
|
44729
|
+
}
|
|
44618
44730
|
if (sharedKey !== void 0) {
|
|
44619
44731
|
sharedEntityStore.commit(sharedKey, liveEntity);
|
|
44620
44732
|
}
|
|
@@ -44665,8 +44777,9 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
44665
44777
|
payload: {},
|
|
44666
44778
|
state: currentState
|
|
44667
44779
|
};
|
|
44668
|
-
|
|
44669
|
-
|
|
44780
|
+
const bindingCfg = getBindingConfig(binding);
|
|
44781
|
+
if (bindingCfg) {
|
|
44782
|
+
guardCtx.config = bindingCfg;
|
|
44670
44783
|
}
|
|
44671
44784
|
const passed = evaluateGuard(
|
|
44672
44785
|
tick.guard,
|
|
@@ -44693,12 +44806,14 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
44693
44806
|
}, [eventBus]);
|
|
44694
44807
|
useEffect(() => {
|
|
44695
44808
|
const scheduler = createTickScheduler();
|
|
44696
|
-
const
|
|
44809
|
+
const pureWriterTickKeys = /* @__PURE__ */ new Set();
|
|
44697
44810
|
for (const group of sharedGroups.values()) {
|
|
44698
44811
|
const ticksByInterval = /* @__PURE__ */ new Map();
|
|
44699
44812
|
for (const binding of group.writerBindings) {
|
|
44700
|
-
writerTraitNames.add(binding.trait.name);
|
|
44701
44813
|
for (const tick of binding.trait.ticks ?? []) {
|
|
44814
|
+
const classification = classifySharedTick(tick);
|
|
44815
|
+
if (classification !== "writer") continue;
|
|
44816
|
+
pureWriterTickKeys.add(`${binding.trait.name}::${tick.name}`);
|
|
44702
44817
|
const intervalKey = String(tick.interval);
|
|
44703
44818
|
const entries = ticksByInterval.get(intervalKey) ?? [];
|
|
44704
44819
|
entries.push({ binding, tick });
|
|
@@ -44725,8 +44840,11 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
|
|
|
44725
44840
|
}
|
|
44726
44841
|
}
|
|
44727
44842
|
for (const binding of traitBindings) {
|
|
44728
|
-
if (writerTraitNames.has(binding.trait.name)) continue;
|
|
44729
44843
|
for (const tick of binding.trait.ticks ?? []) {
|
|
44844
|
+
const sharedKey = sharedKeyByTraitNameRef.current.get(binding.trait.name);
|
|
44845
|
+
if (sharedKey !== void 0 && pureWriterTickKeys.has(`${binding.trait.name}::${tick.name}`)) {
|
|
44846
|
+
continue;
|
|
44847
|
+
}
|
|
44730
44848
|
if (tick.interval === "frame") {
|
|
44731
44849
|
scheduler.add(0, () => runTickEffects(tick, binding));
|
|
44732
44850
|
} else if (typeof tick.interval === "number") {
|
|
@@ -45571,6 +45689,7 @@ function TraitInitializer({ traits: traits2, orbitalNames, onNavigate, onLocalFa
|
|
|
45571
45689
|
hadPrev: prevTraitsRef.current !== void 0
|
|
45572
45690
|
}));
|
|
45573
45691
|
if (refChanged) {
|
|
45692
|
+
navLog.info("page:traits-reset", { traitsCount: Array.isArray(traits2) ? traits2.length : -1 });
|
|
45574
45693
|
uiSlots.clearAll();
|
|
45575
45694
|
initSentRef.current = false;
|
|
45576
45695
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { E as EventBusContextType } from './event-bus-types-Bl78kokd.js';
|
|
2
|
+
import { EventPayload, BusEventSource, BusEventListener } from '@almadar/core';
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
interface Window {
|
|
6
|
+
__kflowEventBus?: EventBusContextType | null;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Hook for accessing the event bus.
|
|
11
|
+
*
|
|
12
|
+
* Uses EventBusProvider context if available, otherwise falls back to
|
|
13
|
+
* a simple in-memory event bus (for design system / Storybook).
|
|
14
|
+
*
|
|
15
|
+
* @returns Event bus instance with emit, on, once, and hasListeners methods
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const eventBus = useEventBus();
|
|
20
|
+
*
|
|
21
|
+
* // Emit an event
|
|
22
|
+
* eventBus.emit('UI:CLICK', { id: '123' });
|
|
23
|
+
*
|
|
24
|
+
* // Subscribe to an event
|
|
25
|
+
* useEffect(() => {
|
|
26
|
+
* return eventBus.on('UI:CLICK', (event) => {
|
|
27
|
+
* console.log('Clicked:', event.payload);
|
|
28
|
+
* });
|
|
29
|
+
* }, []);
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare function useEventBus(): EventBusContextType;
|
|
33
|
+
/**
|
|
34
|
+
* Hook for subscribing to a specific event.
|
|
35
|
+
* Automatically cleans up subscription on unmount.
|
|
36
|
+
*
|
|
37
|
+
* @param event - Event name to subscribe to
|
|
38
|
+
* @param handler - Event handler function
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* useEventListener('UI:CLICK', (event) => {
|
|
43
|
+
* console.log('Clicked:', event.payload);
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare function useEventListener(event: string, handler: BusEventListener): void;
|
|
48
|
+
/**
|
|
49
|
+
* Hook for emitting events.
|
|
50
|
+
* Returns a memoized emit function.
|
|
51
|
+
*
|
|
52
|
+
* @returns Function to emit events
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* const emit = useEmitEvent();
|
|
57
|
+
*
|
|
58
|
+
* const handleClick = () => {
|
|
59
|
+
* emit('UI:CLICK', { id: '123' });
|
|
60
|
+
* };
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
declare function useEmitEvent(): (type: string, payload?: EventPayload, source?: BusEventSource) => void;
|
|
64
|
+
|
|
65
|
+
export { useEventBus as a, useEventListener as b, useEmitEvent as u };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { E as EventBusContextType } from './event-bus-types-Bl78kokd.cjs';
|
|
2
|
+
import { EventPayload, BusEventSource, BusEventListener } from '@almadar/core';
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
interface Window {
|
|
6
|
+
__kflowEventBus?: EventBusContextType | null;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Hook for accessing the event bus.
|
|
11
|
+
*
|
|
12
|
+
* Uses EventBusProvider context if available, otherwise falls back to
|
|
13
|
+
* a simple in-memory event bus (for design system / Storybook).
|
|
14
|
+
*
|
|
15
|
+
* @returns Event bus instance with emit, on, once, and hasListeners methods
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const eventBus = useEventBus();
|
|
20
|
+
*
|
|
21
|
+
* // Emit an event
|
|
22
|
+
* eventBus.emit('UI:CLICK', { id: '123' });
|
|
23
|
+
*
|
|
24
|
+
* // Subscribe to an event
|
|
25
|
+
* useEffect(() => {
|
|
26
|
+
* return eventBus.on('UI:CLICK', (event) => {
|
|
27
|
+
* console.log('Clicked:', event.payload);
|
|
28
|
+
* });
|
|
29
|
+
* }, []);
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare function useEventBus(): EventBusContextType;
|
|
33
|
+
/**
|
|
34
|
+
* Hook for subscribing to a specific event.
|
|
35
|
+
* Automatically cleans up subscription on unmount.
|
|
36
|
+
*
|
|
37
|
+
* @param event - Event name to subscribe to
|
|
38
|
+
* @param handler - Event handler function
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* useEventListener('UI:CLICK', (event) => {
|
|
43
|
+
* console.log('Clicked:', event.payload);
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare function useEventListener(event: string, handler: BusEventListener): void;
|
|
48
|
+
/**
|
|
49
|
+
* Hook for emitting events.
|
|
50
|
+
* Returns a memoized emit function.
|
|
51
|
+
*
|
|
52
|
+
* @returns Function to emit events
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* const emit = useEmitEvent();
|
|
57
|
+
*
|
|
58
|
+
* const handleClick = () => {
|
|
59
|
+
* emit('UI:CLICK', { id: '123' });
|
|
60
|
+
* };
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
declare function useEmitEvent(): (type: string, payload?: EventPayload, source?: BusEventSource) => void;
|
|
64
|
+
|
|
65
|
+
export { useEventBus as a, useEventListener as b, useEmitEvent as u };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { UISlot, RenderItemLambda, EventPayloadValue } from '@almadar/core';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* useUISlots Hook
|
|
3
6
|
*
|
|
@@ -29,13 +32,11 @@
|
|
|
29
32
|
*
|
|
30
33
|
* @packageDocumentation
|
|
31
34
|
*/
|
|
32
|
-
|
|
33
|
-
import type { EventPayloadValue, RenderItemLambda, UISlot } from '@almadar/core';
|
|
34
|
-
export type { UISlot };
|
|
35
|
+
|
|
35
36
|
/**
|
|
36
37
|
* Animation types for slot transitions
|
|
37
38
|
*/
|
|
38
|
-
|
|
39
|
+
type SlotAnimation = 'fade' | 'slide' | 'scale' | 'none';
|
|
39
40
|
/**
|
|
40
41
|
* Render-prop callback after fn-form-lambda conversion or
|
|
41
42
|
* `wrapCallbackForEvent` wrapping. Pattern components consume these as
|
|
@@ -45,7 +46,7 @@ export type SlotAnimation = 'fade' | 'slide' | 'scale' | 'none';
|
|
|
45
46
|
* shapes seen at this layer. Pattern-level prop types narrow the
|
|
46
47
|
* signature for each consumer downstream.
|
|
47
48
|
*/
|
|
48
|
-
|
|
49
|
+
type SlotCallback = (...args: never[]) => void | React__default.ReactNode | EventPayloadValue;
|
|
49
50
|
/**
|
|
50
51
|
* Render-ui prop value: any leaf flowing from a `(render-ui slot {...})`
|
|
51
52
|
* effect into a React pattern component. The union enumerates every
|
|
@@ -61,7 +62,7 @@ export type SlotCallback = (...args: never[]) => void | React.ReactNode | EventP
|
|
|
61
62
|
* can appear at any depth (e.g. `tabs[].content: "@trait.X"` surviving
|
|
62
63
|
* substitution into a `ReactElement`).
|
|
63
64
|
*/
|
|
64
|
-
|
|
65
|
+
type SlotPropValue = string | number | boolean | Date | null | undefined | RenderItemLambda | SlotCallback | React__default.ReactElement | ReadonlyArray<SlotPropValue> | {
|
|
65
66
|
readonly [key: string]: SlotPropValue;
|
|
66
67
|
};
|
|
67
68
|
/**
|
|
@@ -69,11 +70,11 @@ export type SlotPropValue = string | number | boolean | Date | null | undefined
|
|
|
69
70
|
* routes these from `(render-ui slot {...})` effects to React pattern
|
|
70
71
|
* components without coercion.
|
|
71
72
|
*/
|
|
72
|
-
|
|
73
|
+
type SlotProps = Record<string, SlotPropValue>;
|
|
73
74
|
/**
|
|
74
75
|
* Content rendered in a slot
|
|
75
76
|
*/
|
|
76
|
-
|
|
77
|
+
interface SlotContent {
|
|
77
78
|
/** Unique ID for this content */
|
|
78
79
|
id: string;
|
|
79
80
|
/** Pattern/component type to render */
|
|
@@ -104,7 +105,7 @@ export interface SlotContent {
|
|
|
104
105
|
/**
|
|
105
106
|
* Configuration for render_ui effect
|
|
106
107
|
*/
|
|
107
|
-
|
|
108
|
+
interface SlotRenderConfig {
|
|
108
109
|
/** Target slot */
|
|
109
110
|
target: UISlot;
|
|
110
111
|
/** Pattern/component to render */
|
|
@@ -131,7 +132,7 @@ export interface SlotRenderConfig {
|
|
|
131
132
|
/**
|
|
132
133
|
* Callback for slot changes
|
|
133
134
|
*/
|
|
134
|
-
|
|
135
|
+
type SlotChangeCallback = (slot: UISlot, content: SlotContent | null) => void;
|
|
135
136
|
/**
|
|
136
137
|
* Fires when a specific trait's current render-ui output changes.
|
|
137
138
|
* Used by `<TraitFrame>` to subscribe only to the trait it embeds,
|
|
@@ -141,11 +142,11 @@ export type SlotChangeCallback = (slot: UISlot, content: SlotContent | null) =>
|
|
|
141
142
|
* render), so the callback signature carries just the new content —
|
|
142
143
|
* no per-slot disambiguation needed.
|
|
143
144
|
*/
|
|
144
|
-
|
|
145
|
+
type TraitChangeCallback = (content: SlotContent | null) => void;
|
|
145
146
|
/**
|
|
146
147
|
* UI Slot Manager interface
|
|
147
148
|
*/
|
|
148
|
-
|
|
149
|
+
interface UISlotManager {
|
|
149
150
|
/**
|
|
150
151
|
* Current aggregate content for each slot. Single-source slots hold
|
|
151
152
|
* that source's SlotContent; multi-source slots hold a synthetic
|
|
@@ -210,5 +211,6 @@ declare const DEFAULT_SLOTS: Partial<Record<UISlot, SlotContent | null>>;
|
|
|
210
211
|
* This is the internal hook that creates the manager.
|
|
211
212
|
* Use `useUISlots()` from context in components.
|
|
212
213
|
*/
|
|
213
|
-
|
|
214
|
-
|
|
214
|
+
declare function useUISlotManager(): UISlotManager;
|
|
215
|
+
|
|
216
|
+
export { DEFAULT_SLOTS as D, type SlotAnimation as S, type UISlotManager as U, type SlotChangeCallback as a, type SlotContent as b, type SlotRenderConfig as c, useUISlotManager as u };
|