@almadar/ui 5.78.0 → 5.79.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/dist/KaTeX_AMS-Regular-CYEKBG2K.woff +0 -0
- package/dist/KaTeX_AMS-Regular-JKX5W2C4.ttf +0 -0
- package/dist/KaTeX_AMS-Regular-U6PRYMIZ.woff2 +0 -0
- package/dist/KaTeX_Caligraphic-Bold-5QL5CMTE.woff2 +0 -0
- package/dist/KaTeX_Caligraphic-Bold-WZ3QSGD3.woff +0 -0
- package/dist/KaTeX_Caligraphic-Bold-ZTS3R3HK.ttf +0 -0
- package/dist/KaTeX_Caligraphic-Regular-3LKEU76G.woff +0 -0
- package/dist/KaTeX_Caligraphic-Regular-A7XRTZ5Q.ttf +0 -0
- package/dist/KaTeX_Caligraphic-Regular-KX5MEWCF.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Bold-2QVFK6NQ.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Bold-T4SWXBMT.woff +0 -0
- package/dist/KaTeX_Fraktur-Bold-WGHVTYOR.ttf +0 -0
- package/dist/KaTeX_Fraktur-Regular-2PEIFJSJ.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Regular-5U4OPH2X.ttf +0 -0
- package/dist/KaTeX_Fraktur-Regular-PQMHCIK6.woff +0 -0
- package/dist/KaTeX_Main-Bold-2GA4IZIN.woff +0 -0
- package/dist/KaTeX_Main-Bold-W5FBVCZM.ttf +0 -0
- package/dist/KaTeX_Main-Bold-YP5VVQRP.woff2 +0 -0
- package/dist/KaTeX_Main-BoldItalic-4P4C7HJH.woff +0 -0
- package/dist/KaTeX_Main-BoldItalic-N4V3DX7S.woff2 +0 -0
- package/dist/KaTeX_Main-BoldItalic-ODMLBJJQ.ttf +0 -0
- package/dist/KaTeX_Main-Italic-I43T2HSR.ttf +0 -0
- package/dist/KaTeX_Main-Italic-RELBIK7M.woff2 +0 -0
- package/dist/KaTeX_Main-Italic-SASNQFN2.woff +0 -0
- package/dist/KaTeX_Main-Regular-ARRPAO67.woff2 +0 -0
- package/dist/KaTeX_Main-Regular-P5I74A2A.woff +0 -0
- package/dist/KaTeX_Main-Regular-W74P5G27.ttf +0 -0
- package/dist/KaTeX_Math-BoldItalic-6EBV3DK5.woff +0 -0
- package/dist/KaTeX_Math-BoldItalic-K4WTGH3J.woff2 +0 -0
- package/dist/KaTeX_Math-BoldItalic-VB447A4D.ttf +0 -0
- package/dist/KaTeX_Math-Italic-6KGCHLFN.woff2 +0 -0
- package/dist/KaTeX_Math-Italic-KKK3USB2.woff +0 -0
- package/dist/KaTeX_Math-Italic-SON4MRCA.ttf +0 -0
- package/dist/KaTeX_SansSerif-Bold-RRNVJFFW.woff2 +0 -0
- package/dist/KaTeX_SansSerif-Bold-STQ6RXC7.ttf +0 -0
- package/dist/KaTeX_SansSerif-Bold-X5M5EMOD.woff +0 -0
- package/dist/KaTeX_SansSerif-Italic-HMPFTM52.woff2 +0 -0
- package/dist/KaTeX_SansSerif-Italic-PSN4QKYX.woff +0 -0
- package/dist/KaTeX_SansSerif-Italic-WTBAZBGY.ttf +0 -0
- package/dist/KaTeX_SansSerif-Regular-2TL3USAE.ttf +0 -0
- package/dist/KaTeX_SansSerif-Regular-OQCII6EP.woff +0 -0
- package/dist/KaTeX_SansSerif-Regular-XIQ62X4E.woff2 +0 -0
- package/dist/KaTeX_Script-Regular-72OLXYNA.ttf +0 -0
- package/dist/KaTeX_Script-Regular-A5IFOEBS.woff +0 -0
- package/dist/KaTeX_Script-Regular-APUWIHLP.woff2 +0 -0
- package/dist/KaTeX_Size1-Regular-4HRHTS65.woff +0 -0
- package/dist/KaTeX_Size1-Regular-5LRUTBFT.woff2 +0 -0
- package/dist/KaTeX_Size1-Regular-7K6AASVL.ttf +0 -0
- package/dist/KaTeX_Size2-Regular-222HN3GT.ttf +0 -0
- package/dist/KaTeX_Size2-Regular-K5ZHAIS6.woff +0 -0
- package/dist/KaTeX_Size2-Regular-LELKET5D.woff2 +0 -0
- package/dist/KaTeX_Size3-Regular-TLFPAHDE.woff +0 -0
- package/dist/KaTeX_Size3-Regular-UFCO6WCA.ttf +0 -0
- package/dist/KaTeX_Size3-Regular-WQRQ47UD.woff2 +0 -0
- package/dist/KaTeX_Size4-Regular-7PGNVPQK.ttf +0 -0
- package/dist/KaTeX_Size4-Regular-CDMV7U5C.woff2 +0 -0
- package/dist/KaTeX_Size4-Regular-PKMWZHNC.woff +0 -0
- package/dist/KaTeX_Typewriter-Regular-3F5K6SQ6.ttf +0 -0
- package/dist/KaTeX_Typewriter-Regular-MJMFSK64.woff +0 -0
- package/dist/KaTeX_Typewriter-Regular-VBYJ4NRC.woff2 +0 -0
- package/dist/avl/index.cjs +0 -64392
- package/dist/avl/index.css +0 -1252
- package/dist/avl/index.d.cts +0 -1853
- package/dist/avl/index.d.ts +0 -64
- package/dist/avl/index.js +0 -64280
- 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/Avatar.d.ts +0 -61
- package/dist/components/core/atoms/Badge.d.ts +0 -26
- package/dist/components/core/atoms/Box.d.ts +0 -66
- package/dist/components/core/atoms/Button.d.ts +0 -31
- 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/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 -50
- 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 -14
- package/dist/components/core/molecules/DocSearch.d.ts +0 -15
- 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 -33
- package/dist/components/core/molecules/LoadingState.d.ts +0 -7
- package/dist/components/core/molecules/MapView.d.ts +0 -70
- 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 -36
- 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 -58
- 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 -160
- 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 -137
- 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 -43
- 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 -75
- package/dist/components/core/organisms/DetailPanel.d.ts +0 -80
- package/dist/components/core/organisms/DrawerSlot.d.ts +0 -40
- 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 -36
- 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 -39
- 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 -20
- 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 -13
- package/dist/components/core/organisms/debug/tabs/EventDispatcherTab.d.ts +0 -17
- package/dist/components/core/organisms/debug/tabs/EventFlowTab.d.ts +0 -9
- package/dist/components/core/organisms/debug/tabs/GuardsPanel.d.ts +0 -9
- package/dist/components/core/organisms/debug/tabs/ServerBridgeTab.d.ts +0 -9
- package/dist/components/core/organisms/debug/tabs/TicksTab.d.ts +0 -13
- package/dist/components/core/organisms/debug/tabs/TraitsTab.d.ts +0 -13
- package/dist/components/core/organisms/debug/tabs/TransitionTimeline.d.ts +0 -9
- package/dist/components/core/organisms/debug/tabs/VerificationTab.d.ts +0 -10
- 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 -44
- 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 -21
- package/dist/components/core/templates/types.d.ts +0 -35
- package/dist/components/game/2d/atoms/ActionButton.d.ts +0 -28
- package/dist/components/game/2d/atoms/ChoiceButton.d.ts +0 -24
- package/dist/components/game/2d/atoms/ComboCounter.d.ts +0 -19
- package/dist/components/game/2d/atoms/ControlButton.d.ts +0 -34
- package/dist/components/game/2d/atoms/DamageNumber.d.ts +0 -17
- package/dist/components/game/2d/atoms/DialogueBubble.d.ts +0 -17
- package/dist/components/game/2d/atoms/GameAudioToggle.d.ts +0 -29
- package/dist/components/game/2d/atoms/GameCard.d.ts +0 -26
- package/dist/components/game/2d/atoms/GameIcon.d.ts +0 -18
- package/dist/components/game/2d/atoms/HealthBar.d.ts +0 -26
- package/dist/components/game/2d/atoms/ItemSlot.d.ts +0 -28
- package/dist/components/game/2d/atoms/MiniMap.d.ts +0 -34
- package/dist/components/game/2d/atoms/ResourceCounter.d.ts +0 -25
- package/dist/components/game/2d/atoms/ScoreDisplay.d.ts +0 -24
- package/dist/components/game/2d/atoms/Sprite.d.ts +0 -52
- package/dist/components/game/2d/atoms/StateIndicator.d.ts +0 -29
- package/dist/components/game/2d/atoms/StatusEffect.d.ts +0 -24
- package/dist/components/game/2d/atoms/TimerDisplay.d.ts +0 -18
- package/dist/components/game/2d/atoms/TurnIndicator.d.ts +0 -21
- package/dist/components/game/2d/atoms/WaypointMarker.d.ts +0 -22
- package/dist/components/game/2d/molecules/Canvas2D.d.ts +0 -161
- package/dist/components/game/2d/molecules/ControlGrid.d.ts +0 -42
- package/dist/components/game/2d/molecules/GameHud.d.ts +0 -51
- package/dist/components/game/2d/molecules/GameMenu.d.ts +0 -44
- package/dist/components/game/2d/molecules/InventoryGrid.d.ts +0 -34
- package/dist/components/game/2d/molecules/ResourceBar.d.ts +0 -25
- package/dist/components/game/2d/molecules/StatBadge.d.ts +0 -38
- package/dist/components/game/2d/molecules/index.d.ts +0 -107
- package/dist/components/game/2d/organisms/ActionPalette.d.ts +0 -34
- package/dist/components/game/2d/organisms/ActionTile.d.ts +0 -30
- package/dist/components/game/2d/organisms/BattleBoard.d.ts +0 -132
- package/dist/components/game/2d/organisms/BoardgameBoard.d.ts +0 -37
- package/dist/components/game/2d/organisms/BuilderBoard.d.ts +0 -60
- package/dist/components/game/2d/organisms/CanvasEffect.d.ts +0 -70
- package/dist/components/game/2d/organisms/CardBattlerBoard.d.ts +0 -45
- package/dist/components/game/2d/organisms/CastleBoard.d.ts +0 -107
- package/dist/components/game/2d/organisms/CityBuilderBoard.d.ts +0 -62
- package/dist/components/game/2d/organisms/ClassifierBoard.d.ts +0 -66
- package/dist/components/game/2d/organisms/DebuggerBoard.d.ts +0 -61
- package/dist/components/game/2d/organisms/EventHandlerBoard.d.ts +0 -42
- package/dist/components/game/2d/organisms/EventLog.d.ts +0 -31
- package/dist/components/game/2d/organisms/FishingBoard.d.ts +0 -41
- package/dist/components/game/2d/organisms/HexStrategyBoard.d.ts +0 -44
- package/dist/components/game/2d/organisms/HolidayRunnerBoard.d.ts +0 -37
- package/dist/components/game/2d/organisms/MatchPuzzleBoard.d.ts +0 -37
- package/dist/components/game/2d/organisms/MinigolfBoard.d.ts +0 -37
- package/dist/components/game/2d/organisms/NegotiatorBoard.d.ts +0 -56
- package/dist/components/game/2d/organisms/ObjectRulePanel.d.ts +0 -27
- package/dist/components/game/2d/organisms/PinballBoard.d.ts +0 -43
- package/dist/components/game/2d/organisms/PirateBoard.d.ts +0 -44
- package/dist/components/game/2d/organisms/PlatformerBoard.d.ts +0 -46
- package/dist/components/game/2d/organisms/RacingBoard.d.ts +0 -44
- package/dist/components/game/2d/organisms/RoguelikeBoard.d.ts +0 -60
- package/dist/components/game/2d/organisms/RuleEditor.d.ts +0 -39
- package/dist/components/game/2d/organisms/SequenceBar.d.ts +0 -41
- package/dist/components/game/2d/organisms/SequencerBoard.d.ts +0 -65
- package/dist/components/game/2d/organisms/SimulationCanvas.d.ts +0 -27
- package/dist/components/game/2d/organisms/SimulationControls.d.ts +0 -34
- package/dist/components/game/2d/organisms/SimulationGraph.d.ts +0 -25
- package/dist/components/game/2d/organisms/SimulatorBoard.d.ts +0 -58
- package/dist/components/game/2d/organisms/SokobanBoard.d.ts +0 -37
- package/dist/components/game/2d/organisms/SpaceShmupBoard.d.ts +0 -44
- package/dist/components/game/2d/organisms/SpaceStationBoard.d.ts +0 -37
- package/dist/components/game/2d/organisms/SportsBoard.d.ts +0 -37
- package/dist/components/game/2d/organisms/StateArchitectBoard.d.ts +0 -61
- package/dist/components/game/2d/organisms/StateJsonView.d.ts +0 -17
- package/dist/components/game/2d/organisms/StateNode.d.ts +0 -31
- package/dist/components/game/2d/organisms/TanksBoard.d.ts +0 -37
- package/dist/components/game/2d/organisms/TopDownShooterBoard.d.ts +0 -63
- package/dist/components/game/2d/organisms/TowerDefenseBoard.d.ts +0 -85
- package/dist/components/game/2d/organisms/TraitSlot.d.ts +0 -96
- package/dist/components/game/2d/organisms/TraitStateViewer.d.ts +0 -54
- package/dist/components/game/2d/organisms/TransitionArrow.d.ts +0 -31
- package/dist/components/game/2d/organisms/UncontrolledBattleBoard.d.ts +0 -43
- package/dist/components/game/2d/organisms/VariablePanel.d.ts +0 -22
- package/dist/components/game/2d/organisms/VisualNovelBoard.d.ts +0 -44
- package/dist/components/game/2d/organisms/WorldMapBoard.d.ts +0 -155
- package/dist/components/game/2d/templates/BattleTemplate.d.ts +0 -34
- package/dist/components/game/2d/templates/CardBattlerTemplate.d.ts +0 -35
- package/dist/components/game/2d/templates/CastleTemplate.d.ts +0 -32
- package/dist/components/game/2d/templates/CityBuilderTemplate.d.ts +0 -40
- package/dist/components/game/2d/templates/GameShell.d.ts +0 -34
- package/dist/components/game/2d/templates/GameTemplate.d.ts +0 -32
- package/dist/components/game/2d/templates/PlatformerTemplate.d.ts +0 -27
- package/dist/components/game/2d/templates/RoguelikeTemplate.d.ts +0 -23
- package/dist/components/game/2d/templates/TopDownShooterTemplate.d.ts +0 -42
- package/dist/components/game/2d/templates/TowerDefenseTemplate.d.ts +0 -43
- package/dist/components/game/2d/templates/VisualNovelTemplate.d.ts +0 -28
- package/dist/components/game/2d/templates/WorldMapTemplate.d.ts +0 -38
- package/dist/components/game/3d/index.cjs +0 -7050
- package/dist/components/game/3d/index.css +0 -503
- package/dist/components/game/3d/index.d.ts +0 -13
- package/dist/components/game/3d/index.js +0 -6974
- package/dist/components/game/3d/molecules/Camera3D.d.ts +0 -60
- package/dist/components/game/3d/molecules/Canvas3D.d.ts +0 -45
- package/dist/components/game/3d/molecules/Canvas3DErrorBoundary.d.ts +0 -51
- package/dist/components/game/3d/molecules/Canvas3DLoadingState.d.ts +0 -44
- package/dist/components/game/3d/molecules/GameCanvas3D.d.ts +0 -226
- package/dist/components/game/3d/molecules/Lighting3D.d.ts +0 -47
- package/dist/components/game/3d/molecules/ModelLoader.d.ts +0 -44
- package/dist/components/game/3d/molecules/Scene3D.d.ts +0 -37
- package/dist/components/game/3d/molecules/index.d.ts +0 -36
- package/dist/components/game/3d/organisms/GameBoard3D.d.ts +0 -66
- package/dist/components/game/3d/patterns.d.ts +0 -20
- package/dist/components/game/3d/templates/GameCanvas3DBattleTemplate.d.ts +0 -82
- package/dist/components/game/3d/templates/GameCanvas3DCastleTemplate.d.ts +0 -87
- package/dist/components/game/3d/templates/GameCanvas3DWorldMapTemplate.d.ts +0 -95
- package/dist/components/game/shared/boardEntity.d.ts +0 -44
- package/dist/components/game/shared/canvasEffects.d.ts +0 -50
- package/dist/components/game/shared/combatPresets.d.ts +0 -15
- package/dist/components/game/shared/effects.d.ts +0 -253
- package/dist/components/game/shared/game.d.ts +0 -92
- package/dist/components/game/shared/hooks/useAssetLoader.d.ts +0 -58
- package/dist/components/game/shared/hooks/useBattleState.d.ts +0 -47
- package/dist/components/game/shared/hooks/useCamera.d.ts +0 -57
- package/dist/components/game/shared/hooks/useCanvasEffects.d.ts +0 -27
- package/dist/components/game/shared/hooks/useGameAudio.d.ts +0 -47
- package/dist/components/game/shared/hooks/useGameCanvas3DEvents.d.ts +0 -123
- package/dist/components/game/shared/hooks/useRaycaster.d.ts +0 -86
- package/dist/components/game/shared/hooks/useSceneGraph.d.ts +0 -67
- package/dist/components/game/shared/hooks/useThree.d.ts +0 -58
- package/dist/components/game/shared/hooks/useUnitSpriteAtlas.d.ts +0 -24
- package/dist/components/game/shared/index.d.ts +0 -21
- package/dist/components/game/shared/isometric.d.ts +0 -83
- package/dist/components/game/shared/isometricTypes.d.ts +0 -130
- package/dist/components/game/shared/lib/AssetLoader.d.ts +0 -80
- package/dist/components/game/shared/lib/culling.d.ts +0 -134
- package/dist/components/game/shared/lib/editorUtils.d.ts +0 -114
- package/dist/components/game/shared/lib/game3dAssetManifest.d.ts +0 -48
- package/dist/components/game/shared/lib/grid3D.d.ts +0 -154
- package/dist/components/game/shared/lib/mechanics.d.ts +0 -4
- package/dist/components/game/shared/lib/physicsPresets.d.ts +0 -4
- package/dist/components/game/shared/lib/physicsTypes.d.ts +0 -43
- package/dist/components/game/shared/lib/puzzleObject.d.ts +0 -32
- package/dist/components/game/shared/makeAsset.d.ts +0 -5
- package/dist/components/game/shared/providers/GameAudioProvider.d.ts +0 -53
- package/dist/components/game/shared/spriteAnimation.d.ts +0 -85
- package/dist/components/game/shared/spriteAnimationTypes.d.ts +0 -97
- package/dist/components/game/shared/spriteSheetConstants.d.ts +0 -16
- package/dist/components/game/shared/useImageCache.d.ts +0 -16
- package/dist/components/index.cjs +0 -57559
- package/dist/components/index.css +0 -1252
- package/dist/components/index.d.ts +0 -6
- package/dist/components/index.js +0 -57300
- package/dist/components/learning/atoms/LearningCanvas.d.ts +0 -80
- 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/context/index.cjs +0 -957
- package/dist/context/index.d.ts +0 -11
- package/dist/context/index.js +0 -899
- package/dist/hooks/index.cjs +0 -2778
- package/dist/hooks/index.d.ts +0 -32
- package/dist/hooks/index.js +0 -2738
- 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/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/useGitHub.d.ts +0 -58
- 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/useSwipeGesture.d.ts +0 -26
- package/dist/hooks/useTapReveal.d.ts +0 -32
- package/dist/hooks/useTraitStateMachine.d.ts +0 -105
- package/dist/hooks/useTranslate.d.ts +0 -35
- package/dist/hooks/useUIEvents.d.ts +0 -41
- package/dist/hooks/useUISlots.d.ts +0 -214
- package/dist/hooks/useValidation.d.ts +0 -46
- package/dist/lib/api-client.d.ts +0 -43
- 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/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/getNestedValue.d.ts +0 -34
- package/dist/lib/guardRegistry.d.ts +0 -33
- package/dist/lib/iconFamily.d.ts +0 -41
- package/dist/lib/index.cjs +0 -1616
- package/dist/lib/index.d.ts +0 -18
- package/dist/lib/index.js +0 -1524
- package/dist/lib/init.d.ts +0 -14
- 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/offline-executor.d.ts +0 -239
- package/dist/lib/orbitalsByTrait.d.ts +0 -34
- 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/prepareSchemaForPreview.d.ts +0 -71
- package/dist/lib/slot-definitions.d.ts +0 -33
- package/dist/lib/themeTokens.d.ts +0 -55
- 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/wrapCallbackForEvent.d.ts +0 -16
- package/dist/locales/index.cjs +0 -1761
- package/dist/locales/index.d.ts +0 -20
- package/dist/locales/index.js +0 -1757
- package/dist/marketing/index.cjs +0 -6966
- package/dist/marketing/index.d.cts +0 -1061
- package/dist/marketing/index.d.ts +0 -72
- package/dist/marketing/index.js +0 -6903
- 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/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/UISlotContext.d.ts +0 -75
- package/dist/providers/UserContext.d.ts +0 -112
- package/dist/providers/VerificationProvider.d.ts +0 -64
- package/dist/providers/index.cjs +0 -54649
- package/dist/providers/index.css +0 -1252
- package/dist/providers/index.d.ts +0 -25
- package/dist/providers/index.js +0 -54550
- package/dist/providers/navigation.d.ts +0 -142
- package/dist/renderer/index.cjs +0 -855
- package/dist/renderer/index.d.ts +0 -28
- package/dist/renderer/index.js +0 -766
- package/dist/runtime/BrowserPlayground.d.ts +0 -34
- package/dist/runtime/OrbPreview.d.ts +0 -84
- package/dist/runtime/index.cjs +0 -54826
- package/dist/runtime/index.css +0 -1252
- package/dist/runtime/index.d.ts +0 -21
- package/dist/runtime/index.js +0 -54729
- 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/event-bus-types.d.ts +0 -64
- 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/lib/index.js
DELETED
|
@@ -1,1524 +0,0 @@
|
|
|
1
|
-
import { clsx } from 'clsx';
|
|
2
|
-
import { twMerge } from 'tailwind-merge';
|
|
3
|
-
import { createLogger, isLogLevelEnabled } from '@almadar/logger';
|
|
4
|
-
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8
|
-
function cn(...inputs) {
|
|
9
|
-
return twMerge(clsx(inputs));
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
// lib/api-client.ts
|
|
13
|
-
var API_BASE_URL = typeof process !== "undefined" && process.env?.VITE_API_URL ? process.env.VITE_API_URL : "/api";
|
|
14
|
-
var ApiError = class extends Error {
|
|
15
|
-
constructor(status, statusText, message) {
|
|
16
|
-
super(message || `API Error: ${status} ${statusText}`);
|
|
17
|
-
__publicField(this, "status", status);
|
|
18
|
-
__publicField(this, "statusText", statusText);
|
|
19
|
-
this.name = "ApiError";
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
async function handleResponse(response) {
|
|
23
|
-
if (!response.ok) {
|
|
24
|
-
let message;
|
|
25
|
-
try {
|
|
26
|
-
const errorData = await response.json();
|
|
27
|
-
message = errorData.message || errorData.error;
|
|
28
|
-
} catch {
|
|
29
|
-
}
|
|
30
|
-
throw new ApiError(response.status, response.statusText, message);
|
|
31
|
-
}
|
|
32
|
-
const text = await response.text();
|
|
33
|
-
if (!text) {
|
|
34
|
-
return void 0;
|
|
35
|
-
}
|
|
36
|
-
return JSON.parse(text);
|
|
37
|
-
}
|
|
38
|
-
function getHeaders() {
|
|
39
|
-
const headers = {
|
|
40
|
-
"Content-Type": "application/json"
|
|
41
|
-
};
|
|
42
|
-
const token = typeof localStorage !== "undefined" ? localStorage.getItem("authToken") : null;
|
|
43
|
-
if (token) {
|
|
44
|
-
headers["Authorization"] = `Bearer ${token}`;
|
|
45
|
-
}
|
|
46
|
-
return headers;
|
|
47
|
-
}
|
|
48
|
-
var apiClient = {
|
|
49
|
-
/**
|
|
50
|
-
* GET request
|
|
51
|
-
*/
|
|
52
|
-
async get(endpoint) {
|
|
53
|
-
const response = await fetch(`${API_BASE_URL}${endpoint}`, {
|
|
54
|
-
method: "GET",
|
|
55
|
-
headers: getHeaders()
|
|
56
|
-
});
|
|
57
|
-
return handleResponse(response);
|
|
58
|
-
},
|
|
59
|
-
/**
|
|
60
|
-
* POST request
|
|
61
|
-
*/
|
|
62
|
-
async post(endpoint, data) {
|
|
63
|
-
const response = await fetch(`${API_BASE_URL}${endpoint}`, {
|
|
64
|
-
method: "POST",
|
|
65
|
-
headers: getHeaders(),
|
|
66
|
-
body: data ? JSON.stringify(data) : void 0
|
|
67
|
-
});
|
|
68
|
-
return handleResponse(response);
|
|
69
|
-
},
|
|
70
|
-
/**
|
|
71
|
-
* PUT request
|
|
72
|
-
*/
|
|
73
|
-
async put(endpoint, data) {
|
|
74
|
-
const response = await fetch(`${API_BASE_URL}${endpoint}`, {
|
|
75
|
-
method: "PUT",
|
|
76
|
-
headers: getHeaders(),
|
|
77
|
-
body: data ? JSON.stringify(data) : void 0
|
|
78
|
-
});
|
|
79
|
-
return handleResponse(response);
|
|
80
|
-
},
|
|
81
|
-
/**
|
|
82
|
-
* PATCH request
|
|
83
|
-
*/
|
|
84
|
-
async patch(endpoint, data) {
|
|
85
|
-
const response = await fetch(`${API_BASE_URL}${endpoint}`, {
|
|
86
|
-
method: "PATCH",
|
|
87
|
-
headers: getHeaders(),
|
|
88
|
-
body: data ? JSON.stringify(data) : void 0
|
|
89
|
-
});
|
|
90
|
-
return handleResponse(response);
|
|
91
|
-
},
|
|
92
|
-
/**
|
|
93
|
-
* DELETE request
|
|
94
|
-
*/
|
|
95
|
-
async delete(endpoint) {
|
|
96
|
-
const response = await fetch(`${API_BASE_URL}${endpoint}`, {
|
|
97
|
-
method: "DELETE",
|
|
98
|
-
headers: getHeaders()
|
|
99
|
-
});
|
|
100
|
-
return handleResponse(response);
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
var NAMESPACE = "almadar:ui:debug";
|
|
104
|
-
var log = createLogger(NAMESPACE);
|
|
105
|
-
var inputLog = createLogger("almadar:ui:debug:input");
|
|
106
|
-
var collisionLog = createLogger("almadar:ui:debug:collision");
|
|
107
|
-
var physicsLog = createLogger("almadar:ui:debug:physics");
|
|
108
|
-
var gameStateLog = createLogger("almadar:ui:debug:game-state");
|
|
109
|
-
function gateEnabled(level, ns = NAMESPACE) {
|
|
110
|
-
return isLogLevelEnabled(level, ns);
|
|
111
|
-
}
|
|
112
|
-
function isDebugEnabled() {
|
|
113
|
-
return gateEnabled("DEBUG");
|
|
114
|
-
}
|
|
115
|
-
function debug(...args) {
|
|
116
|
-
if (!gateEnabled("DEBUG")) return;
|
|
117
|
-
const [first, ...rest] = args;
|
|
118
|
-
const message = typeof first === "string" ? first : "<debug>";
|
|
119
|
-
if (rest.length === 0 && typeof first === "string") {
|
|
120
|
-
log.debug(message);
|
|
121
|
-
} else {
|
|
122
|
-
log.debug(message, { args: rest.length > 0 ? formatArgs(rest) : formatArgs([first]) });
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
function debugGroup(label) {
|
|
126
|
-
if (gateEnabled("DEBUG")) console.group(`[${NAMESPACE}] ${label}`);
|
|
127
|
-
}
|
|
128
|
-
function debugGroupEnd() {
|
|
129
|
-
if (gateEnabled("DEBUG")) console.groupEnd();
|
|
130
|
-
}
|
|
131
|
-
function debugWarn(...args) {
|
|
132
|
-
if (!gateEnabled("WARN")) return;
|
|
133
|
-
const [first, ...rest] = args;
|
|
134
|
-
const message = typeof first === "string" ? first : "<warn>";
|
|
135
|
-
log.warn(message, rest.length > 0 ? { args: formatArgs(rest) } : void 0);
|
|
136
|
-
}
|
|
137
|
-
function debugError(...args) {
|
|
138
|
-
if (!gateEnabled("ERROR")) return;
|
|
139
|
-
const [first, ...rest] = args;
|
|
140
|
-
const message = typeof first === "string" ? first : "<error>";
|
|
141
|
-
log.error(message, rest.length > 0 ? { args: formatArgs(rest) } : void 0);
|
|
142
|
-
}
|
|
143
|
-
function debugTable(data) {
|
|
144
|
-
if (gateEnabled("DEBUG")) console.table(data);
|
|
145
|
-
}
|
|
146
|
-
function debugTime(label) {
|
|
147
|
-
if (gateEnabled("DEBUG")) console.time(`[${NAMESPACE}] ${label}`);
|
|
148
|
-
}
|
|
149
|
-
function debugTimeEnd(label) {
|
|
150
|
-
if (gateEnabled("DEBUG")) console.timeEnd(`[${NAMESPACE}] ${label}`);
|
|
151
|
-
}
|
|
152
|
-
function debugInput(inputType, data) {
|
|
153
|
-
inputLog.debug(inputType, { data: formatArgs([data]) });
|
|
154
|
-
}
|
|
155
|
-
function debugCollision(entityA, entityB, details) {
|
|
156
|
-
collisionLog.debug("collision", () => ({
|
|
157
|
-
a: entityA.type ?? entityA.id ?? null,
|
|
158
|
-
b: entityB.type ?? entityB.id ?? null,
|
|
159
|
-
details: details === void 0 ? null : formatArgs([details])
|
|
160
|
-
}));
|
|
161
|
-
}
|
|
162
|
-
function debugPhysics(entityId, physics) {
|
|
163
|
-
physicsLog.debug("physics", { entityId, data: formatArgs([physics]) });
|
|
164
|
-
}
|
|
165
|
-
function debugGameState(stateName, value) {
|
|
166
|
-
gameStateLog.debug(stateName, { value: formatArgs([value]) });
|
|
167
|
-
}
|
|
168
|
-
function formatArgs(values) {
|
|
169
|
-
if (values.length === 1) return toLogMetaValue(values[0]);
|
|
170
|
-
return values.map(toLogMetaValue);
|
|
171
|
-
}
|
|
172
|
-
function toLogMetaValue(v) {
|
|
173
|
-
if (v === null || v === void 0) return v;
|
|
174
|
-
if (v instanceof Error) return v;
|
|
175
|
-
const t = typeof v;
|
|
176
|
-
if (t === "string" || t === "number" || t === "boolean") return v;
|
|
177
|
-
if (Array.isArray(v)) return v.map(toLogMetaValue);
|
|
178
|
-
if (t === "object") {
|
|
179
|
-
const out = {};
|
|
180
|
-
for (const [k, val] of Object.entries(v)) {
|
|
181
|
-
out[k] = toLogMetaValue(val);
|
|
182
|
-
}
|
|
183
|
-
return out;
|
|
184
|
-
}
|
|
185
|
-
return String(v);
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
// lib/debugUtils.ts
|
|
189
|
-
var DEBUG_STORAGE_KEY = "orbital-debug";
|
|
190
|
-
var listeners = /* @__PURE__ */ new Set();
|
|
191
|
-
function isDebugEnabled2() {
|
|
192
|
-
if (typeof window === "undefined") return false;
|
|
193
|
-
return localStorage.getItem(DEBUG_STORAGE_KEY) === "true";
|
|
194
|
-
}
|
|
195
|
-
function setDebugEnabled(enabled) {
|
|
196
|
-
if (typeof window === "undefined") return;
|
|
197
|
-
localStorage.setItem(DEBUG_STORAGE_KEY, String(enabled));
|
|
198
|
-
listeners.forEach((listener) => listener(enabled));
|
|
199
|
-
}
|
|
200
|
-
function toggleDebug() {
|
|
201
|
-
const newValue = !isDebugEnabled2();
|
|
202
|
-
setDebugEnabled(newValue);
|
|
203
|
-
return newValue;
|
|
204
|
-
}
|
|
205
|
-
function onDebugToggle(listener) {
|
|
206
|
-
listeners.add(listener);
|
|
207
|
-
return () => listeners.delete(listener);
|
|
208
|
-
}
|
|
209
|
-
function initDebugShortcut() {
|
|
210
|
-
if (typeof window === "undefined") return () => {
|
|
211
|
-
};
|
|
212
|
-
const handleKeyDown = (e) => {
|
|
213
|
-
if (e.ctrlKey && e.shiftKey && e.key === "D") {
|
|
214
|
-
e.preventDefault();
|
|
215
|
-
toggleDebug();
|
|
216
|
-
}
|
|
217
|
-
};
|
|
218
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
219
|
-
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// lib/entityDebug.ts
|
|
223
|
-
var entityProvider = null;
|
|
224
|
-
function setEntityProvider(provider) {
|
|
225
|
-
entityProvider = provider;
|
|
226
|
-
}
|
|
227
|
-
function clearEntityProvider() {
|
|
228
|
-
entityProvider = null;
|
|
229
|
-
}
|
|
230
|
-
function getEntitySnapshot() {
|
|
231
|
-
if (!entityProvider) {
|
|
232
|
-
return null;
|
|
233
|
-
}
|
|
234
|
-
const entities = entityProvider();
|
|
235
|
-
return {
|
|
236
|
-
entities,
|
|
237
|
-
timestamp: Date.now(),
|
|
238
|
-
totalCount: entities.length,
|
|
239
|
-
singletons: {},
|
|
240
|
-
runtime: entities.map((e) => ({ id: e.id, type: e.type, data: e.fields })),
|
|
241
|
-
persistent: {}
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
function getEntityById(id) {
|
|
245
|
-
if (!entityProvider) {
|
|
246
|
-
return void 0;
|
|
247
|
-
}
|
|
248
|
-
return entityProvider().find((e) => e.id === id);
|
|
249
|
-
}
|
|
250
|
-
function getEntitiesByType(type) {
|
|
251
|
-
if (!entityProvider) {
|
|
252
|
-
return [];
|
|
253
|
-
}
|
|
254
|
-
return entityProvider().filter((e) => e.type === type);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// lib/debugRegistry.ts
|
|
258
|
-
var events = [];
|
|
259
|
-
var listeners2 = /* @__PURE__ */ new Set();
|
|
260
|
-
var MAX_EVENTS = 500;
|
|
261
|
-
function notifyListeners() {
|
|
262
|
-
listeners2.forEach((listener) => listener());
|
|
263
|
-
}
|
|
264
|
-
function logDebugEvent(type, source, message, data) {
|
|
265
|
-
const event = {
|
|
266
|
-
id: `event-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`,
|
|
267
|
-
type,
|
|
268
|
-
source,
|
|
269
|
-
message,
|
|
270
|
-
data,
|
|
271
|
-
timestamp: Date.now()
|
|
272
|
-
};
|
|
273
|
-
events.unshift(event);
|
|
274
|
-
if (events.length > MAX_EVENTS) {
|
|
275
|
-
events.pop();
|
|
276
|
-
}
|
|
277
|
-
notifyListeners();
|
|
278
|
-
}
|
|
279
|
-
function logStateChange(source, from, to, event) {
|
|
280
|
-
logDebugEvent("state-change", source, `${from} \u2192 ${to}`, { from, to, event: event ?? null });
|
|
281
|
-
}
|
|
282
|
-
function logEventFired(source, eventName, payload) {
|
|
283
|
-
logDebugEvent("event-fired", source, eventName, { eventName, payload: payload ?? null });
|
|
284
|
-
}
|
|
285
|
-
function logEffectExecuted(source, effectType, details) {
|
|
286
|
-
logDebugEvent("effect-executed", source, effectType, { effectType, details: details ?? null });
|
|
287
|
-
}
|
|
288
|
-
function logError(source, message, error) {
|
|
289
|
-
logDebugEvent("error", source, message, { error: error?.message ?? null });
|
|
290
|
-
}
|
|
291
|
-
function logWarning(source, message, data) {
|
|
292
|
-
logDebugEvent("warning", source, message, data);
|
|
293
|
-
}
|
|
294
|
-
function logInfo(source, message, data) {
|
|
295
|
-
logDebugEvent("info", source, message, data);
|
|
296
|
-
}
|
|
297
|
-
function getDebugEvents() {
|
|
298
|
-
return [...events];
|
|
299
|
-
}
|
|
300
|
-
function getRecentEvents(count) {
|
|
301
|
-
return events.slice(0, count);
|
|
302
|
-
}
|
|
303
|
-
function getEventsByType(type) {
|
|
304
|
-
return events.filter((e) => e.type === type);
|
|
305
|
-
}
|
|
306
|
-
function getEventsBySource(source) {
|
|
307
|
-
return events.filter((e) => e.source === source);
|
|
308
|
-
}
|
|
309
|
-
function subscribeToDebugEvents(listener) {
|
|
310
|
-
listeners2.add(listener);
|
|
311
|
-
return () => listeners2.delete(listener);
|
|
312
|
-
}
|
|
313
|
-
function clearDebugEvents() {
|
|
314
|
-
events.length = 0;
|
|
315
|
-
notifyListeners();
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
// lib/guardRegistry.ts
|
|
319
|
-
var guardHistory = [];
|
|
320
|
-
var listeners3 = /* @__PURE__ */ new Set();
|
|
321
|
-
var MAX_HISTORY = 100;
|
|
322
|
-
function notifyListeners2() {
|
|
323
|
-
listeners3.forEach((listener) => listener());
|
|
324
|
-
}
|
|
325
|
-
function recordGuardEvaluation(evaluation) {
|
|
326
|
-
const entry = {
|
|
327
|
-
...evaluation,
|
|
328
|
-
id: `guard-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`,
|
|
329
|
-
timestamp: Date.now()
|
|
330
|
-
};
|
|
331
|
-
guardHistory.unshift(entry);
|
|
332
|
-
if (guardHistory.length > MAX_HISTORY) {
|
|
333
|
-
guardHistory.pop();
|
|
334
|
-
}
|
|
335
|
-
notifyListeners2();
|
|
336
|
-
}
|
|
337
|
-
function getGuardHistory() {
|
|
338
|
-
return [...guardHistory];
|
|
339
|
-
}
|
|
340
|
-
function getRecentGuardEvaluations(count) {
|
|
341
|
-
return guardHistory.slice(0, count);
|
|
342
|
-
}
|
|
343
|
-
function getGuardEvaluationsForTrait(traitName) {
|
|
344
|
-
return guardHistory.filter((g) => g.traitName === traitName);
|
|
345
|
-
}
|
|
346
|
-
function subscribeToGuardChanges(listener) {
|
|
347
|
-
listeners3.add(listener);
|
|
348
|
-
return () => listeners3.delete(listener);
|
|
349
|
-
}
|
|
350
|
-
function clearGuardHistory() {
|
|
351
|
-
guardHistory.length = 0;
|
|
352
|
-
notifyListeners2();
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
// lib/tickRegistry.ts
|
|
356
|
-
var ticks = /* @__PURE__ */ new Map();
|
|
357
|
-
var listeners4 = /* @__PURE__ */ new Set();
|
|
358
|
-
function notifyListeners3() {
|
|
359
|
-
listeners4.forEach((listener) => listener());
|
|
360
|
-
}
|
|
361
|
-
function registerTick(tick) {
|
|
362
|
-
ticks.set(tick.id, tick);
|
|
363
|
-
notifyListeners3();
|
|
364
|
-
}
|
|
365
|
-
function updateTickExecution(id, timestamp) {
|
|
366
|
-
const tick = ticks.get(id);
|
|
367
|
-
if (tick) {
|
|
368
|
-
tick.lastExecuted = timestamp;
|
|
369
|
-
tick.nextExecution = timestamp + tick.interval;
|
|
370
|
-
tick.executionCount++;
|
|
371
|
-
notifyListeners3();
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
function setTickActive(id, isActive) {
|
|
375
|
-
const tick = ticks.get(id);
|
|
376
|
-
if (tick) {
|
|
377
|
-
tick.isActive = isActive;
|
|
378
|
-
notifyListeners3();
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
function unregisterTick(id) {
|
|
382
|
-
ticks.delete(id);
|
|
383
|
-
notifyListeners3();
|
|
384
|
-
}
|
|
385
|
-
function getAllTicks() {
|
|
386
|
-
return Array.from(ticks.values());
|
|
387
|
-
}
|
|
388
|
-
function getTick(id) {
|
|
389
|
-
return ticks.get(id);
|
|
390
|
-
}
|
|
391
|
-
function subscribeToTickChanges(listener) {
|
|
392
|
-
listeners4.add(listener);
|
|
393
|
-
return () => listeners4.delete(listener);
|
|
394
|
-
}
|
|
395
|
-
function clearTicks() {
|
|
396
|
-
ticks.clear();
|
|
397
|
-
notifyListeners3();
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
// lib/traitRegistry.ts
|
|
401
|
-
var traits = /* @__PURE__ */ new Map();
|
|
402
|
-
var listeners5 = /* @__PURE__ */ new Set();
|
|
403
|
-
function notifyListeners4() {
|
|
404
|
-
listeners5.forEach((listener) => listener());
|
|
405
|
-
}
|
|
406
|
-
function registerTrait(info) {
|
|
407
|
-
traits.set(info.id, info);
|
|
408
|
-
notifyListeners4();
|
|
409
|
-
}
|
|
410
|
-
function updateTraitState(id, newState) {
|
|
411
|
-
const trait = traits.get(id);
|
|
412
|
-
if (trait) {
|
|
413
|
-
trait.currentState = newState;
|
|
414
|
-
trait.transitionCount++;
|
|
415
|
-
notifyListeners4();
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
function updateGuardResult(traitId, guardName, result) {
|
|
419
|
-
const trait = traits.get(traitId);
|
|
420
|
-
if (trait) {
|
|
421
|
-
const guard = trait.guards.find((g) => g.name === guardName);
|
|
422
|
-
if (guard) {
|
|
423
|
-
guard.lastResult = result;
|
|
424
|
-
notifyListeners4();
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
function unregisterTrait(id) {
|
|
429
|
-
traits.delete(id);
|
|
430
|
-
notifyListeners4();
|
|
431
|
-
}
|
|
432
|
-
function getAllTraits() {
|
|
433
|
-
return Array.from(traits.values());
|
|
434
|
-
}
|
|
435
|
-
function getTrait(id) {
|
|
436
|
-
return traits.get(id);
|
|
437
|
-
}
|
|
438
|
-
function subscribeToTraitChanges(listener) {
|
|
439
|
-
listeners5.add(listener);
|
|
440
|
-
return () => listeners5.delete(listener);
|
|
441
|
-
}
|
|
442
|
-
function clearTraits() {
|
|
443
|
-
traits.clear();
|
|
444
|
-
notifyListeners4();
|
|
445
|
-
}
|
|
446
|
-
var log2 = createLogger("almadar:bridge");
|
|
447
|
-
var MAX_TRANSITIONS = 500;
|
|
448
|
-
function getState() {
|
|
449
|
-
if (typeof window !== "undefined") {
|
|
450
|
-
const w = window;
|
|
451
|
-
if (!w.__verificationRegistryState) {
|
|
452
|
-
w.__verificationRegistryState = {
|
|
453
|
-
checks: /* @__PURE__ */ new Map(),
|
|
454
|
-
transitions: [],
|
|
455
|
-
bridgeHealth: null,
|
|
456
|
-
listeners: /* @__PURE__ */ new Set(),
|
|
457
|
-
traitSnapshots: /* @__PURE__ */ new Map()
|
|
458
|
-
};
|
|
459
|
-
}
|
|
460
|
-
return w.__verificationRegistryState;
|
|
461
|
-
}
|
|
462
|
-
return {
|
|
463
|
-
checks: /* @__PURE__ */ new Map(),
|
|
464
|
-
transitions: [],
|
|
465
|
-
bridgeHealth: null,
|
|
466
|
-
listeners: /* @__PURE__ */ new Set(),
|
|
467
|
-
traitSnapshots: /* @__PURE__ */ new Map()
|
|
468
|
-
};
|
|
469
|
-
}
|
|
470
|
-
function notifyListeners5() {
|
|
471
|
-
getState().listeners.forEach((l) => l());
|
|
472
|
-
exposeOnWindow();
|
|
473
|
-
}
|
|
474
|
-
function registerCheck(id, label, status = "pending", details) {
|
|
475
|
-
getState().checks.set(id, { id, label, status, details, updatedAt: Date.now() });
|
|
476
|
-
notifyListeners5();
|
|
477
|
-
}
|
|
478
|
-
function updateCheck(id, status, details) {
|
|
479
|
-
const check = getState().checks.get(id);
|
|
480
|
-
if (check) {
|
|
481
|
-
check.status = status;
|
|
482
|
-
if (details !== void 0) check.details = details;
|
|
483
|
-
check.updatedAt = Date.now();
|
|
484
|
-
} else {
|
|
485
|
-
getState().checks.set(id, { id, label: id, status, details, updatedAt: Date.now() });
|
|
486
|
-
}
|
|
487
|
-
notifyListeners5();
|
|
488
|
-
}
|
|
489
|
-
function getAllChecks() {
|
|
490
|
-
return Array.from(getState().checks.values());
|
|
491
|
-
}
|
|
492
|
-
function recordTransition(trace) {
|
|
493
|
-
const entry = {
|
|
494
|
-
...trace,
|
|
495
|
-
id: `t-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`
|
|
496
|
-
};
|
|
497
|
-
log2.debug("transition:recorded", { trait: trace.traitName, from: trace.from, to: trace.to, event: trace.event, effectCount: trace.effects.length });
|
|
498
|
-
getState().transitions.push(entry);
|
|
499
|
-
if (getState().transitions.length > MAX_TRANSITIONS) {
|
|
500
|
-
getState().transitions.shift();
|
|
501
|
-
}
|
|
502
|
-
if (entry.event === "INIT") {
|
|
503
|
-
const hasFetch = entry.effects.some((e) => e.type === "fetch");
|
|
504
|
-
const checkId = `init-fetch-${entry.traitName}`;
|
|
505
|
-
if (hasFetch) {
|
|
506
|
-
registerCheck(
|
|
507
|
-
checkId,
|
|
508
|
-
`INIT transition for "${entry.traitName}" has fetch effect`,
|
|
509
|
-
"pass"
|
|
510
|
-
);
|
|
511
|
-
} else {
|
|
512
|
-
const hasRenderUI = entry.effects.some((e) => e.type === "render-ui");
|
|
513
|
-
if (hasRenderUI) {
|
|
514
|
-
registerCheck(
|
|
515
|
-
checkId,
|
|
516
|
-
`INIT transition for "${entry.traitName}" missing fetch effect`,
|
|
517
|
-
"fail",
|
|
518
|
-
"Entity-bound render-ui without a fetch effect will show empty data"
|
|
519
|
-
);
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
const failedEffects = entry.effects.filter((e) => e.status === "failed");
|
|
524
|
-
if (failedEffects.length > 0) {
|
|
525
|
-
registerCheck(
|
|
526
|
-
`effects-${entry.id}`,
|
|
527
|
-
`Effects failed in ${entry.traitName}: ${entry.from} -> ${entry.to}`,
|
|
528
|
-
"fail",
|
|
529
|
-
failedEffects.map((e) => `${e.type}: ${e.error}`).join("; ")
|
|
530
|
-
);
|
|
531
|
-
}
|
|
532
|
-
notifyListeners5();
|
|
533
|
-
}
|
|
534
|
-
function getTransitions() {
|
|
535
|
-
return [...getState().transitions];
|
|
536
|
-
}
|
|
537
|
-
function getTransitionsForTrait(traitName) {
|
|
538
|
-
return getState().transitions.filter((t) => t.traitName === traitName);
|
|
539
|
-
}
|
|
540
|
-
function recordServerResponse(orbitalName, event, response) {
|
|
541
|
-
const serverResponse = {
|
|
542
|
-
...response,
|
|
543
|
-
orbitalName,
|
|
544
|
-
timestamp: Date.now()
|
|
545
|
-
};
|
|
546
|
-
const entry = {
|
|
547
|
-
id: `srv-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`,
|
|
548
|
-
traitName: `server:${orbitalName}`,
|
|
549
|
-
from: "server",
|
|
550
|
-
to: "server",
|
|
551
|
-
event,
|
|
552
|
-
effects: [],
|
|
553
|
-
serverResponse,
|
|
554
|
-
timestamp: Date.now()
|
|
555
|
-
};
|
|
556
|
-
getState().transitions.push(entry);
|
|
557
|
-
if (getState().transitions.length > MAX_TRANSITIONS) {
|
|
558
|
-
getState().transitions.shift();
|
|
559
|
-
}
|
|
560
|
-
if (!response.success && response.error) {
|
|
561
|
-
registerCheck(
|
|
562
|
-
`server-error-${entry.id}`,
|
|
563
|
-
`Server error for ${orbitalName}:${event}`,
|
|
564
|
-
"fail",
|
|
565
|
-
response.error
|
|
566
|
-
);
|
|
567
|
-
}
|
|
568
|
-
notifyListeners5();
|
|
569
|
-
}
|
|
570
|
-
function updateBridgeHealth(health) {
|
|
571
|
-
getState().bridgeHealth = { ...health };
|
|
572
|
-
const checkId = "server-bridge";
|
|
573
|
-
if (health.connected) {
|
|
574
|
-
registerCheck(checkId, "Server bridge connected", "pass");
|
|
575
|
-
} else {
|
|
576
|
-
registerCheck(
|
|
577
|
-
checkId,
|
|
578
|
-
"Server bridge disconnected",
|
|
579
|
-
"fail",
|
|
580
|
-
health.lastError || "Bridge is not connected"
|
|
581
|
-
);
|
|
582
|
-
}
|
|
583
|
-
notifyListeners5();
|
|
584
|
-
}
|
|
585
|
-
function getBridgeHealth() {
|
|
586
|
-
const bh = getState().bridgeHealth;
|
|
587
|
-
return bh ? { ...bh } : null;
|
|
588
|
-
}
|
|
589
|
-
function getSummary() {
|
|
590
|
-
const allChecks = getAllChecks();
|
|
591
|
-
return {
|
|
592
|
-
totalChecks: allChecks.length,
|
|
593
|
-
passed: allChecks.filter((c) => c.status === "pass").length,
|
|
594
|
-
failed: allChecks.filter((c) => c.status === "fail").length,
|
|
595
|
-
warnings: allChecks.filter((c) => c.status === "warn").length,
|
|
596
|
-
pending: allChecks.filter((c) => c.status === "pending").length
|
|
597
|
-
};
|
|
598
|
-
}
|
|
599
|
-
function getSnapshot() {
|
|
600
|
-
return {
|
|
601
|
-
checks: getAllChecks(),
|
|
602
|
-
transitions: getTransitions(),
|
|
603
|
-
bridge: getBridgeHealth(),
|
|
604
|
-
summary: getSummary(),
|
|
605
|
-
traits: getTraitSnapshots()
|
|
606
|
-
};
|
|
607
|
-
}
|
|
608
|
-
function getTraitSnapshots() {
|
|
609
|
-
const snapshots = [];
|
|
610
|
-
for (const [traitName, getter] of getState().traitSnapshots.entries()) {
|
|
611
|
-
try {
|
|
612
|
-
snapshots.push(getter());
|
|
613
|
-
} catch (err) {
|
|
614
|
-
log2.error("traitSnapshot getter failed", { trait: traitName, err: String(err) });
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
return snapshots;
|
|
618
|
-
}
|
|
619
|
-
function subscribeToVerification(listener) {
|
|
620
|
-
getState().listeners.add(listener);
|
|
621
|
-
return () => getState().listeners.delete(listener);
|
|
622
|
-
}
|
|
623
|
-
function defaultGetTraitState(traitName) {
|
|
624
|
-
const getter = getState().traitSnapshots.get(traitName);
|
|
625
|
-
if (getter === void 0) return void 0;
|
|
626
|
-
try {
|
|
627
|
-
return getter().currentState;
|
|
628
|
-
} catch {
|
|
629
|
-
return void 0;
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
function exposeOnWindow() {
|
|
633
|
-
if (typeof window === "undefined") return;
|
|
634
|
-
if (!window.__orbitalVerification) {
|
|
635
|
-
window.__orbitalVerification = {
|
|
636
|
-
getSnapshot,
|
|
637
|
-
getChecks: getAllChecks,
|
|
638
|
-
getTransitions,
|
|
639
|
-
getBridge: getBridgeHealth,
|
|
640
|
-
getSummary,
|
|
641
|
-
waitForTransition,
|
|
642
|
-
getTraitSnapshots,
|
|
643
|
-
getTraitState: defaultGetTraitState
|
|
644
|
-
};
|
|
645
|
-
} else {
|
|
646
|
-
if (!window.__orbitalVerification.getTraitSnapshots) {
|
|
647
|
-
window.__orbitalVerification.getTraitSnapshots = getTraitSnapshots;
|
|
648
|
-
}
|
|
649
|
-
if (!window.__orbitalVerification.getTraitState) {
|
|
650
|
-
window.__orbitalVerification.getTraitState = defaultGetTraitState;
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
function waitForTransition(event, timeoutMs = 1e4) {
|
|
655
|
-
return new Promise((resolve) => {
|
|
656
|
-
const existing = getState().transitions.find((t) => t.event === event);
|
|
657
|
-
if (existing) {
|
|
658
|
-
resolve(existing);
|
|
659
|
-
return;
|
|
660
|
-
}
|
|
661
|
-
const timeout = setTimeout(() => {
|
|
662
|
-
unsub();
|
|
663
|
-
resolve(null);
|
|
664
|
-
}, timeoutMs);
|
|
665
|
-
const unsub = subscribeToVerification(() => {
|
|
666
|
-
const found = getState().transitions.find((t) => t.event === event);
|
|
667
|
-
if (found) {
|
|
668
|
-
clearTimeout(timeout);
|
|
669
|
-
unsub();
|
|
670
|
-
resolve(found);
|
|
671
|
-
}
|
|
672
|
-
});
|
|
673
|
-
});
|
|
674
|
-
}
|
|
675
|
-
function bindEventBus(eventBus) {
|
|
676
|
-
if (typeof window === "undefined") return;
|
|
677
|
-
log2.info("bindEventBus", { hasOnAny: !!eventBus.onAny });
|
|
678
|
-
exposeOnWindow();
|
|
679
|
-
if (window.__orbitalVerification) {
|
|
680
|
-
window.__orbitalVerification.sendEvent = (event, payload, traitScope) => {
|
|
681
|
-
const prefixed = event.startsWith("UI:") ? event : traitScope ? `UI:${traitScope}.${event}` : `UI:${event}`;
|
|
682
|
-
log2.debug("sendEvent", { event: prefixed, traitScope, payloadKeys: payload ? Object.keys(payload) : [] });
|
|
683
|
-
eventBus.emit(prefixed, payload);
|
|
684
|
-
};
|
|
685
|
-
const eventLog = [];
|
|
686
|
-
window.__orbitalVerification.eventLog = eventLog;
|
|
687
|
-
window.__orbitalVerification.clearEventLog = () => {
|
|
688
|
-
eventLog.length = 0;
|
|
689
|
-
};
|
|
690
|
-
if (eventBus.onAny) {
|
|
691
|
-
const verificationRegistryEventLogger = (event) => {
|
|
692
|
-
if (eventLog.length < 200) {
|
|
693
|
-
eventLog.push({
|
|
694
|
-
type: event.type,
|
|
695
|
-
payload: event.payload,
|
|
696
|
-
timestamp: Date.now()
|
|
697
|
-
});
|
|
698
|
-
}
|
|
699
|
-
};
|
|
700
|
-
Object.defineProperty(verificationRegistryEventLogger, "name", {
|
|
701
|
-
value: "verificationRegistry:eventLog"
|
|
702
|
-
});
|
|
703
|
-
eventBus.onAny(verificationRegistryEventLogger);
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
function bindTraitStateGetter(getter) {
|
|
708
|
-
if (typeof window === "undefined") return;
|
|
709
|
-
exposeOnWindow();
|
|
710
|
-
if (window.__orbitalVerification) {
|
|
711
|
-
window.__orbitalVerification.getTraitState = getter;
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
function registerTraitSnapshot(traitName, getter) {
|
|
715
|
-
if (typeof window === "undefined") return () => {
|
|
716
|
-
};
|
|
717
|
-
getState().traitSnapshots.set(traitName, getter);
|
|
718
|
-
exposeOnWindow();
|
|
719
|
-
notifyListeners5();
|
|
720
|
-
return () => {
|
|
721
|
-
const s = getState();
|
|
722
|
-
if (s.traitSnapshots.get(traitName) === getter) {
|
|
723
|
-
s.traitSnapshots.delete(traitName);
|
|
724
|
-
notifyListeners5();
|
|
725
|
-
}
|
|
726
|
-
};
|
|
727
|
-
}
|
|
728
|
-
function bindCanvasCapture(captureFn) {
|
|
729
|
-
if (typeof window === "undefined") return;
|
|
730
|
-
exposeOnWindow();
|
|
731
|
-
if (window.__orbitalVerification) {
|
|
732
|
-
window.__orbitalVerification.captureFrame = captureFn;
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
function updateAssetStatus(url, status) {
|
|
736
|
-
if (typeof window === "undefined") return;
|
|
737
|
-
exposeOnWindow();
|
|
738
|
-
if (window.__orbitalVerification) {
|
|
739
|
-
if (!window.__orbitalVerification.assetStatus) {
|
|
740
|
-
window.__orbitalVerification.assetStatus = {};
|
|
741
|
-
}
|
|
742
|
-
window.__orbitalVerification.assetStatus[url] = status;
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
function clearVerification() {
|
|
746
|
-
getState().checks.clear();
|
|
747
|
-
getState().transitions.length = 0;
|
|
748
|
-
getState().bridgeHealth = null;
|
|
749
|
-
notifyListeners5();
|
|
750
|
-
}
|
|
751
|
-
exposeOnWindow();
|
|
752
|
-
|
|
753
|
-
// lib/getNestedValue.ts
|
|
754
|
-
function getNestedValue(obj, path) {
|
|
755
|
-
if (obj === null || obj === void 0 || !path) {
|
|
756
|
-
return void 0;
|
|
757
|
-
}
|
|
758
|
-
if (!path.includes(".")) {
|
|
759
|
-
return obj[path];
|
|
760
|
-
}
|
|
761
|
-
const parts = path.split(".");
|
|
762
|
-
let value = obj;
|
|
763
|
-
for (const part of parts) {
|
|
764
|
-
if (value === null || value === void 0) {
|
|
765
|
-
return void 0;
|
|
766
|
-
}
|
|
767
|
-
if (typeof value !== "object" || Array.isArray(value)) {
|
|
768
|
-
return void 0;
|
|
769
|
-
}
|
|
770
|
-
value = value[part];
|
|
771
|
-
}
|
|
772
|
-
return value;
|
|
773
|
-
}
|
|
774
|
-
function formatNestedFieldLabel(path) {
|
|
775
|
-
const lastPart = path.includes(".") ? path.split(".").pop() : path;
|
|
776
|
-
return lastPart.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()).replace(/Id$/, "").trim();
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
// lib/visualizer/index.ts
|
|
780
|
-
function formatSExprGuardToDomain(guard, _entityName) {
|
|
781
|
-
if (Array.isArray(guard)) {
|
|
782
|
-
const [op, ...args] = guard;
|
|
783
|
-
return `${op}(${args.map((a) => JSON.stringify(a)).join(", ")})`;
|
|
784
|
-
}
|
|
785
|
-
return JSON.stringify(guard);
|
|
786
|
-
}
|
|
787
|
-
function formatSExprEffectToDomain(effect, _entityName) {
|
|
788
|
-
if (Array.isArray(effect)) {
|
|
789
|
-
const [op, ...args] = effect;
|
|
790
|
-
return `${op}(${args.map((a) => JSON.stringify(a)).join(", ")})`;
|
|
791
|
-
}
|
|
792
|
-
return JSON.stringify(effect);
|
|
793
|
-
}
|
|
794
|
-
function isArraySExpr(expr) {
|
|
795
|
-
return Array.isArray(expr);
|
|
796
|
-
}
|
|
797
|
-
var DEFAULT_CONFIG = {
|
|
798
|
-
nodeRadius: 70,
|
|
799
|
-
nodeSpacing: 650,
|
|
800
|
-
// Increased to give more room for transitions
|
|
801
|
-
initialIndicatorOffset: 45,
|
|
802
|
-
arrowSize: 12,
|
|
803
|
-
colors: {
|
|
804
|
-
background: "#0d1117",
|
|
805
|
-
node: "#161b22",
|
|
806
|
-
nodeBorder: "#30363d",
|
|
807
|
-
nodeText: "#e6edf3",
|
|
808
|
-
initialNode: "#238636",
|
|
809
|
-
finalNode: "#f85149",
|
|
810
|
-
arrow: "#8b949e",
|
|
811
|
-
arrowText: "#8b949e",
|
|
812
|
-
effectText: "#ffb86c",
|
|
813
|
-
guardText: "#ff79c6",
|
|
814
|
-
initial: "#238636"
|
|
815
|
-
},
|
|
816
|
-
fonts: {
|
|
817
|
-
node: '18px "Inter", sans-serif',
|
|
818
|
-
event: '16px "JetBrains Mono", monospace',
|
|
819
|
-
effect: '14px "JetBrains Mono", monospace'
|
|
820
|
-
}
|
|
821
|
-
};
|
|
822
|
-
function isBinding(val) {
|
|
823
|
-
return typeof val === "string" && val.startsWith("@");
|
|
824
|
-
}
|
|
825
|
-
function parseBinding(binding) {
|
|
826
|
-
if (!isBinding(binding)) return null;
|
|
827
|
-
const withoutAt = binding.substring(1);
|
|
828
|
-
const parts = withoutAt.split(".");
|
|
829
|
-
return {
|
|
830
|
-
root: parts[0],
|
|
831
|
-
path: parts.slice(1),
|
|
832
|
-
raw: binding
|
|
833
|
-
};
|
|
834
|
-
}
|
|
835
|
-
function formatGuard(guard) {
|
|
836
|
-
let text = "";
|
|
837
|
-
if (typeof guard === "string") {
|
|
838
|
-
text = guard;
|
|
839
|
-
} else if (Array.isArray(guard)) {
|
|
840
|
-
text = formatSExprCompact(guard);
|
|
841
|
-
}
|
|
842
|
-
return text ? `[${text}]` : "";
|
|
843
|
-
}
|
|
844
|
-
function formatGuardHuman(guard, entityName) {
|
|
845
|
-
if (!guard) return "";
|
|
846
|
-
if (typeof guard === "string") {
|
|
847
|
-
return `if ${guard}`;
|
|
848
|
-
}
|
|
849
|
-
if (isArraySExpr(guard)) {
|
|
850
|
-
return formatSExprGuardToDomain(guard);
|
|
851
|
-
}
|
|
852
|
-
return "";
|
|
853
|
-
}
|
|
854
|
-
function formatEffectsHuman(effects, entityName) {
|
|
855
|
-
if (!Array.isArray(effects) || effects.length === 0) return [];
|
|
856
|
-
return effects.map((effect) => {
|
|
857
|
-
if (isArraySExpr(effect)) {
|
|
858
|
-
return formatSExprEffectToDomain(effect);
|
|
859
|
-
}
|
|
860
|
-
return String(effect);
|
|
861
|
-
}).filter(Boolean);
|
|
862
|
-
}
|
|
863
|
-
function formatSExprCompact(expr) {
|
|
864
|
-
if (!Array.isArray(expr) || expr.length === 0) return "[]";
|
|
865
|
-
const op = expr[0];
|
|
866
|
-
const args = expr.slice(1);
|
|
867
|
-
const formattedArgs = args.map((a) => {
|
|
868
|
-
if (isBinding(a)) {
|
|
869
|
-
const parsed = parseBinding(a);
|
|
870
|
-
if (parsed && parsed.path.length > 0) {
|
|
871
|
-
return `${parsed.root}.${parsed.path.join(".")}`;
|
|
872
|
-
}
|
|
873
|
-
return parsed?.root || a;
|
|
874
|
-
}
|
|
875
|
-
if (typeof a === "string") return a;
|
|
876
|
-
if (typeof a === "number" || typeof a === "boolean") return String(a);
|
|
877
|
-
if (Array.isArray(a)) return formatSExprCompact(a);
|
|
878
|
-
return "{...}";
|
|
879
|
-
});
|
|
880
|
-
return `${op} ${formattedArgs.join(" ")}`;
|
|
881
|
-
}
|
|
882
|
-
function getEffectSummary(effects) {
|
|
883
|
-
if (!Array.isArray(effects) || effects.length === 0) return "";
|
|
884
|
-
const setFields = [];
|
|
885
|
-
const otherEffects = [];
|
|
886
|
-
effects.forEach((effect) => {
|
|
887
|
-
if (!Array.isArray(effect)) return;
|
|
888
|
-
const op = effect[0];
|
|
889
|
-
if (op === "set" && effect[1] && typeof effect[1] === "string") {
|
|
890
|
-
const parsed = parseBinding(effect[1]);
|
|
891
|
-
if (parsed && parsed.path.length > 0) {
|
|
892
|
-
setFields.push(parsed.path[parsed.path.length - 1]);
|
|
893
|
-
} else {
|
|
894
|
-
setFields.push("field");
|
|
895
|
-
}
|
|
896
|
-
} else {
|
|
897
|
-
otherEffects.push(effect);
|
|
898
|
-
}
|
|
899
|
-
});
|
|
900
|
-
const summaries = [];
|
|
901
|
-
if (setFields.length > 0) {
|
|
902
|
-
summaries.push(`\u2192 ${setFields.join(", ")}`);
|
|
903
|
-
}
|
|
904
|
-
otherEffects.forEach((effect) => {
|
|
905
|
-
const op = effect[0];
|
|
906
|
-
switch (op) {
|
|
907
|
-
case "emit":
|
|
908
|
-
summaries.push(`\u2191 ${effect[1] || "event"}`);
|
|
909
|
-
break;
|
|
910
|
-
case "notify":
|
|
911
|
-
summaries.push(`\u{1F4E7} ${effect[1] || ""}`);
|
|
912
|
-
break;
|
|
913
|
-
case "persist":
|
|
914
|
-
summaries.push(`\u{1F4BE} ${effect[1] || "save"}`);
|
|
915
|
-
break;
|
|
916
|
-
case "navigate":
|
|
917
|
-
summaries.push(`\u{1F517} nav`);
|
|
918
|
-
break;
|
|
919
|
-
case "spawn":
|
|
920
|
-
summaries.push(`+ ${effect[1] || "spawn"}`);
|
|
921
|
-
break;
|
|
922
|
-
case "despawn":
|
|
923
|
-
summaries.push(`- despawn`);
|
|
924
|
-
break;
|
|
925
|
-
default:
|
|
926
|
-
summaries.push(op);
|
|
927
|
-
}
|
|
928
|
-
});
|
|
929
|
-
return summaries.join(" | ");
|
|
930
|
-
}
|
|
931
|
-
function extractOutputsFromTransitions(transitions) {
|
|
932
|
-
const outputs = /* @__PURE__ */ new Set();
|
|
933
|
-
transitions.forEach((t) => {
|
|
934
|
-
if (t.effects) {
|
|
935
|
-
t.effects.forEach((effect) => {
|
|
936
|
-
if (Array.isArray(effect)) {
|
|
937
|
-
const op = effect[0];
|
|
938
|
-
if (["emit", "notify", "persist", "navigate", "call-service"].includes(op)) {
|
|
939
|
-
if (isArraySExpr(effect)) {
|
|
940
|
-
const humanText = formatSExprEffectToDomain(effect);
|
|
941
|
-
outputs.add(humanText);
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
});
|
|
946
|
-
}
|
|
947
|
-
});
|
|
948
|
-
return Array.from(outputs);
|
|
949
|
-
}
|
|
950
|
-
function getNodeRadius(stateName, config) {
|
|
951
|
-
const baseRadius = config.nodeRadius;
|
|
952
|
-
const textLength = stateName.length;
|
|
953
|
-
if (textLength > 12) return baseRadius + 25;
|
|
954
|
-
if (textLength > 8) return baseRadius + 15;
|
|
955
|
-
if (textLength > 6) return baseRadius + 8;
|
|
956
|
-
return baseRadius;
|
|
957
|
-
}
|
|
958
|
-
function calculateLayout(states, transitions, options, config) {
|
|
959
|
-
const positions = {};
|
|
960
|
-
const entityBoxWidth = options.hasEntity ? 200 : 0;
|
|
961
|
-
const outputBoxWidth = options.hasOutputs ? 200 : 0;
|
|
962
|
-
const leftOffset = 100 + entityBoxWidth;
|
|
963
|
-
const initialState = states.find((s) => s.isInitial) || states[0];
|
|
964
|
-
states.filter((s) => s.isFinal);
|
|
965
|
-
states.filter((s) => !s.isInitial && !s.isFinal);
|
|
966
|
-
let maxLabelLength = 0;
|
|
967
|
-
transitions.forEach((t) => {
|
|
968
|
-
if (t.effects && t.effects.length > 0) {
|
|
969
|
-
const summary = getEffectSummary(t.effects);
|
|
970
|
-
maxLabelLength = Math.max(maxLabelLength, summary.length);
|
|
971
|
-
}
|
|
972
|
-
if (t.guard) {
|
|
973
|
-
const guardStr = formatGuard(t.guard);
|
|
974
|
-
maxLabelLength = Math.max(maxLabelLength, guardStr.length);
|
|
975
|
-
}
|
|
976
|
-
if (t.event) {
|
|
977
|
-
maxLabelLength = Math.max(maxLabelLength, t.event.length);
|
|
978
|
-
}
|
|
979
|
-
});
|
|
980
|
-
const labelWidth = Math.min(maxLabelLength * 10, 350);
|
|
981
|
-
const dynamicSpacing = Math.min(Math.max(config.nodeSpacing, labelWidth + 100), 400);
|
|
982
|
-
const stateColumn = {};
|
|
983
|
-
if (initialState) {
|
|
984
|
-
const queue = [{ name: initialState.name, col: 0 }];
|
|
985
|
-
const visited = /* @__PURE__ */ new Set();
|
|
986
|
-
while (queue.length > 0) {
|
|
987
|
-
const { name, col } = queue.shift();
|
|
988
|
-
if (visited.has(name)) continue;
|
|
989
|
-
visited.add(name);
|
|
990
|
-
if (stateColumn[name] === void 0) {
|
|
991
|
-
stateColumn[name] = col;
|
|
992
|
-
}
|
|
993
|
-
transitions.forEach((t) => {
|
|
994
|
-
if (t.from === name && t.from !== t.to && !visited.has(t.to)) {
|
|
995
|
-
queue.push({ name: t.to, col: col + 1 });
|
|
996
|
-
}
|
|
997
|
-
});
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
states.forEach((s) => {
|
|
1001
|
-
if (stateColumn[s.name] === void 0) {
|
|
1002
|
-
stateColumn[s.name] = 0;
|
|
1003
|
-
}
|
|
1004
|
-
});
|
|
1005
|
-
const columns = {};
|
|
1006
|
-
Object.entries(stateColumn).forEach(([name, col]) => {
|
|
1007
|
-
if (!columns[col]) columns[col] = [];
|
|
1008
|
-
columns[col].push(name);
|
|
1009
|
-
});
|
|
1010
|
-
Object.values(columns).forEach((stateNames) => {
|
|
1011
|
-
stateNames.sort((a, b) => {
|
|
1012
|
-
const stateA = states.find((s) => s.name === a);
|
|
1013
|
-
const stateB = states.find((s) => s.name === b);
|
|
1014
|
-
if (stateA?.isInitial) return -1;
|
|
1015
|
-
if (stateB?.isInitial) return 1;
|
|
1016
|
-
if (stateA?.isFinal && !stateB?.isFinal) return 1;
|
|
1017
|
-
if (stateB?.isFinal && !stateA?.isFinal) return -1;
|
|
1018
|
-
return a.localeCompare(b);
|
|
1019
|
-
});
|
|
1020
|
-
});
|
|
1021
|
-
const numColumns = Math.max(...Object.keys(columns).map(Number)) + 1;
|
|
1022
|
-
const maxRowsInColumn = Math.max(...Object.values(columns).map((arr) => arr.length));
|
|
1023
|
-
const minVerticalSpacing = 420;
|
|
1024
|
-
const tooltipPadding = 150;
|
|
1025
|
-
const width = Math.max(1400, numColumns * dynamicSpacing + entityBoxWidth + outputBoxWidth + 400);
|
|
1026
|
-
const height = Math.max(1e3, maxRowsInColumn * minVerticalSpacing + 350 + tooltipPadding);
|
|
1027
|
-
Object.entries(columns).forEach(([colStr, stateNames]) => {
|
|
1028
|
-
const col = parseInt(colStr);
|
|
1029
|
-
const x = leftOffset + col * dynamicSpacing;
|
|
1030
|
-
const numInColumn = stateNames.length;
|
|
1031
|
-
const verticalSpacing = Math.max(minVerticalSpacing, height / (numInColumn + 1));
|
|
1032
|
-
stateNames.forEach((stateName, rowIndex) => {
|
|
1033
|
-
const state = states.find((s) => s.name === stateName);
|
|
1034
|
-
if (state) {
|
|
1035
|
-
const y = verticalSpacing * (rowIndex + 1);
|
|
1036
|
-
positions[stateName] = { x, y, state };
|
|
1037
|
-
}
|
|
1038
|
-
});
|
|
1039
|
-
});
|
|
1040
|
-
return { positions, width, height: height + 60 };
|
|
1041
|
-
}
|
|
1042
|
-
function escapeXml(unsafe) {
|
|
1043
|
-
return unsafe.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1044
|
-
}
|
|
1045
|
-
function createArrowMarkerSvg(id, color, config) {
|
|
1046
|
-
return `<marker id="${id}" viewBox="0 0 10 10" refX="8" refY="5" markerWidth="${config.arrowSize}" markerHeight="${config.arrowSize}" orient="auto-start-reverse">
|
|
1047
|
-
<path d="M 0 0 L 10 5 L 0 10 z" fill="${color}"/>
|
|
1048
|
-
</marker>`;
|
|
1049
|
-
}
|
|
1050
|
-
function drawStateSvg(name, x, y, state, config) {
|
|
1051
|
-
const radius = getNodeRadius(name, config);
|
|
1052
|
-
let borderColor = config.colors.nodeBorder;
|
|
1053
|
-
let borderWidth = 2;
|
|
1054
|
-
if (state.isInitial) {
|
|
1055
|
-
borderColor = config.colors.initialNode;
|
|
1056
|
-
borderWidth = 3;
|
|
1057
|
-
} else if (state.isFinal) {
|
|
1058
|
-
borderColor = config.colors.finalNode;
|
|
1059
|
-
borderWidth = 3;
|
|
1060
|
-
}
|
|
1061
|
-
let svg = `<g class="state-node">
|
|
1062
|
-
<circle cx="${x}" cy="${y}" r="${radius}" fill="${config.colors.node}" stroke="${borderColor}" stroke-width="${borderWidth}"/>`;
|
|
1063
|
-
if (state.isFinal) {
|
|
1064
|
-
svg += `<circle cx="${x}" cy="${y}" r="${radius - 6}" fill="none" stroke="${borderColor}" stroke-width="2"/>`;
|
|
1065
|
-
}
|
|
1066
|
-
if (state.isInitial) {
|
|
1067
|
-
svg += `<path d="M ${x - radius - config.initialIndicatorOffset} ${y} L ${x - radius - 5} ${y}" stroke="${config.colors.initial}" stroke-width="2" fill="none" marker-end="url(#arrow-initial)"/>`;
|
|
1068
|
-
}
|
|
1069
|
-
svg += `<text x="${x}" y="${y + 7}" text-anchor="middle" fill="${config.colors.nodeText}" font-family="Inter, sans-serif" font-size="18px" font-weight="600">${escapeXml(name)}</text>`;
|
|
1070
|
-
svg += `</g>`;
|
|
1071
|
-
return svg;
|
|
1072
|
-
}
|
|
1073
|
-
function drawTransitionPathSvg(from, to, transitions, positions, config) {
|
|
1074
|
-
const fromPos = positions[from];
|
|
1075
|
-
const toPos = positions[to];
|
|
1076
|
-
if (!fromPos || !toPos) return "";
|
|
1077
|
-
const relevantTransitions = transitions.filter((t) => t.from === from && t.to === to);
|
|
1078
|
-
if (relevantTransitions.length === 0) return "";
|
|
1079
|
-
const fromRadius = getNodeRadius(from, config);
|
|
1080
|
-
const toRadius = getNodeRadius(to, config);
|
|
1081
|
-
const dx = toPos.x - fromPos.x;
|
|
1082
|
-
const dy = toPos.y - fromPos.y;
|
|
1083
|
-
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
1084
|
-
if (dist === 0) return "";
|
|
1085
|
-
const nx = dx / dist;
|
|
1086
|
-
const ny = dy / dist;
|
|
1087
|
-
const startX = fromPos.x + nx * fromRadius;
|
|
1088
|
-
const startY = fromPos.y + ny * fromRadius;
|
|
1089
|
-
const endX = toPos.x - nx * (toRadius + 5);
|
|
1090
|
-
const endY = toPos.y - ny * (toRadius + 5);
|
|
1091
|
-
const hasReverse = transitions.some((t) => t.from === to && t.to === from);
|
|
1092
|
-
const isReverse = hasReverse && from > to;
|
|
1093
|
-
const baseOffset = hasReverse ? 50 : 30;
|
|
1094
|
-
const curveOffset = baseOffset + (relevantTransitions.length > 1 ? 20 : 0);
|
|
1095
|
-
const curveDirection = isReverse ? 1 : -1;
|
|
1096
|
-
const midX = (startX + endX) / 2;
|
|
1097
|
-
const midY = (startY + endY) / 2 + curveOffset * curveDirection;
|
|
1098
|
-
return `<path class="transition-path" data-from="${from}" data-to="${to}" d="M ${startX} ${startY} Q ${midX} ${midY} ${endX} ${endY}" stroke="${config.colors.arrow}" stroke-width="1.5" fill="none" marker-end="url(#arrow)"/>`;
|
|
1099
|
-
}
|
|
1100
|
-
function drawTransitionLabelsSvg(from, to, transitions, positions, config) {
|
|
1101
|
-
const fromPos = positions[from];
|
|
1102
|
-
const toPos = positions[to];
|
|
1103
|
-
if (!fromPos || !toPos) return "";
|
|
1104
|
-
const relevantTransitions = transitions.filter((t) => t.from === from && t.to === to);
|
|
1105
|
-
if (relevantTransitions.length === 0) return "";
|
|
1106
|
-
const fromRadius = getNodeRadius(from, config);
|
|
1107
|
-
const toRadius = getNodeRadius(to, config);
|
|
1108
|
-
const dx = toPos.x - fromPos.x;
|
|
1109
|
-
const dy = toPos.y - fromPos.y;
|
|
1110
|
-
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
1111
|
-
if (dist === 0) return "";
|
|
1112
|
-
const nx = dx / dist;
|
|
1113
|
-
const ny = dy / dist;
|
|
1114
|
-
const startX = fromPos.x + nx * fromRadius;
|
|
1115
|
-
const startY = fromPos.y + ny * fromRadius;
|
|
1116
|
-
const endX = toPos.x - nx * (toRadius + 5);
|
|
1117
|
-
const endY = toPos.y - ny * (toRadius + 5);
|
|
1118
|
-
const hasReverse = transitions.some((t) => t.from === to && t.to === from);
|
|
1119
|
-
const isReverse = hasReverse && from > to;
|
|
1120
|
-
const baseOffset = hasReverse ? 50 : 40;
|
|
1121
|
-
const curveOffset = baseOffset + (relevantTransitions.length > 1 ? 25 : 0);
|
|
1122
|
-
const curveDirection = isReverse ? 1 : -1;
|
|
1123
|
-
const midX = (startX + endX) / 2;
|
|
1124
|
-
const midY = (startY + endY) / 2 + curveOffset * curveDirection;
|
|
1125
|
-
let svg = "";
|
|
1126
|
-
relevantTransitions.forEach((transition, index) => {
|
|
1127
|
-
const blockOffset = index * 60 * curveDirection;
|
|
1128
|
-
const dataAttrs = `data-from="${from}" data-to="${to}" data-event="${transition.event}"`;
|
|
1129
|
-
const labelY = midY + curveDirection * 5 + blockOffset;
|
|
1130
|
-
svg += `<g class="transition-group" ${dataAttrs}>`;
|
|
1131
|
-
svg += `<text class="transition-label transition-event" x="${midX}" y="${labelY}" text-anchor="middle" fill="${config.colors.arrowText}" font-family="JetBrains Mono, monospace" font-size="14px" font-weight="600">${escapeXml(transition.event)}</text>`;
|
|
1132
|
-
const hasGuard = !!transition.guard;
|
|
1133
|
-
const guardText = hasGuard && transition.guard !== void 0 ? formatGuardHuman(transition.guard) : "";
|
|
1134
|
-
const effectLines = transition.effects ? formatEffectsHuman(transition.effects) : [];
|
|
1135
|
-
const hasEffects = effectLines.length > 0;
|
|
1136
|
-
if (hasGuard || hasEffects) {
|
|
1137
|
-
const tooltipStartY = labelY + 20 * curveDirection;
|
|
1138
|
-
const lineHeight = 18;
|
|
1139
|
-
const padding = 12;
|
|
1140
|
-
let maxTextWidth = 0;
|
|
1141
|
-
if (guardText) maxTextWidth = Math.max(maxTextWidth, guardText.length * 7);
|
|
1142
|
-
effectLines.forEach((line) => {
|
|
1143
|
-
maxTextWidth = Math.max(maxTextWidth, line.length * 7);
|
|
1144
|
-
});
|
|
1145
|
-
const boxWidth = Math.max(180, Math.min(maxTextWidth + padding * 2 + 20, 400));
|
|
1146
|
-
const numLines = (hasGuard ? 1 : 0) + effectLines.length;
|
|
1147
|
-
const boxHeight = numLines * lineHeight + padding * 2;
|
|
1148
|
-
const boxY = curveDirection > 0 ? tooltipStartY : tooltipStartY - boxHeight;
|
|
1149
|
-
svg += `<g class="transition-detail">`;
|
|
1150
|
-
svg += `<rect x="${midX - boxWidth / 2}" y="${boxY}" width="${boxWidth}" height="${boxHeight}" fill="rgba(22, 27, 34, 0.95)" stroke="${config.colors.nodeBorder}" stroke-width="1" rx="6"/>`;
|
|
1151
|
-
let currentY = boxY + padding + 12;
|
|
1152
|
-
if (hasGuard && guardText) {
|
|
1153
|
-
svg += `<text x="${midX - boxWidth / 2 + padding}" y="${currentY}" fill="${config.colors.guardText}" font-family="Inter, sans-serif" font-size="12px">`;
|
|
1154
|
-
svg += `<tspan font-weight="600">Guard:</tspan> ${escapeXml(guardText)}</text>`;
|
|
1155
|
-
currentY += lineHeight;
|
|
1156
|
-
}
|
|
1157
|
-
if (hasEffects) {
|
|
1158
|
-
effectLines.forEach((effectText, idx) => {
|
|
1159
|
-
const prefix = idx === 0 ? "Then: " : " ";
|
|
1160
|
-
svg += `<text x="${midX - boxWidth / 2 + padding}" y="${currentY}" fill="${config.colors.effectText}" font-family="Inter, sans-serif" font-size="12px">`;
|
|
1161
|
-
svg += `<tspan font-weight="${idx === 0 ? "600" : "400"}">${prefix}</tspan>${escapeXml(effectText)}</text>`;
|
|
1162
|
-
currentY += lineHeight;
|
|
1163
|
-
});
|
|
1164
|
-
}
|
|
1165
|
-
svg += `</g>`;
|
|
1166
|
-
}
|
|
1167
|
-
svg += `</g>`;
|
|
1168
|
-
});
|
|
1169
|
-
return svg;
|
|
1170
|
-
}
|
|
1171
|
-
function drawEntityInputSvg(entity, x, y, _height) {
|
|
1172
|
-
const fieldCount = entity.fields ? entity.fields.length : 0;
|
|
1173
|
-
const boxWidth = 160;
|
|
1174
|
-
const boxHeight = Math.max(80, fieldCount * 22 + 50);
|
|
1175
|
-
const boxY = y - boxHeight / 2;
|
|
1176
|
-
let svg = `<g class="entity-input">
|
|
1177
|
-
<rect x="${x}" y="${boxY}" width="${boxWidth}" height="${boxHeight}" fill="#1a1f2e" stroke="#4a9eff" stroke-width="2" rx="8"/>
|
|
1178
|
-
<text x="${x + boxWidth / 2}" y="${boxY + 24}" text-anchor="middle" fill="#4a9eff" font-family="Inter, sans-serif" font-size="14px" font-weight="600">\u{1F4E6} ${escapeXml(entity.name || "Entity")}</text>`;
|
|
1179
|
-
if (entity.fields && entity.fields.length > 0) {
|
|
1180
|
-
entity.fields.forEach((field, idx) => {
|
|
1181
|
-
const fieldName = typeof field === "string" ? field : field.name;
|
|
1182
|
-
svg += `<text x="${x + 12}" y="${boxY + 48 + idx * 20}" fill="#8b949e" font-family="JetBrains Mono, monospace" font-size="11px">\u2022 ${escapeXml(fieldName)}</text>`;
|
|
1183
|
-
});
|
|
1184
|
-
}
|
|
1185
|
-
svg += `<path d="M ${x + boxWidth + 5} ${y} L ${x + boxWidth + 40} ${y}" stroke="#4a9eff" stroke-width="2" fill="none" marker-end="url(#arrow-input)"/>`;
|
|
1186
|
-
svg += `</g>`;
|
|
1187
|
-
return svg;
|
|
1188
|
-
}
|
|
1189
|
-
function drawOutputsSvg(outputs, x, y, height) {
|
|
1190
|
-
if (!outputs || outputs.length === 0) return "";
|
|
1191
|
-
const maxOutputLength = Math.max(...outputs.map((o) => o.length));
|
|
1192
|
-
const boxWidth = Math.max(200, maxOutputLength * 7 + 30);
|
|
1193
|
-
const lineHeight = 22;
|
|
1194
|
-
const boxHeight = outputs.length * lineHeight + 50;
|
|
1195
|
-
const boxY = y - boxHeight / 2;
|
|
1196
|
-
let svg = `<g class="outputs">
|
|
1197
|
-
<rect x="${x}" y="${boxY}" width="${boxWidth}" height="${boxHeight}" fill="#1a1f2e" stroke="#ffb86c" stroke-width="2" rx="8"/>
|
|
1198
|
-
<text x="${x + boxWidth / 2}" y="${boxY + 24}" text-anchor="middle" fill="#ffb86c" font-family="Inter, sans-serif" font-size="13px" font-weight="600">\u{1F4E4} External Effects</text>`;
|
|
1199
|
-
outputs.forEach((output, idx) => {
|
|
1200
|
-
svg += `<text x="${x + 12}" y="${boxY + 48 + idx * lineHeight}" fill="#e6edf3" font-family="Inter, sans-serif" font-size="11px">\u2022 ${escapeXml(output)}</text>`;
|
|
1201
|
-
});
|
|
1202
|
-
svg += `</g>`;
|
|
1203
|
-
return svg;
|
|
1204
|
-
}
|
|
1205
|
-
function drawLegendSvg(y, config) {
|
|
1206
|
-
const items = [
|
|
1207
|
-
{ label: "Initial", color: config.colors.initialNode },
|
|
1208
|
-
{ label: "Final", color: config.colors.finalNode },
|
|
1209
|
-
{ label: "State", color: config.colors.nodeBorder }
|
|
1210
|
-
];
|
|
1211
|
-
let svg = `<g class="legend">`;
|
|
1212
|
-
let x = 20;
|
|
1213
|
-
items.forEach((item) => {
|
|
1214
|
-
svg += `<circle cx="${x}" cy="${y}" r="6" fill="${config.colors.node}" stroke="${item.color}" stroke-width="2"/>`;
|
|
1215
|
-
svg += `<text x="${x + 12}" y="${y + 4}" fill="${config.colors.arrowText}" font-family="Inter, sans-serif" font-size="10px">${escapeXml(item.label)}</text>`;
|
|
1216
|
-
x += 70;
|
|
1217
|
-
});
|
|
1218
|
-
svg += `</g>`;
|
|
1219
|
-
return svg;
|
|
1220
|
-
}
|
|
1221
|
-
function renderStateMachineToSvg(stateMachine, options = {}, config = DEFAULT_CONFIG) {
|
|
1222
|
-
const states = stateMachine.states || [];
|
|
1223
|
-
const transitions = stateMachine.transitions || [];
|
|
1224
|
-
const title = options.title || "";
|
|
1225
|
-
const entity = options.entity;
|
|
1226
|
-
const outputs = extractOutputsFromTransitions(transitions);
|
|
1227
|
-
const layoutOptions = {
|
|
1228
|
-
hasEntity: !!entity,
|
|
1229
|
-
hasOutputs: outputs.length > 0
|
|
1230
|
-
};
|
|
1231
|
-
const { positions, width, height } = calculateLayout(states, transitions, layoutOptions, config);
|
|
1232
|
-
let svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height + 40}" viewBox="0 0 ${width} ${height + 40}" class="orbital-state-machine" style="display: block; max-width: none;">`;
|
|
1233
|
-
svg += `<defs>`;
|
|
1234
|
-
svg += createArrowMarkerSvg("arrow", config.colors.arrow, config);
|
|
1235
|
-
svg += createArrowMarkerSvg("arrow-initial", config.colors.initial, config);
|
|
1236
|
-
svg += createArrowMarkerSvg("arrow-input", "#4a9eff", config);
|
|
1237
|
-
svg += createArrowMarkerSvg("arrow-output", "#ffb86c", config);
|
|
1238
|
-
svg += `</defs>`;
|
|
1239
|
-
svg += `<rect x="0" y="0" width="${width}" height="${height + 40}" fill="${config.colors.background}" rx="8"/>`;
|
|
1240
|
-
if (title) {
|
|
1241
|
-
svg += `<text x="${width / 2}" y="20" text-anchor="middle" fill="${config.colors.nodeText}" font-family="Inter, sans-serif" font-size="14px" font-weight="600">${escapeXml(title)}</text>`;
|
|
1242
|
-
}
|
|
1243
|
-
const offsetY = title ? 30 : 0;
|
|
1244
|
-
svg += `<g transform="translate(0, ${offsetY})">`;
|
|
1245
|
-
if (entity) {
|
|
1246
|
-
svg += drawEntityInputSvg(entity, 20, height / 2);
|
|
1247
|
-
}
|
|
1248
|
-
const drawnPairs = /* @__PURE__ */ new Set();
|
|
1249
|
-
transitions.forEach((transition) => {
|
|
1250
|
-
const pairKey = `${transition.from}->${transition.to}`;
|
|
1251
|
-
if (!drawnPairs.has(pairKey)) {
|
|
1252
|
-
drawnPairs.add(pairKey);
|
|
1253
|
-
svg += drawTransitionPathSvg(transition.from, transition.to, transitions, positions, config);
|
|
1254
|
-
}
|
|
1255
|
-
});
|
|
1256
|
-
for (const [name, pos] of Object.entries(positions)) {
|
|
1257
|
-
svg += drawStateSvg(name, pos.x, pos.y, pos.state, config);
|
|
1258
|
-
}
|
|
1259
|
-
drawnPairs.clear();
|
|
1260
|
-
transitions.forEach((transition) => {
|
|
1261
|
-
const pairKey = `${transition.from}->${transition.to}`;
|
|
1262
|
-
if (!drawnPairs.has(pairKey)) {
|
|
1263
|
-
drawnPairs.add(pairKey);
|
|
1264
|
-
svg += drawTransitionLabelsSvg(transition.from, transition.to, transitions, positions, config);
|
|
1265
|
-
}
|
|
1266
|
-
});
|
|
1267
|
-
if (outputs.length > 0) {
|
|
1268
|
-
const maxX = Math.max(...Object.values(positions).map((p) => p.x));
|
|
1269
|
-
svg += drawOutputsSvg(outputs, maxX + config.nodeRadius + 60, height / 2);
|
|
1270
|
-
}
|
|
1271
|
-
svg += `</g>`;
|
|
1272
|
-
svg += drawLegendSvg(height + 25, config);
|
|
1273
|
-
svg += `</svg>`;
|
|
1274
|
-
return svg;
|
|
1275
|
-
}
|
|
1276
|
-
function extractStateMachine(data) {
|
|
1277
|
-
if (!data || typeof data !== "object") return null;
|
|
1278
|
-
const obj = data;
|
|
1279
|
-
if (obj.states && obj.transitions) {
|
|
1280
|
-
return { states: obj.states, transitions: obj.transitions };
|
|
1281
|
-
}
|
|
1282
|
-
if (obj.stateMachine) {
|
|
1283
|
-
return obj.stateMachine;
|
|
1284
|
-
}
|
|
1285
|
-
if (Array.isArray(obj.traits)) {
|
|
1286
|
-
const traitWithSM = obj.traits.find((t) => t.stateMachine != null);
|
|
1287
|
-
if (traitWithSM?.stateMachine) {
|
|
1288
|
-
return traitWithSM.stateMachine;
|
|
1289
|
-
}
|
|
1290
|
-
}
|
|
1291
|
-
return null;
|
|
1292
|
-
}
|
|
1293
|
-
function calculateTransitionPathData(from, to, transitions, positions, config) {
|
|
1294
|
-
const fromPos = positions[from];
|
|
1295
|
-
const toPos = positions[to];
|
|
1296
|
-
if (!fromPos || !toPos) return null;
|
|
1297
|
-
const relevantTransitions = transitions.filter((t) => t.from === from && t.to === to);
|
|
1298
|
-
if (relevantTransitions.length === 0) return null;
|
|
1299
|
-
const fromRadius = getNodeRadius(from, config);
|
|
1300
|
-
const toRadius = getNodeRadius(to, config);
|
|
1301
|
-
if (from === to) {
|
|
1302
|
-
const loopRadius = 50;
|
|
1303
|
-
const cx = fromPos.x;
|
|
1304
|
-
const cy = fromPos.y - fromRadius - loopRadius;
|
|
1305
|
-
const startAngle = -0.5;
|
|
1306
|
-
const endAngle = 0.5;
|
|
1307
|
-
const startX2 = fromPos.x + Math.cos(-Math.PI / 2 + startAngle) * fromRadius;
|
|
1308
|
-
const startY2 = fromPos.y + Math.sin(-Math.PI / 2 + startAngle) * fromRadius;
|
|
1309
|
-
const endX2 = fromPos.x + Math.cos(-Math.PI / 2 + endAngle) * fromRadius;
|
|
1310
|
-
const endY2 = fromPos.y + Math.sin(-Math.PI / 2 + endAngle) * fromRadius;
|
|
1311
|
-
const pathData = `M ${startX2} ${startY2} A ${loopRadius} ${loopRadius} 0 1 1 ${endX2} ${endY2}`;
|
|
1312
|
-
return {
|
|
1313
|
-
pathData,
|
|
1314
|
-
labelX: cx,
|
|
1315
|
-
labelY: cy - loopRadius * 0.5
|
|
1316
|
-
};
|
|
1317
|
-
}
|
|
1318
|
-
const dx = toPos.x - fromPos.x;
|
|
1319
|
-
const dy = toPos.y - fromPos.y;
|
|
1320
|
-
const dist = Math.sqrt(dx * dx + dy * dy);
|
|
1321
|
-
if (dist === 0) return null;
|
|
1322
|
-
const nx = dx / dist;
|
|
1323
|
-
const ny = dy / dist;
|
|
1324
|
-
const startX = fromPos.x + nx * fromRadius;
|
|
1325
|
-
const startY = fromPos.y + ny * fromRadius;
|
|
1326
|
-
const endX = toPos.x - nx * (toRadius + 5);
|
|
1327
|
-
const endY = toPos.y - ny * (toRadius + 5);
|
|
1328
|
-
const hasReverse = transitions.some((t) => t.from === to && t.to === from);
|
|
1329
|
-
const isReverse = hasReverse && from > to;
|
|
1330
|
-
const baseOffset = hasReverse ? 50 : 30;
|
|
1331
|
-
const curveOffset = baseOffset + (relevantTransitions.length > 1 ? 20 : 0);
|
|
1332
|
-
const curveDirection = isReverse ? 1 : -1;
|
|
1333
|
-
const midX = (startX + endX) / 2;
|
|
1334
|
-
const midY = (startY + endY) / 2 + curveOffset * curveDirection;
|
|
1335
|
-
return {
|
|
1336
|
-
pathData: `M ${startX} ${startY} Q ${midX} ${midY} ${endX} ${endY}`,
|
|
1337
|
-
labelX: midX,
|
|
1338
|
-
labelY: midY + curveDirection * 5
|
|
1339
|
-
};
|
|
1340
|
-
}
|
|
1341
|
-
function renderStateMachineToDomData(stateMachine, options = {}, config = DEFAULT_CONFIG) {
|
|
1342
|
-
const states = stateMachine.states || [];
|
|
1343
|
-
const transitions = stateMachine.transitions || [];
|
|
1344
|
-
const title = options.title || "";
|
|
1345
|
-
const entity = options.entity;
|
|
1346
|
-
const outputs = extractOutputsFromTransitions(transitions);
|
|
1347
|
-
const layoutOptions = {
|
|
1348
|
-
hasEntity: !!entity,
|
|
1349
|
-
hasOutputs: outputs.length > 0
|
|
1350
|
-
};
|
|
1351
|
-
const { positions, width, height } = calculateLayout(states, transitions, layoutOptions, config);
|
|
1352
|
-
const domStates = Object.entries(positions).map(([name, pos]) => ({
|
|
1353
|
-
id: `state-${name}`,
|
|
1354
|
-
name,
|
|
1355
|
-
x: pos.x,
|
|
1356
|
-
y: pos.y,
|
|
1357
|
-
radius: getNodeRadius(name, config),
|
|
1358
|
-
isInitial: pos.state.isInitial ?? false,
|
|
1359
|
-
isFinal: pos.state.isFinal ?? false,
|
|
1360
|
-
description: pos.state.description
|
|
1361
|
-
}));
|
|
1362
|
-
const domPaths = [];
|
|
1363
|
-
const domLabels = [];
|
|
1364
|
-
const drawnPairs = /* @__PURE__ */ new Set();
|
|
1365
|
-
transitions.forEach((transition, idx) => {
|
|
1366
|
-
const pairKey = `${transition.from}->${transition.to}`;
|
|
1367
|
-
if (!drawnPairs.has(pairKey)) {
|
|
1368
|
-
drawnPairs.add(pairKey);
|
|
1369
|
-
const pathData2 = calculateTransitionPathData(
|
|
1370
|
-
transition.from,
|
|
1371
|
-
transition.to,
|
|
1372
|
-
transitions,
|
|
1373
|
-
positions,
|
|
1374
|
-
config
|
|
1375
|
-
);
|
|
1376
|
-
if (pathData2) {
|
|
1377
|
-
domPaths.push({
|
|
1378
|
-
id: `path-${transition.from}-${transition.to}`,
|
|
1379
|
-
from: transition.from,
|
|
1380
|
-
to: transition.to,
|
|
1381
|
-
pathData: pathData2.pathData,
|
|
1382
|
-
labelX: pathData2.labelX,
|
|
1383
|
-
labelY: pathData2.labelY
|
|
1384
|
-
});
|
|
1385
|
-
}
|
|
1386
|
-
}
|
|
1387
|
-
const guardText = transition.guard ? formatGuardHuman(transition.guard) : void 0;
|
|
1388
|
-
const effectTexts = transition.effects ? formatEffectsHuman(transition.effects) : [];
|
|
1389
|
-
const hasDetails = !!guardText || effectTexts.length > 0;
|
|
1390
|
-
const pathData = calculateTransitionPathData(
|
|
1391
|
-
transition.from,
|
|
1392
|
-
transition.to,
|
|
1393
|
-
transitions,
|
|
1394
|
-
positions,
|
|
1395
|
-
config
|
|
1396
|
-
);
|
|
1397
|
-
if (pathData) {
|
|
1398
|
-
const sameEventIndex = domLabels.filter(
|
|
1399
|
-
(l) => l.from === transition.from && l.to === transition.to
|
|
1400
|
-
).length;
|
|
1401
|
-
const labelOffset = sameEventIndex * 60;
|
|
1402
|
-
domLabels.push({
|
|
1403
|
-
id: `label-${transition.from}-${transition.to}-${idx}`,
|
|
1404
|
-
from: transition.from,
|
|
1405
|
-
to: transition.to,
|
|
1406
|
-
event: transition.event,
|
|
1407
|
-
x: pathData.labelX,
|
|
1408
|
-
y: pathData.labelY + labelOffset,
|
|
1409
|
-
guardText,
|
|
1410
|
-
effectTexts,
|
|
1411
|
-
hasDetails
|
|
1412
|
-
});
|
|
1413
|
-
}
|
|
1414
|
-
});
|
|
1415
|
-
let domEntity;
|
|
1416
|
-
if (entity) {
|
|
1417
|
-
const fieldCount = entity.fields ? entity.fields.length : 0;
|
|
1418
|
-
const boxWidth = 160;
|
|
1419
|
-
const boxHeight = Math.max(80, fieldCount * 22 + 50);
|
|
1420
|
-
domEntity = {
|
|
1421
|
-
name: entity.name || "Entity",
|
|
1422
|
-
fields: entity.fields?.map((f) => typeof f === "string" ? f : f.name) || [],
|
|
1423
|
-
x: 20,
|
|
1424
|
-
y: height / 2 - boxHeight / 2,
|
|
1425
|
-
width: boxWidth,
|
|
1426
|
-
height: boxHeight
|
|
1427
|
-
};
|
|
1428
|
-
}
|
|
1429
|
-
let domOutputs;
|
|
1430
|
-
if (outputs.length > 0) {
|
|
1431
|
-
const maxX = Math.max(...Object.values(positions).map((p) => p.x));
|
|
1432
|
-
const maxOutputLength = Math.max(...outputs.map((o) => o.length));
|
|
1433
|
-
const boxWidth = Math.max(200, maxOutputLength * 7 + 30);
|
|
1434
|
-
const lineHeight = 22;
|
|
1435
|
-
const boxHeight = outputs.length * lineHeight + 50;
|
|
1436
|
-
domOutputs = {
|
|
1437
|
-
outputs,
|
|
1438
|
-
x: maxX + config.nodeRadius + 300,
|
|
1439
|
-
y: height / 2 - boxHeight / 2,
|
|
1440
|
-
width: boxWidth,
|
|
1441
|
-
height: boxHeight
|
|
1442
|
-
};
|
|
1443
|
-
}
|
|
1444
|
-
return {
|
|
1445
|
-
width,
|
|
1446
|
-
height: height + 40,
|
|
1447
|
-
title: title || void 0,
|
|
1448
|
-
states: domStates,
|
|
1449
|
-
paths: domPaths,
|
|
1450
|
-
labels: domLabels,
|
|
1451
|
-
entity: domEntity,
|
|
1452
|
-
outputs: domOutputs,
|
|
1453
|
-
config
|
|
1454
|
-
};
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
// lib/parseContentSegments.ts
|
|
1458
|
-
function tryParseOrbitalSchema(code) {
|
|
1459
|
-
try {
|
|
1460
|
-
const parsed = JSON.parse(code);
|
|
1461
|
-
if (typeof parsed !== "object" || parsed === null) return null;
|
|
1462
|
-
if ("states" in parsed && "transitions" in parsed || Array.isArray(parsed.orbitals)) {
|
|
1463
|
-
return parsed;
|
|
1464
|
-
}
|
|
1465
|
-
} catch {
|
|
1466
|
-
}
|
|
1467
|
-
return null;
|
|
1468
|
-
}
|
|
1469
|
-
function parseMarkdownWithCodeBlocks(content) {
|
|
1470
|
-
if (!content) return [];
|
|
1471
|
-
const segments = [];
|
|
1472
|
-
const codeBlockRegex = /```(\w+)?\n([\s\S]*?)```/g;
|
|
1473
|
-
let lastIndex = 0;
|
|
1474
|
-
let match;
|
|
1475
|
-
while ((match = codeBlockRegex.exec(content)) !== null) {
|
|
1476
|
-
const before = content.slice(lastIndex, match.index);
|
|
1477
|
-
if (before.trim()) {
|
|
1478
|
-
segments.push({ type: "markdown", content: before });
|
|
1479
|
-
}
|
|
1480
|
-
const language = match[1] || "text";
|
|
1481
|
-
const code = match[2].trim();
|
|
1482
|
-
if (language === "json" || language === "orb") {
|
|
1483
|
-
const schema = tryParseOrbitalSchema(code);
|
|
1484
|
-
if (schema) {
|
|
1485
|
-
segments.push({ type: "orbital", language, content: code, schema });
|
|
1486
|
-
lastIndex = codeBlockRegex.lastIndex;
|
|
1487
|
-
continue;
|
|
1488
|
-
}
|
|
1489
|
-
}
|
|
1490
|
-
segments.push({ type: "code", language, content: code });
|
|
1491
|
-
lastIndex = codeBlockRegex.lastIndex;
|
|
1492
|
-
}
|
|
1493
|
-
const remaining = content.slice(lastIndex);
|
|
1494
|
-
if (remaining.trim()) {
|
|
1495
|
-
segments.push({ type: "markdown", content: remaining });
|
|
1496
|
-
}
|
|
1497
|
-
return segments;
|
|
1498
|
-
}
|
|
1499
|
-
function parseContentSegments(content) {
|
|
1500
|
-
if (!content) return [];
|
|
1501
|
-
const segments = [];
|
|
1502
|
-
const tagRegex = /<question>([\s\S]*?)<\/question>\s*<answer>([\s\S]*?)<\/answer>/gi;
|
|
1503
|
-
let lastIndex = 0;
|
|
1504
|
-
let match;
|
|
1505
|
-
while ((match = tagRegex.exec(content)) !== null) {
|
|
1506
|
-
const before = content.slice(lastIndex, match.index);
|
|
1507
|
-
if (before.trim()) {
|
|
1508
|
-
segments.push(...parseMarkdownWithCodeBlocks(before));
|
|
1509
|
-
}
|
|
1510
|
-
segments.push({
|
|
1511
|
-
type: "quiz",
|
|
1512
|
-
question: match[1].trim(),
|
|
1513
|
-
answer: match[2].trim()
|
|
1514
|
-
});
|
|
1515
|
-
lastIndex = tagRegex.lastIndex;
|
|
1516
|
-
}
|
|
1517
|
-
const remaining = content.slice(lastIndex);
|
|
1518
|
-
if (remaining.trim()) {
|
|
1519
|
-
segments.push(...parseMarkdownWithCodeBlocks(remaining));
|
|
1520
|
-
}
|
|
1521
|
-
return segments;
|
|
1522
|
-
}
|
|
1523
|
-
|
|
1524
|
-
export { ApiError, DEFAULT_CONFIG, apiClient, bindCanvasCapture, bindEventBus, bindTraitStateGetter, clearDebugEvents, clearEntityProvider, clearGuardHistory, clearTicks, clearTraits, clearVerification, cn, debug, debugCollision, debugError, debugGameState, debugGroup, debugGroupEnd, debugInput, debugPhysics, debugTable, debugTime, debugTimeEnd, debugWarn, extractOutputsFromTransitions, extractStateMachine, formatGuard, formatNestedFieldLabel, getAllChecks, getAllTicks, getAllTraits, getBridgeHealth, getDebugEvents, getEffectSummary, getEntitiesByType, getEntityById, getEntitySnapshot, getEventsBySource, getEventsByType, getGuardEvaluationsForTrait, getGuardHistory, getNestedValue, getRecentEvents, getRecentGuardEvaluations, getSnapshot, getSummary, getTick, getTrait, getTraitSnapshots, getTransitions, getTransitionsForTrait, initDebugShortcut, isDebugEnabled, logDebugEvent, logEffectExecuted, logError, logEventFired, logInfo, logStateChange, logWarning, onDebugToggle, parseContentSegments, parseMarkdownWithCodeBlocks, recordGuardEvaluation, recordServerResponse, recordTransition, registerCheck, registerTick, registerTrait, registerTraitSnapshot, renderStateMachineToDomData, renderStateMachineToSvg, setDebugEnabled, setEntityProvider, setTickActive, subscribeToDebugEvents, subscribeToGuardChanges, subscribeToTickChanges, subscribeToTraitChanges, subscribeToVerification, toggleDebug, unregisterTick, unregisterTrait, updateAssetStatus, updateBridgeHealth, updateCheck, updateGuardResult, updateTickExecution, updateTraitState, waitForTransition };
|