@almadar/ui 2.14.0 → 2.15.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/dist/{chunk-M7MOIE46.js → chunk-2KQPOTRM.js} +1 -1
- package/dist/{chunk-SKWPSQHQ.js → chunk-FP3PNF7I.js} +22 -10
- package/dist/components/atoms/AnimatedCounter.d.ts +20 -0
- package/dist/components/atoms/Avatar.d.ts +58 -0
- package/dist/components/atoms/Badge.d.ts +14 -0
- package/dist/components/atoms/Box.d.ts +57 -0
- package/dist/components/atoms/Button.d.ts +24 -0
- package/dist/components/atoms/Card.d.ts +18 -0
- package/dist/components/atoms/Center.d.ts +33 -0
- package/dist/components/atoms/Checkbox.d.ts +9 -0
- package/dist/components/atoms/ConditionalWrapper.d.ts +68 -0
- package/dist/components/atoms/ConfettiEffect.d.ts +19 -0
- package/dist/components/atoms/DayCell.d.ts +21 -0
- package/dist/components/atoms/Divider.d.ts +29 -0
- package/dist/components/atoms/FlipContainer.d.ts +21 -0
- package/dist/components/atoms/Icon.d.ts +39 -0
- package/dist/components/atoms/InfiniteScrollSentinel.d.ts +23 -0
- package/dist/components/atoms/Input.d.ts +26 -0
- package/dist/components/atoms/Label.d.ts +5 -0
- package/dist/components/atoms/LawReferenceTooltip.d.ts +48 -0
- package/dist/components/atoms/Overlay.d.ts +16 -0
- package/dist/components/atoms/ProgressBar.d.ts +63 -0
- package/dist/components/atoms/Radio.d.ts +26 -0
- package/dist/components/atoms/RangeSlider.d.ts +31 -0
- package/dist/components/atoms/Select.d.ts +12 -0
- package/dist/components/atoms/Spacer.d.ts +25 -0
- package/dist/components/atoms/Spinner.d.ts +6 -0
- package/dist/components/atoms/Stack.d.ts +66 -0
- package/dist/components/atoms/StatusDot.d.ts +14 -0
- package/dist/components/atoms/Switch.d.ts +12 -0
- package/dist/components/atoms/TextHighlight.d.ts +53 -0
- package/dist/components/atoms/Textarea.d.ts +5 -0
- package/dist/components/atoms/ThemeSelector.d.ts +21 -0
- package/dist/components/atoms/ThemeToggle.d.ts +33 -0
- package/dist/components/atoms/TimeSlotCell.d.ts +23 -0
- package/dist/components/atoms/TrendIndicator.d.ts +18 -0
- package/dist/components/atoms/TypewriterText.d.ts +20 -0
- package/dist/components/atoms/Typography.d.ts +57 -0
- package/dist/components/atoms/game/ActionButton.d.ts +25 -0
- package/dist/components/atoms/game/ChoiceButton.d.ts +18 -0
- package/dist/components/atoms/game/ComboCounter.d.ts +16 -0
- package/dist/components/atoms/game/ControlButton.d.ts +31 -0
- package/dist/components/atoms/game/DamageNumber.d.ts +14 -0
- package/dist/components/atoms/game/DialogueBubble.d.ts +16 -0
- package/dist/components/atoms/game/HealthBar.d.ts +18 -0
- package/dist/components/atoms/game/ItemSlot.d.ts +25 -0
- package/dist/components/atoms/game/MiniMap.d.ts +36 -0
- package/dist/components/atoms/game/ResourceCounter.d.ts +21 -0
- package/dist/components/atoms/game/ScoreDisplay.d.ts +21 -0
- package/dist/components/atoms/game/Sprite.d.ts +63 -0
- package/dist/components/atoms/game/StateIndicator.d.ts +31 -0
- package/dist/components/atoms/game/StatusEffect.d.ts +21 -0
- package/dist/components/atoms/game/TimerDisplay.d.ts +18 -0
- package/dist/components/atoms/game/TurnIndicator.d.ts +18 -0
- package/dist/components/atoms/game/WaypointMarker.d.ts +19 -0
- package/dist/components/atoms/game/XPBar.d.ts +20 -0
- package/dist/components/atoms/game/index.d.ts +25 -0
- package/dist/components/atoms/index.d.ts +37 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +3 -3
- package/dist/components/molecules/Accordion.d.ts +67 -0
- package/dist/components/molecules/Alert.d.ts +24 -0
- package/dist/components/molecules/Breadcrumb.d.ts +55 -0
- package/dist/components/molecules/ButtonGroup.d.ts +67 -0
- package/dist/components/molecules/CalendarGrid.d.ts +43 -0
- package/dist/components/molecules/Card.d.ts +56 -0
- package/dist/components/molecules/Carousel.d.ts +31 -0
- package/dist/components/molecules/ChartLegend.d.ts +20 -0
- package/dist/components/molecules/Container.d.ts +30 -0
- package/dist/components/molecules/DataGrid.d.ts +75 -0
- package/dist/components/molecules/DataList.d.ts +95 -0
- package/dist/components/molecules/DateRangeSelector.d.ts +22 -0
- package/dist/components/molecules/Drawer.d.ts +46 -0
- package/dist/components/molecules/EmptyState.d.ts +25 -0
- package/dist/components/molecules/ErrorBoundary.d.ts +55 -0
- package/dist/components/molecules/ErrorState.d.ts +13 -0
- package/dist/components/molecules/FilterGroup.d.ts +54 -0
- package/dist/components/molecules/Flex.d.ts +43 -0
- package/dist/components/molecules/FlipCard.d.ts +25 -0
- package/dist/components/molecules/FloatingActionButton.d.ts +69 -0
- package/dist/components/molecules/FormField.d.ts +16 -0
- package/dist/components/molecules/FormSectionHeader.d.ts +30 -0
- package/dist/components/molecules/GraphView.d.ts +45 -0
- package/dist/components/molecules/Grid.d.ts +54 -0
- package/dist/components/molecules/InputGroup.d.ts +24 -0
- package/dist/components/molecules/Lightbox.d.ts +25 -0
- package/dist/components/molecules/LineChart.d.ts +33 -0
- package/dist/components/molecules/LoadingState.d.ts +7 -0
- package/dist/components/molecules/MapView.d.ts +40 -0
- package/dist/components/molecules/Menu.d.ts +40 -0
- package/dist/components/molecules/Meter.d.ts +51 -0
- package/dist/components/molecules/Modal.d.ts +28 -0
- package/dist/components/molecules/NumberStepper.d.ts +27 -0
- package/dist/components/molecules/Pagination.d.ts +66 -0
- package/dist/components/molecules/Popover.d.ts +39 -0
- package/dist/components/molecules/ProgressDots.d.ts +24 -0
- package/dist/components/molecules/PullToRefresh.d.ts +21 -0
- package/dist/components/molecules/QuizBlock.d.ts +20 -0
- package/dist/components/molecules/RelationSelect.d.ts +48 -0
- package/dist/components/molecules/RepeatableFormSection.d.ts +58 -0
- package/dist/components/molecules/ScaledDiagram.d.ts +20 -0
- package/dist/components/molecules/SearchInput.d.ts +60 -0
- package/dist/components/molecules/SidePanel.d.ts +47 -0
- package/dist/components/molecules/SimpleGrid.d.ts +27 -0
- package/dist/components/molecules/Skeleton.d.ts +35 -0
- package/dist/components/molecules/SortableList.d.ts +17 -0
- package/dist/components/molecules/StarRating.d.ts +26 -0
- package/dist/components/molecules/StatDisplay.d.ts +37 -0
- package/dist/components/molecules/SwipeableRow.d.ts +24 -0
- package/dist/components/molecules/Tabs.d.ts +45 -0
- package/dist/components/molecules/Toast.d.ts +35 -0
- package/dist/components/molecules/Tooltip.d.ts +25 -0
- package/dist/components/molecules/UploadDropZone.d.ts +26 -0
- package/dist/components/molecules/ViolationAlert.d.ts +49 -0
- package/dist/components/molecules/WizardNavigation.d.ts +51 -0
- package/dist/components/molecules/WizardProgress.d.ts +42 -0
- package/dist/components/molecules/game/ActionButtons.d.ts +34 -0
- package/dist/components/molecules/game/CombatLog.d.ts +30 -0
- package/dist/components/molecules/game/CraftingRecipe.d.ts +33 -0
- package/dist/components/molecules/game/DPad.d.ts +22 -0
- package/dist/components/molecules/game/DialogueBox.d.ts +78 -0
- package/dist/components/molecules/game/EnemyPlate.d.ts +27 -0
- package/dist/components/molecules/game/GameCanvas2D.d.ts +18 -0
- package/dist/components/molecules/game/GameHud.d.ts +49 -0
- package/dist/components/molecules/game/GameMenu.d.ts +43 -0
- package/dist/components/molecules/game/GameOverScreen.d.ts +56 -0
- package/dist/components/molecules/game/HealthPanel.d.ts +27 -0
- package/dist/components/molecules/game/InventoryGrid.d.ts +30 -0
- package/dist/components/molecules/game/InventoryPanel.d.ts +67 -0
- package/dist/components/molecules/game/IsometricCanvas.d.ts +127 -0
- package/dist/components/molecules/game/PlatformerCanvas.d.ts +52 -0
- package/dist/components/molecules/game/PowerupSlots.d.ts +23 -0
- package/dist/components/molecules/game/QuestTracker.d.ts +20 -0
- package/dist/components/molecules/game/ResourceBar.d.ts +23 -0
- package/dist/components/molecules/game/ScoreBoard.d.ts +18 -0
- package/dist/components/molecules/game/StatBadge.d.ts +27 -0
- package/dist/components/molecules/game/TurnPanel.d.ts +29 -0
- package/dist/components/molecules/game/UnitCommandBar.d.ts +25 -0
- package/dist/components/molecules/game/index.d.ts +30 -0
- package/dist/components/molecules/index.d.ts +59 -0
- package/dist/components/molecules/markdown/CodeBlock.d.ts +25 -0
- package/dist/components/molecules/markdown/MarkdownContent.d.ts +26 -0
- package/dist/components/molecules/markdown/index.d.ts +2 -0
- package/dist/components/organisms/CardGrid.d.ts +80 -0
- package/dist/components/organisms/Chart.d.ts +59 -0
- package/dist/components/organisms/CodeViewer.d.ts +67 -0
- package/dist/components/organisms/ComponentPatterns.d.ts +453 -0
- package/dist/components/organisms/ConfirmDialog.d.ts +50 -0
- package/dist/components/organisms/ContentRenderer.d.ts +23 -0
- package/dist/components/organisms/CustomPattern.d.ts +104 -0
- package/dist/components/organisms/DataTable.d.ts +67 -0
- package/dist/components/organisms/DetailPanel.d.ts +78 -0
- package/dist/components/organisms/DocumentViewer.d.ts +60 -0
- package/dist/components/organisms/DrawerSlot.d.ts +39 -0
- package/dist/components/organisms/Form.d.ts +206 -0
- package/dist/components/organisms/FormSection.d.ts +41 -0
- package/dist/components/organisms/GraphCanvas.d.ts +69 -0
- package/dist/components/organisms/Header.d.ts +110 -0
- package/dist/components/organisms/JazariStateMachine.d.ts +60 -0
- package/dist/components/organisms/LayoutPatterns.d.ts +181 -0
- package/dist/components/organisms/List.d.ts +78 -0
- package/dist/components/organisms/MasterDetail.d.ts +32 -0
- package/dist/components/organisms/MediaGallery.d.ts +57 -0
- package/dist/components/organisms/Meter.d.ts +58 -0
- package/dist/components/organisms/ModalSlot.d.ts +35 -0
- package/dist/components/organisms/Navigation.d.ts +68 -0
- package/dist/components/organisms/NotifyListener.d.ts +15 -0
- package/dist/components/organisms/OrbitalVisualization.d.ts +48 -0
- package/dist/components/organisms/PageHeader.d.ts +59 -0
- package/dist/components/organisms/Section.d.ts +44 -0
- package/dist/components/organisms/Sidebar.d.ts +63 -0
- package/dist/components/organisms/SignaturePad.d.ts +44 -0
- package/dist/components/organisms/Split.d.ts +42 -0
- package/dist/components/organisms/StatCard.d.ts +62 -0
- package/dist/components/organisms/StateMachineView.d.ts +36 -0
- package/dist/components/organisms/Table.d.ts +99 -0
- package/dist/components/organisms/Timeline.d.ts +49 -0
- package/dist/components/organisms/ToastSlot.d.ts +38 -0
- package/dist/components/organisms/UISlotRenderer.d.ts +112 -0
- package/dist/components/organisms/WizardContainer.d.ts +160 -0
- package/dist/components/organisms/book/BookChapterView.d.ts +17 -0
- package/dist/components/organisms/book/BookCoverPage.d.ts +20 -0
- package/dist/components/organisms/book/BookNavBar.d.ts +19 -0
- package/dist/components/organisms/book/BookTableOfContents.d.ts +18 -0
- package/dist/components/organisms/book/BookViewer.d.ts +28 -0
- package/dist/components/organisms/book/index.d.ts +7 -0
- package/dist/components/organisms/book/types.d.ts +77 -0
- package/dist/components/organisms/component-registry.generated.d.ts +9 -0
- package/dist/components/organisms/debug/RuntimeDebugger.d.ts +19 -0
- package/dist/components/organisms/debug/hooks/useDebugData.d.ts +25 -0
- package/dist/components/organisms/debug/index.d.ts +13 -0
- package/dist/components/organisms/debug/tabs/EntitiesTab.d.ts +13 -0
- package/dist/components/organisms/debug/tabs/EventDispatcherTab.d.ts +16 -0
- package/dist/components/organisms/debug/tabs/EventFlowTab.d.ts +9 -0
- package/dist/components/organisms/debug/tabs/GuardsPanel.d.ts +9 -0
- package/dist/components/organisms/debug/tabs/ServerBridgeTab.d.ts +9 -0
- package/dist/components/organisms/debug/tabs/TicksTab.d.ts +13 -0
- package/dist/components/organisms/debug/tabs/TraitsTab.d.ts +13 -0
- package/dist/components/organisms/debug/tabs/TransitionTimeline.d.ts +9 -0
- package/dist/components/organisms/debug/tabs/VerificationTab.d.ts +10 -0
- package/dist/components/organisms/game/BattleBoard.d.ts +175 -0
- package/dist/components/organisms/game/CanvasEffect.d.ts +68 -0
- package/dist/components/organisms/game/CastleBoard.d.ts +85 -0
- package/dist/components/organisms/game/CombatLog.d.ts +2 -0
- package/dist/components/organisms/game/DialogueBox.d.ts +2 -0
- package/dist/components/organisms/game/GameAudioProvider.d.ts +47 -0
- package/dist/components/organisms/game/GameAudioToggle.d.ts +28 -0
- package/dist/components/organisms/game/GameCanvas3D.d.ts +181 -0
- package/dist/components/organisms/game/GameHud.d.ts +2 -0
- package/dist/components/organisms/game/GameMenu.d.ts +2 -0
- package/dist/components/organisms/game/GameOverScreen.d.ts +2 -0
- package/dist/components/organisms/game/InventoryPanel.d.ts +2 -0
- package/dist/components/organisms/game/IsometricCanvas.d.ts +3 -0
- package/dist/components/organisms/game/PlatformerCanvas.d.ts +2 -0
- package/dist/components/organisms/game/TraitSlot.d.ts +90 -0
- package/dist/components/organisms/game/TraitStateViewer.d.ts +53 -0
- package/dist/components/organisms/game/UncontrolledBattleBoard.d.ts +26 -0
- package/dist/components/organisms/game/WorldMapBoard.d.ts +156 -0
- package/dist/components/organisms/game/editor/editorUtils.d.ts +109 -0
- package/dist/components/organisms/game/editor/index.d.ts +9 -0
- package/dist/components/organisms/game/hooks/useBattleState.d.ts +35 -0
- package/dist/components/organisms/game/hooks/useCamera.d.ts +41 -0
- package/dist/components/organisms/game/hooks/useGameAudio.d.ts +47 -0
- package/dist/components/organisms/game/hooks/useImageCache.d.ts +16 -0
- package/dist/components/organisms/game/hooks/usePhysics2D.d.ts +45 -0
- package/dist/components/organisms/game/hooks/useSpriteAnimations.d.ts +43 -0
- package/dist/components/organisms/game/index.d.ts +52 -0
- package/dist/components/organisms/game/managers/PhysicsManager.d.ts +103 -0
- package/dist/components/organisms/game/physics-sim/SimulationCanvas.d.ts +20 -0
- package/dist/components/organisms/game/physics-sim/SimulationControls.d.ts +28 -0
- package/dist/components/organisms/game/physics-sim/SimulationGraph.d.ts +25 -0
- package/dist/components/organisms/game/physics-sim/index.d.ts +7 -0
- package/dist/components/organisms/game/physics-sim/presets/index.d.ts +4 -0
- package/dist/components/organisms/game/physics-sim/presets/mechanics.d.ts +4 -0
- package/dist/components/organisms/game/physics-sim/presets/types.d.ts +43 -0
- package/dist/components/organisms/game/puzzles/builder/BuilderBoard.d.ts +52 -0
- package/dist/components/organisms/game/puzzles/builder/index.d.ts +2 -0
- package/dist/components/organisms/game/puzzles/classifier/ClassifierBoard.d.ts +53 -0
- package/dist/components/organisms/game/puzzles/classifier/index.d.ts +2 -0
- package/dist/components/organisms/game/puzzles/debugger/DebuggerBoard.d.ts +45 -0
- package/dist/components/organisms/game/puzzles/debugger/index.d.ts +2 -0
- package/dist/components/organisms/game/puzzles/event-handler/EventHandlerBoard.d.ts +55 -0
- package/dist/components/organisms/game/puzzles/event-handler/EventLog.d.ts +31 -0
- package/dist/components/organisms/game/puzzles/event-handler/ObjectRulePanel.d.ts +45 -0
- package/dist/components/organisms/game/puzzles/event-handler/RuleEditor.d.ts +41 -0
- package/dist/components/organisms/game/puzzles/event-handler/index.d.ts +8 -0
- package/dist/components/organisms/game/puzzles/negotiator/NegotiatorBoard.d.ts +54 -0
- package/dist/components/organisms/game/puzzles/negotiator/index.d.ts +2 -0
- package/dist/components/organisms/game/puzzles/sequencer/ActionPalette.d.ts +34 -0
- package/dist/components/organisms/game/puzzles/sequencer/ActionTile.d.ts +30 -0
- package/dist/components/organisms/game/puzzles/sequencer/SequenceBar.d.ts +41 -0
- package/dist/components/organisms/game/puzzles/sequencer/SequencerBoard.d.ts +72 -0
- package/dist/components/organisms/game/puzzles/sequencer/index.d.ts +8 -0
- package/dist/components/organisms/game/puzzles/simulator/SimulatorBoard.d.ts +54 -0
- package/dist/components/organisms/game/puzzles/simulator/index.d.ts +2 -0
- package/dist/components/organisms/game/puzzles/state-architect/CodeView.d.ts +24 -0
- package/dist/components/organisms/game/puzzles/state-architect/StateArchitectBoard.d.ts +76 -0
- package/dist/components/organisms/game/puzzles/state-architect/StateNode.d.ts +33 -0
- package/dist/components/organisms/game/puzzles/state-architect/TransitionArrow.d.ts +36 -0
- package/dist/components/organisms/game/puzzles/state-architect/VariablePanel.d.ts +28 -0
- package/dist/components/organisms/game/puzzles/state-architect/index.d.ts +10 -0
- package/dist/components/organisms/game/three/Camera3D.d.ts +60 -0
- package/dist/components/organisms/game/three/Lighting3D.d.ts +47 -0
- package/dist/components/organisms/game/three/Scene3D.d.ts +37 -0
- package/dist/components/organisms/game/three/components/Canvas3DErrorBoundary.d.ts +51 -0
- package/dist/components/organisms/game/three/components/Canvas3DLoadingState.d.ts +44 -0
- package/dist/components/organisms/game/three/components/ModelLoader.d.ts +44 -0
- package/dist/components/organisms/game/three/components/PhysicsObject3D.d.ts +74 -0
- package/dist/components/organisms/game/three/components/index.d.ts +10 -0
- package/dist/components/organisms/game/three/hooks/useAssetLoader.d.ts +58 -0
- package/dist/components/organisms/game/three/hooks/useGameCanvas3DEvents.d.ts +79 -0
- package/dist/components/organisms/game/three/hooks/useRaycaster.d.ts +86 -0
- package/dist/components/organisms/game/three/hooks/useSceneGraph.d.ts +66 -0
- package/dist/components/organisms/game/three/hooks/useThree.d.ts +58 -0
- package/dist/components/organisms/game/three/index.d.ts +23 -0
- package/dist/components/organisms/game/three/loaders/AssetLoader.d.ts +80 -0
- package/dist/components/organisms/game/three/renderers/FeatureRenderer.d.ts +44 -0
- package/dist/components/organisms/game/three/renderers/FeatureRenderer3D.d.ts +44 -0
- package/dist/components/organisms/game/three/renderers/TileRenderer.d.ts +57 -0
- package/dist/components/organisms/game/three/renderers/UnitRenderer.d.ts +46 -0
- package/dist/components/organisms/game/three/renderers/index.d.ts +11 -0
- package/dist/components/organisms/game/three/utils/culling.d.ts +134 -0
- package/dist/components/organisms/game/three/utils/grid3D.d.ts +154 -0
- package/dist/components/organisms/game/types/effects.d.ts +253 -0
- package/dist/components/organisms/game/types/game.d.ts +92 -0
- package/dist/components/organisms/game/types/isometric.d.ts +109 -0
- package/dist/components/organisms/game/types/spriteAnimation.d.ts +73 -0
- package/dist/components/organisms/game/useCanvasEffects.d.ts +26 -0
- package/dist/components/organisms/game/utils/canvasEffects.d.ts +50 -0
- package/dist/components/organisms/game/utils/combatEffects.d.ts +64 -0
- package/dist/components/organisms/game/utils/combatPresets.d.ts +15 -0
- package/dist/components/organisms/game/utils/isometric.d.ts +61 -0
- package/dist/components/organisms/game/utils/spriteAnimation.d.ts +57 -0
- package/dist/components/organisms/game/utils/spriteSheetConstants.d.ts +16 -0
- package/dist/components/organisms/index.d.ts +38 -0
- package/dist/components/organisms/layout/DashboardGrid.d.ts +35 -0
- package/dist/components/organisms/layout/MasterDetail.d.ts +32 -0
- package/dist/components/organisms/layout/SplitPane.d.ts +34 -0
- package/dist/components/organisms/layout/TabbedContainer.d.ts +42 -0
- package/dist/components/organisms/layout/index.d.ts +9 -0
- package/dist/components/organisms/types.d.ts +63 -0
- package/dist/components/templates/AuthLayout.d.ts +14 -0
- package/dist/components/templates/BattleTemplate.d.ts +25 -0
- package/dist/components/templates/CastleTemplate.d.ts +23 -0
- package/dist/components/templates/CounterTemplate.d.ts +44 -0
- package/dist/components/templates/DashboardLayout.d.ts +34 -0
- package/dist/components/templates/GameCanvas3DBattleTemplate.d.ts +96 -0
- package/dist/components/templates/GameCanvas3DCastleTemplate.d.ts +90 -0
- package/dist/components/templates/GameCanvas3DWorldMapTemplate.d.ts +96 -0
- package/dist/components/templates/GameShell.d.ts +34 -0
- package/dist/components/templates/GameTemplate.d.ts +36 -0
- package/dist/components/templates/GenericAppTemplate.d.ts +30 -0
- package/dist/components/templates/WorldMapTemplate.d.ts +29 -0
- package/dist/components/templates/index.d.ts +10 -0
- package/dist/components/templates/types.d.ts +22 -0
- package/dist/context/DesignThemeContext.d.ts +21 -0
- package/dist/context/ThemeContext.d.ts +104 -0
- package/dist/context/UISlotContext.d.ts +75 -0
- package/dist/context/UserContext.d.ts +111 -0
- package/dist/context/index.d.ts +8 -0
- package/dist/hooks/event-bus-types.d.ts +71 -0
- package/dist/hooks/index.d.ts +31 -0
- package/dist/hooks/useAgentChat.d.ts +104 -0
- package/dist/hooks/useAuthContext.d.ts +25 -0
- package/dist/hooks/useCompile.d.ts +22 -0
- package/dist/hooks/useDeepAgentGeneration.d.ts +46 -0
- package/dist/hooks/useDragReorder.d.ts +26 -0
- package/dist/hooks/useEntities.d.ts +52 -0
- package/dist/hooks/useEntityData.d.ts +155 -0
- package/dist/hooks/useEntityMutations.d.ts +80 -0
- package/dist/hooks/useEventBus.d.ts +96 -0
- package/dist/hooks/useExtensions.d.ts +32 -0
- package/dist/hooks/useFileEditor.d.ts +32 -0
- package/dist/hooks/useFileSystem.d.ts +40 -0
- package/dist/hooks/useGitHub.d.ts +58 -0
- package/dist/hooks/useInfiniteScroll.d.ts +13 -0
- package/dist/hooks/useLongPress.d.ts +16 -0
- package/dist/hooks/useOrbitalHistory.d.ts +39 -0
- package/dist/hooks/useOrbitalMutations.d.ts +95 -0
- package/dist/hooks/usePinchZoom.d.ts +22 -0
- package/dist/hooks/usePreview.d.ts +57 -0
- package/dist/hooks/usePullToRefresh.d.ts +25 -0
- package/dist/hooks/useQuerySingleton.d.ts +78 -0
- package/dist/hooks/useResolvedEntity.d.ts +32 -0
- package/dist/hooks/useSwipeGesture.d.ts +26 -0
- package/dist/hooks/useTranslate.d.ts +35 -0
- package/dist/hooks/useUIEvents.d.ts +35 -0
- package/dist/hooks/useUISlots.d.ts +84 -0
- package/dist/hooks/useValidation.d.ts +46 -0
- package/dist/lib/api-client.d.ts +42 -0
- package/dist/lib/cn.d.ts +6 -0
- package/dist/lib/debug.d.ts +43 -0
- package/dist/lib/debugRegistry.d.ts +29 -0
- package/dist/lib/debugUtils.d.ts +27 -0
- package/dist/lib/entityDebug.d.ts +38 -0
- package/dist/lib/getNestedValue.d.ts +33 -0
- package/dist/lib/guardRegistry.d.ts +32 -0
- package/dist/lib/index.d.ts +18 -0
- package/dist/lib/jazari/index.d.ts +5 -0
- package/dist/lib/jazari/layout.d.ts +30 -0
- package/dist/lib/jazari/svg-paths.d.ts +61 -0
- package/dist/lib/jazari/types.d.ts +91 -0
- package/dist/lib/parseContentSegments.d.ts +41 -0
- package/dist/lib/tickRegistry.d.ts +40 -0
- package/dist/lib/traitRegistry.d.ts +34 -0
- package/dist/lib/verificationRegistry.d.ts +138 -0
- package/dist/lib/visualizer/browser.d.ts +47 -0
- package/dist/lib/visualizer/index.d.ts +143 -0
- package/dist/locales/index.d.ts +20 -0
- package/dist/providers/EventBusProvider.d.ts +60 -0
- package/dist/providers/FetchedDataProvider.d.ts +105 -0
- package/dist/providers/OfflineModeProvider.d.ts +79 -0
- package/dist/providers/OrbitalProvider.d.ts +101 -0
- package/dist/providers/SelectionProvider.d.ts +81 -0
- package/dist/providers/VerificationProvider.d.ts +63 -0
- package/dist/providers/index.d.ts +17 -0
- package/dist/providers/index.js +3 -3
- package/dist/renderer/client-effect-executor.d.ts +68 -0
- package/dist/renderer/data-resolver.d.ts +68 -0
- package/dist/renderer/index.d.ts +28 -0
- package/dist/renderer/init.d.ts +14 -0
- package/dist/renderer/navigation.d.ts +142 -0
- package/dist/renderer/offline-executor.d.ts +238 -0
- package/dist/renderer/pattern-resolver.d.ts +91 -0
- package/dist/renderer/slot-definitions.d.ts +45 -0
- package/dist/renderer/types.d.ts +160 -0
- package/dist/renderer/useClientEffects.d.ts +88 -0
- package/dist/runtime/EntitySchemaContext.d.ts +40 -0
- package/dist/runtime/TraitProvider.d.ts +52 -0
- package/dist/runtime/createClientEffectHandlers.d.ts +23 -0
- package/dist/runtime/index.d.ts +15 -0
- package/dist/runtime/index.js +3 -3
- package/dist/runtime/types.d.ts +10 -0
- package/dist/runtime/ui/SlotsContext.d.ts +71 -0
- package/dist/runtime/useResolvedSchema.d.ts +45 -0
- package/dist/runtime/useTraitStateMachine.d.ts +48 -0
- package/dist/scripts/generate-design-system.d.ts +29 -0
- package/dist/scripts/generate-theme-from-schema.d.ts +10 -0
- package/dist/scripts/generate.d.ts +12 -0
- package/dist/scripts/suggest-components.d.ts +31 -0
- package/dist/scripts/types.d.ts +129 -0
- package/dist/stores/entityStore.d.ts +99 -0
- package/dist/stores/filtering.d.ts +51 -0
- package/dist/stores/index.d.ts +7 -0
- package/dist/tsup.config.d.ts +2 -0
- package/dist/vitest.config.d.ts +2 -0
- package/package.json +2 -2
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Event Bus Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the page event bus system.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* A KFlow event that can be emitted on the event bus.
|
|
10
|
+
*/
|
|
11
|
+
export interface KFlowEvent {
|
|
12
|
+
/** Event type identifier (e.g., 'TASK_COMPLETED', 'VALIDATION_SUCCESS') */
|
|
13
|
+
type: string;
|
|
14
|
+
/** Optional payload data */
|
|
15
|
+
payload?: Record<string, unknown>;
|
|
16
|
+
/** Timestamp when the event was emitted */
|
|
17
|
+
timestamp: number;
|
|
18
|
+
/** Source trait or component that emitted the event */
|
|
19
|
+
source?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Event listener callback function.
|
|
23
|
+
*/
|
|
24
|
+
export type EventListener = (event: KFlowEvent) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Function to unsubscribe from events.
|
|
27
|
+
*/
|
|
28
|
+
export type Unsubscribe = () => void;
|
|
29
|
+
/**
|
|
30
|
+
* Event bus context type.
|
|
31
|
+
*/
|
|
32
|
+
export interface EventBusContextType {
|
|
33
|
+
/**
|
|
34
|
+
* Emit an event to all listeners.
|
|
35
|
+
*
|
|
36
|
+
* @param type - Event type identifier
|
|
37
|
+
* @param payload - Optional payload data
|
|
38
|
+
*/
|
|
39
|
+
emit: (type: string, payload?: Record<string, unknown>) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Subscribe to an event type.
|
|
42
|
+
*
|
|
43
|
+
* @param type - Event type to listen for
|
|
44
|
+
* @param listener - Callback function
|
|
45
|
+
* @returns Unsubscribe function
|
|
46
|
+
*/
|
|
47
|
+
on: (type: string, listener: EventListener) => Unsubscribe;
|
|
48
|
+
/**
|
|
49
|
+
* Subscribe to an event type, but only fire once.
|
|
50
|
+
*
|
|
51
|
+
* @param type - Event type to listen for
|
|
52
|
+
* @param listener - Callback function
|
|
53
|
+
* @returns Unsubscribe function
|
|
54
|
+
*/
|
|
55
|
+
once: (type: string, listener: EventListener) => Unsubscribe;
|
|
56
|
+
/**
|
|
57
|
+
* Check if there are any listeners for an event type.
|
|
58
|
+
*
|
|
59
|
+
* @param type - Event type to check
|
|
60
|
+
* @returns True if there are listeners
|
|
61
|
+
*/
|
|
62
|
+
hasListeners: (type: string) => boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Subscribe to ALL events regardless of type.
|
|
65
|
+
* Useful for verification, debugging, and analytics.
|
|
66
|
+
*
|
|
67
|
+
* @param listener - Callback function invoked for every emitted event
|
|
68
|
+
* @returns Unsubscribe function
|
|
69
|
+
*/
|
|
70
|
+
onAny?: (listener: EventListener) => Unsubscribe;
|
|
71
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hooks barrel export
|
|
3
|
+
*/
|
|
4
|
+
export { useOrbitalHistory, type HistoryTimelineItem, type RevertResult, type ChangeSummary, type UseOrbitalHistoryOptions, type UseOrbitalHistoryResult, } from './useOrbitalHistory';
|
|
5
|
+
export { useFileSystem, type FileSystemStatus, type FileSystemFile, type SelectedFile, type UseFileSystemResult, } from './useFileSystem';
|
|
6
|
+
export { useExtensions, type Extension, type ExtensionManifest, type UseExtensionsOptions, type UseExtensionsResult, } from './useExtensions';
|
|
7
|
+
export { useFileEditor, type OpenFile, type UseFileEditorOptions, type UseFileEditorResult, } from './useFileEditor';
|
|
8
|
+
export { useCompile, type CompileStage, type CompileResult, type UseCompileResult, } from './useCompile';
|
|
9
|
+
export { usePreview } from './usePreview';
|
|
10
|
+
export { useAgentChat } from './useAgentChat';
|
|
11
|
+
export { useValidation } from './useValidation';
|
|
12
|
+
export { useDeepAgentGeneration } from './useDeepAgentGeneration';
|
|
13
|
+
export { useEventBus, useEventListener, useEmitEvent } from './useEventBus';
|
|
14
|
+
export type { KFlowEvent, EventListener, Unsubscribe, EventBusContextType } from './event-bus-types';
|
|
15
|
+
export { useUISlotManager, DEFAULT_SLOTS, type UISlot, type SlotAnimation, type SlotContent, type RenderUIConfig, type SlotChangeCallback, type UISlotManager, } from './useUISlots';
|
|
16
|
+
export { useUIEvents, useSelectedEntity } from './useUIEvents';
|
|
17
|
+
export { useEntityList, useEntityDetail, useEntity, useEntityListSuspense, useEntitySuspense, entityDataKeys, EntityDataProvider, useEntityDataAdapter, type EntityDataAdapter, type EntityDataRecord, type UseEntityListOptions, type UseEntityListResult, type UseEntityDetailResult, } from './useEntityData';
|
|
18
|
+
export { useQuerySingleton, parseQueryBinding, type QueryState, type QuerySingletonEntity, type QuerySingletonResult, type QuerySingletonState, } from './useQuerySingleton';
|
|
19
|
+
export { useEntityMutations, useCreateEntity, useUpdateEntity, useDeleteEntity, type EntityMutationResult, type UseEntityMutationsOptions, } from './useEntityMutations';
|
|
20
|
+
export { useOrbitalMutations, useSendOrbitalEvent, ENTITY_EVENTS, type OrbitalEventPayload, type OrbitalEventResponse, } from './useOrbitalMutations';
|
|
21
|
+
export { useEntities, useEntity as useEntityById, useEntitiesByType, useSingletonEntity, usePlayer, usePhysics, useInput, spawnEntity, updateEntity, updateSingleton, removeEntity, clearEntities, getEntity, getByType, getAllEntities, getSingleton, type Entity, } from './useEntities';
|
|
22
|
+
export { useTranslate, I18nProvider, createTranslate, type TranslateFunction, type I18nContextValue, } from './useTranslate';
|
|
23
|
+
export { useResolvedEntity, type ResolvedEntity, } from './useResolvedEntity';
|
|
24
|
+
export { useAuthContext, type AuthUser, type AuthContextValue, } from './useAuthContext';
|
|
25
|
+
export { useSwipeGesture, type SwipeGestureOptions, type SwipeGestureResult, type SwipeHandlers, } from './useSwipeGesture';
|
|
26
|
+
export { useLongPress, type LongPressOptions, type LongPressHandlers, } from './useLongPress';
|
|
27
|
+
export { useDragReorder, type DragReorderResult, } from './useDragReorder';
|
|
28
|
+
export { useInfiniteScroll, type InfiniteScrollOptions, type InfiniteScrollResult, } from './useInfiniteScroll';
|
|
29
|
+
export { usePullToRefresh, type PullToRefreshOptions, type PullToRefreshResult, } from './usePullToRefresh';
|
|
30
|
+
export { usePinchZoom, type PinchZoomOptions, type PinchZoomResult, } from './usePinchZoom';
|
|
31
|
+
export { useGitHubStatus, useConnectGitHub, useDisconnectGitHub, useGitHubRepos, useGitHubRepo, useGitHubBranches, type GitHubStatus, type GitHubRepo, } from './useGitHub';
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { DeepAgentInterrupt } from './useDeepAgentGeneration';
|
|
2
|
+
export interface ChatMessage {
|
|
3
|
+
id: string;
|
|
4
|
+
role: 'user' | 'assistant' | 'system';
|
|
5
|
+
content: string;
|
|
6
|
+
timestamp: number;
|
|
7
|
+
}
|
|
8
|
+
export type AvatarRole = 'user' | 'assistant' | 'system';
|
|
9
|
+
export type FileOperation = 'ls' | 'read_file' | 'write_file' | 'edit_file';
|
|
10
|
+
export type Activity = {
|
|
11
|
+
type: 'message';
|
|
12
|
+
role: AvatarRole;
|
|
13
|
+
content: string;
|
|
14
|
+
timestamp: number;
|
|
15
|
+
isStreaming?: boolean;
|
|
16
|
+
} | {
|
|
17
|
+
type: 'tool_call';
|
|
18
|
+
tool: string;
|
|
19
|
+
args: Record<string, unknown>;
|
|
20
|
+
timestamp: number;
|
|
21
|
+
isExecuting?: boolean;
|
|
22
|
+
} | {
|
|
23
|
+
type: 'tool_result';
|
|
24
|
+
tool: string;
|
|
25
|
+
result: unknown;
|
|
26
|
+
success: boolean;
|
|
27
|
+
timestamp: number;
|
|
28
|
+
} | {
|
|
29
|
+
type: 'file_operation';
|
|
30
|
+
operation: FileOperation;
|
|
31
|
+
path: string;
|
|
32
|
+
success?: boolean;
|
|
33
|
+
timestamp: number;
|
|
34
|
+
} | {
|
|
35
|
+
type: 'schema_diff';
|
|
36
|
+
filePath: string;
|
|
37
|
+
hunks: DiffHunk[];
|
|
38
|
+
timestamp: number;
|
|
39
|
+
} | {
|
|
40
|
+
type: 'error';
|
|
41
|
+
message: string;
|
|
42
|
+
code?: string;
|
|
43
|
+
timestamp: number;
|
|
44
|
+
};
|
|
45
|
+
export interface TodoActivity {
|
|
46
|
+
type: 'thinking' | 'tool_call' | 'tool_result' | 'code_change';
|
|
47
|
+
content: string;
|
|
48
|
+
timestamp: number;
|
|
49
|
+
tool?: string;
|
|
50
|
+
success?: boolean;
|
|
51
|
+
filePath?: string;
|
|
52
|
+
diff?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface Todo {
|
|
55
|
+
id: string;
|
|
56
|
+
task: string;
|
|
57
|
+
status: 'pending' | 'in_progress' | 'completed';
|
|
58
|
+
latestActivity?: TodoActivity;
|
|
59
|
+
activityHistory?: TodoActivity[];
|
|
60
|
+
}
|
|
61
|
+
export interface DiffHunk {
|
|
62
|
+
oldStart: number;
|
|
63
|
+
oldLines: number;
|
|
64
|
+
newStart: number;
|
|
65
|
+
newLines: number;
|
|
66
|
+
lines: Array<{
|
|
67
|
+
type: 'add' | 'remove' | 'context';
|
|
68
|
+
content: string;
|
|
69
|
+
}>;
|
|
70
|
+
}
|
|
71
|
+
export interface SchemaDiff {
|
|
72
|
+
id: string;
|
|
73
|
+
filePath: string;
|
|
74
|
+
hunks: DiffHunk[];
|
|
75
|
+
timestamp: number;
|
|
76
|
+
addedLines: number;
|
|
77
|
+
removedLines: number;
|
|
78
|
+
}
|
|
79
|
+
export type AgentStatus = 'idle' | 'running' | 'complete' | 'error' | 'interrupted';
|
|
80
|
+
export interface UseAgentChatOptions {
|
|
81
|
+
appId?: string;
|
|
82
|
+
onComplete?: (schema?: unknown) => void;
|
|
83
|
+
onSchemaChange?: (diff?: unknown) => void;
|
|
84
|
+
onError?: (error: Error | string) => void;
|
|
85
|
+
}
|
|
86
|
+
export interface UseAgentChatResult {
|
|
87
|
+
messages: ChatMessage[];
|
|
88
|
+
status: AgentStatus;
|
|
89
|
+
activities: Activity[];
|
|
90
|
+
todos: Todo[];
|
|
91
|
+
schemaDiffs: SchemaDiff[];
|
|
92
|
+
isLoading: boolean;
|
|
93
|
+
error: string | null;
|
|
94
|
+
threadId: string | null;
|
|
95
|
+
interrupt: DeepAgentInterrupt | null;
|
|
96
|
+
sendMessage: (content: string) => Promise<void>;
|
|
97
|
+
startGeneration: (skill: string | string[], prompt: string, options?: Record<string, unknown>) => Promise<void>;
|
|
98
|
+
continueConversation: (message: string | string[]) => Promise<void>;
|
|
99
|
+
resumeWithDecision: (decisions: unknown[]) => Promise<void>;
|
|
100
|
+
cancel: () => void;
|
|
101
|
+
clearMessages: () => void;
|
|
102
|
+
clearHistory: () => void;
|
|
103
|
+
}
|
|
104
|
+
export declare function useAgentChat(options?: UseAgentChatOptions): UseAgentChatResult;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth Context Hook Stub
|
|
3
|
+
*
|
|
4
|
+
* Provides a placeholder auth context for the design system.
|
|
5
|
+
* Applications should provide their own AuthContext provider
|
|
6
|
+
* that implements this interface.
|
|
7
|
+
*/
|
|
8
|
+
export interface AuthUser {
|
|
9
|
+
uid: string;
|
|
10
|
+
email: string | null;
|
|
11
|
+
displayName: string | null;
|
|
12
|
+
photoURL: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface AuthContextValue {
|
|
15
|
+
user: AuthUser | null;
|
|
16
|
+
loading: boolean;
|
|
17
|
+
signIn?: () => Promise<void>;
|
|
18
|
+
signOut?: () => Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Stub hook that returns empty auth context.
|
|
22
|
+
* Applications should wrap their app with an AuthProvider
|
|
23
|
+
* that supplies real auth state.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useAuthContext(): AuthContextValue;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface SchemaLike {
|
|
2
|
+
name: string;
|
|
3
|
+
version?: string;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}
|
|
6
|
+
export type CompileStage = 'idle' | 'compiling' | 'done' | 'error';
|
|
7
|
+
export interface CompileResult {
|
|
8
|
+
success: boolean;
|
|
9
|
+
files?: Array<{
|
|
10
|
+
path: string;
|
|
11
|
+
content: string;
|
|
12
|
+
}>;
|
|
13
|
+
errors?: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface UseCompileResult {
|
|
16
|
+
isCompiling: boolean;
|
|
17
|
+
stage: CompileStage;
|
|
18
|
+
lastResult: CompileResult | null;
|
|
19
|
+
error: string | null;
|
|
20
|
+
compileSchema: (schema: SchemaLike) => Promise<CompileResult | null>;
|
|
21
|
+
}
|
|
22
|
+
export declare function useCompile(): UseCompileResult;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { OrbitalSchema } from '@almadar/core';
|
|
2
|
+
export interface DeepAgentActionRequest {
|
|
3
|
+
id: string;
|
|
4
|
+
type: string;
|
|
5
|
+
tool: string;
|
|
6
|
+
args: Record<string, unknown>;
|
|
7
|
+
description?: string;
|
|
8
|
+
allowedDecisions: ('approve' | 'edit' | 'reject')[];
|
|
9
|
+
status: 'pending' | 'approved' | 'rejected' | 'edited';
|
|
10
|
+
}
|
|
11
|
+
export interface DeepAgentInterrupt {
|
|
12
|
+
id: string;
|
|
13
|
+
type: 'tool_calls' | 'confirmation' | 'error';
|
|
14
|
+
message?: string;
|
|
15
|
+
actionRequests: DeepAgentActionRequest[];
|
|
16
|
+
timestamp: number;
|
|
17
|
+
threadId?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface GenerationRequest {
|
|
20
|
+
id: string;
|
|
21
|
+
prompt: string;
|
|
22
|
+
status: 'pending' | 'running' | 'completed' | 'failed';
|
|
23
|
+
result?: OrbitalSchema;
|
|
24
|
+
error?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface GenerationProgress {
|
|
27
|
+
stage: string;
|
|
28
|
+
percent: number;
|
|
29
|
+
message: string;
|
|
30
|
+
}
|
|
31
|
+
export interface UseDeepAgentGenerationResult {
|
|
32
|
+
requests: GenerationRequest[];
|
|
33
|
+
currentRequest: GenerationRequest | null;
|
|
34
|
+
isGenerating: boolean;
|
|
35
|
+
isLoading: boolean;
|
|
36
|
+
isComplete: boolean;
|
|
37
|
+
progress: GenerationProgress;
|
|
38
|
+
error: string | null;
|
|
39
|
+
interrupt: DeepAgentInterrupt | null;
|
|
40
|
+
generate: (prompt: string) => Promise<OrbitalSchema | null>;
|
|
41
|
+
startGeneration: (skill: string, prompt: string, options?: Record<string, unknown>) => Promise<void>;
|
|
42
|
+
cancelGeneration: () => void;
|
|
43
|
+
clearRequests: () => void;
|
|
44
|
+
submitInterruptDecisions: (decisions: unknown[]) => void;
|
|
45
|
+
}
|
|
46
|
+
export declare function useDeepAgentGeneration(): UseDeepAgentGenerationResult;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export interface DragReorderResult<T> {
|
|
3
|
+
/** The reordered items array */
|
|
4
|
+
items: T[];
|
|
5
|
+
/** Index of the item currently being dragged (-1 if not dragging) */
|
|
6
|
+
dragIndex: number;
|
|
7
|
+
/** Index of the drop target (-1 if not over any target) */
|
|
8
|
+
dragOverIndex: number;
|
|
9
|
+
/** Whether a drag is in progress */
|
|
10
|
+
isDragging: boolean;
|
|
11
|
+
/** Props to spread on the drag handle element for a given index */
|
|
12
|
+
getDragHandleProps: (index: number) => {
|
|
13
|
+
onPointerDown: (e: React.PointerEvent) => void;
|
|
14
|
+
style: React.CSSProperties;
|
|
15
|
+
'aria-grabbed': boolean;
|
|
16
|
+
role: string;
|
|
17
|
+
};
|
|
18
|
+
/** Props to spread on each list item for a given index */
|
|
19
|
+
getItemProps: (index: number) => {
|
|
20
|
+
onPointerMove: (e: React.PointerEvent) => void;
|
|
21
|
+
onPointerUp: () => void;
|
|
22
|
+
'aria-dropeffect': string;
|
|
23
|
+
style: React.CSSProperties;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export declare function useDragReorder<T>(initialItems: T[], onReorder: (fromIndex: number, toIndex: number, item: T) => void): DragReorderResult<T>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { getEntity, getByType, getAllEntities, getSingleton, spawnEntity, updateEntity, updateSingleton, removeEntity, clearEntities } from '../stores/entityStore';
|
|
2
|
+
import type { Entity } from '../stores/entityStore';
|
|
3
|
+
export type { Entity };
|
|
4
|
+
/**
|
|
5
|
+
* Hook to access all entities
|
|
6
|
+
*/
|
|
7
|
+
export declare function useEntities(): {
|
|
8
|
+
entities: Map<string, Entity>;
|
|
9
|
+
getEntity: typeof getEntity;
|
|
10
|
+
getByType: typeof getByType;
|
|
11
|
+
getAllEntities: typeof getAllEntities;
|
|
12
|
+
getSingleton: typeof getSingleton;
|
|
13
|
+
spawnEntity: typeof spawnEntity;
|
|
14
|
+
updateEntity: typeof updateEntity;
|
|
15
|
+
updateSingleton: typeof updateSingleton;
|
|
16
|
+
removeEntity: typeof removeEntity;
|
|
17
|
+
clearEntities: typeof clearEntities;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Hook to access a specific entity by ID
|
|
21
|
+
*/
|
|
22
|
+
export declare function useEntity(id: string): Entity | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Hook to access entities of a specific type
|
|
25
|
+
*/
|
|
26
|
+
export declare function useEntitiesByType(type: string): Entity[];
|
|
27
|
+
/**
|
|
28
|
+
* Hook to access a singleton entity by type
|
|
29
|
+
*/
|
|
30
|
+
export declare function useSingletonEntity<T extends Entity = Entity>(type: string): T | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Hook for Player entity (convenience)
|
|
33
|
+
*/
|
|
34
|
+
export declare function usePlayer(): {
|
|
35
|
+
player: Entity | undefined;
|
|
36
|
+
updatePlayer: (updates: Partial<Entity>) => void;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Hook for Physics entity (convenience)
|
|
40
|
+
*/
|
|
41
|
+
export declare function usePhysics(): {
|
|
42
|
+
physics: Entity | undefined;
|
|
43
|
+
updatePhysics: (updates: Partial<Entity>) => void;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Hook for Input entity (convenience)
|
|
47
|
+
*/
|
|
48
|
+
export declare function useInput(): {
|
|
49
|
+
input: Entity | undefined;
|
|
50
|
+
updateInput: (updates: Partial<Entity>) => void;
|
|
51
|
+
};
|
|
52
|
+
export { spawnEntity, updateEntity, updateSingleton, removeEntity, clearEntities, getEntity, getByType, getAllEntities, getSingleton, };
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export interface EntityDataAdapter {
|
|
4
|
+
/** Get all records for an entity */
|
|
5
|
+
getData: (entity: string) => Record<string, unknown>[];
|
|
6
|
+
/** Get a single record by entity name and ID */
|
|
7
|
+
getById: (entity: string, id: string) => Record<string, unknown> | undefined;
|
|
8
|
+
/** Whether data is currently loading */
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
/** Current error */
|
|
11
|
+
error: string | null;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Provider that bridges a host app's data source to useEntityList/useEntity hooks.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* // In builder runtime
|
|
19
|
+
* const fetchedData = useFetchedData();
|
|
20
|
+
* const adapter = {
|
|
21
|
+
* getData: fetchedData.getData,
|
|
22
|
+
* getById: fetchedData.getById,
|
|
23
|
+
* isLoading: fetchedData.loading,
|
|
24
|
+
* error: fetchedData.error,
|
|
25
|
+
* };
|
|
26
|
+
* <EntityDataProvider adapter={adapter}>
|
|
27
|
+
* {children}
|
|
28
|
+
* </EntityDataProvider>
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare function EntityDataProvider({ adapter, children, }: {
|
|
32
|
+
adapter: EntityDataAdapter;
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
}): React.FunctionComponentElement<React.ProviderProps<EntityDataAdapter | null>>;
|
|
35
|
+
/**
|
|
36
|
+
* Access the entity data adapter (null if no provider).
|
|
37
|
+
*/
|
|
38
|
+
export declare function useEntityDataAdapter(): EntityDataAdapter | null;
|
|
39
|
+
export declare const entityDataKeys: {
|
|
40
|
+
all: readonly ["entities"];
|
|
41
|
+
lists: () => readonly ["entities", "list"];
|
|
42
|
+
list: (entity: string, filters?: Record<string, unknown>) => readonly ["entities", "list", string, Record<string, unknown> | undefined];
|
|
43
|
+
details: () => readonly ["entities", "detail"];
|
|
44
|
+
detail: (entity: string, id: string) => readonly ["entities", "detail", string, string];
|
|
45
|
+
};
|
|
46
|
+
export type EntityDataRecord = Record<string, unknown>;
|
|
47
|
+
export interface UseEntityListOptions {
|
|
48
|
+
/** Skip fetching */
|
|
49
|
+
skip?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface UseEntityListResult<T = Record<string, unknown>> {
|
|
52
|
+
data: T[];
|
|
53
|
+
isLoading: boolean;
|
|
54
|
+
error: Error | null;
|
|
55
|
+
refetch: () => void;
|
|
56
|
+
}
|
|
57
|
+
export interface UseEntityDetailResult<T = Record<string, unknown>> {
|
|
58
|
+
data: T | null;
|
|
59
|
+
isLoading: boolean;
|
|
60
|
+
error: Error | null;
|
|
61
|
+
refetch: () => void;
|
|
62
|
+
}
|
|
63
|
+
export interface PaginationParams {
|
|
64
|
+
page: number;
|
|
65
|
+
pageSize: number;
|
|
66
|
+
search?: string;
|
|
67
|
+
sortBy?: string;
|
|
68
|
+
sortDirection?: "asc" | "desc";
|
|
69
|
+
filters?: Record<string, unknown>;
|
|
70
|
+
}
|
|
71
|
+
export interface UsePaginatedEntityListResult<T = Record<string, unknown>> {
|
|
72
|
+
data: T[];
|
|
73
|
+
isLoading: boolean;
|
|
74
|
+
error: Error | null;
|
|
75
|
+
totalCount: number;
|
|
76
|
+
totalPages: number;
|
|
77
|
+
hasNextPage: boolean;
|
|
78
|
+
hasPreviousPage: boolean;
|
|
79
|
+
refetch: () => void;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Hook for fetching entity list data.
|
|
83
|
+
* Uses EntityDataContext if available, otherwise falls back to stub.
|
|
84
|
+
*/
|
|
85
|
+
export declare function useEntityList<T = Record<string, unknown>>(entity: string | undefined, options?: UseEntityListOptions): UseEntityListResult<T>;
|
|
86
|
+
/**
|
|
87
|
+
* Hook for fetching a single entity by ID.
|
|
88
|
+
* Uses EntityDataContext if available, otherwise falls back to stub.
|
|
89
|
+
*/
|
|
90
|
+
export declare function useEntity<T = Record<string, unknown>>(entity: string | undefined, id: string | undefined): {
|
|
91
|
+
data: T | null;
|
|
92
|
+
isLoading: boolean;
|
|
93
|
+
error: Error | null;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Hook for fetching entity detail by ID (alias for useEntity with refetch).
|
|
97
|
+
* Uses EntityDataContext if available, otherwise falls back to stub.
|
|
98
|
+
*/
|
|
99
|
+
export declare function useEntityDetail<T = Record<string, unknown>>(entity: string | undefined, id: string | undefined): UseEntityDetailResult<T>;
|
|
100
|
+
/**
|
|
101
|
+
* Hook for fetching paginated entity list data.
|
|
102
|
+
* Uses EntityDataContext if available (client-side pagination), otherwise falls back to stub.
|
|
103
|
+
*/
|
|
104
|
+
export declare function usePaginatedEntityList<T = Record<string, unknown>>(entity: string | undefined, params: PaginationParams, options?: UseEntityListOptions): UsePaginatedEntityListResult<T>;
|
|
105
|
+
/**
|
|
106
|
+
* Suspense-compatible hook for fetching entity list data.
|
|
107
|
+
*
|
|
108
|
+
* Instead of returning `isLoading`/`error`, this hook **suspends** (throws a Promise)
|
|
109
|
+
* when data is not ready. Use inside a `<Suspense>` boundary.
|
|
110
|
+
*
|
|
111
|
+
* Falls back to the adapter when available; otherwise suspends briefly for stub data.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```tsx
|
|
115
|
+
* <Suspense fallback={<Skeleton variant="table" />}>
|
|
116
|
+
* <ErrorBoundary>
|
|
117
|
+
* <TaskList entity="Task" />
|
|
118
|
+
* </ErrorBoundary>
|
|
119
|
+
* </Suspense>
|
|
120
|
+
*
|
|
121
|
+
* function TaskList({ entity }: { entity: string }) {
|
|
122
|
+
* const { data } = useEntityListSuspense<Task>(entity);
|
|
123
|
+
* // No loading check needed — Suspense handles it
|
|
124
|
+
* return <DataTable data={data} ... />;
|
|
125
|
+
* }
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
export declare function useEntityListSuspense<T = Record<string, unknown>>(entity: string): {
|
|
129
|
+
data: T[];
|
|
130
|
+
refetch: () => void;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Suspense-compatible hook for fetching a single entity by ID.
|
|
134
|
+
*
|
|
135
|
+
* Suspends when data is not ready. Use inside a `<Suspense>` boundary.
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```tsx
|
|
139
|
+
* <Suspense fallback={<Skeleton variant="form" />}>
|
|
140
|
+
* <ErrorBoundary>
|
|
141
|
+
* <TaskDetail entity="Task" id={taskId} />
|
|
142
|
+
* </ErrorBoundary>
|
|
143
|
+
* </Suspense>
|
|
144
|
+
*
|
|
145
|
+
* function TaskDetail({ entity, id }: { entity: string; id: string }) {
|
|
146
|
+
* const { data } = useEntitySuspense<Task>(entity, id);
|
|
147
|
+
* return <DetailPanel data={data} ... />;
|
|
148
|
+
* }
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
export declare function useEntitySuspense<T = Record<string, unknown>>(entity: string, id: string): {
|
|
152
|
+
data: T | null;
|
|
153
|
+
refetch: () => void;
|
|
154
|
+
};
|
|
155
|
+
export default useEntityList;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useEntityMutations - Entity CRUD mutation hooks
|
|
3
|
+
*
|
|
4
|
+
* Provides create, update, and delete mutations for entities.
|
|
5
|
+
* Used by trait hooks for persist_data effects.
|
|
6
|
+
*
|
|
7
|
+
* @deprecated For new code, prefer useOrbitalMutations which sends mutations
|
|
8
|
+
* through the orbital events route. This ensures all mutations go through
|
|
9
|
+
* trait state machines and enforce guards/effects.
|
|
10
|
+
*
|
|
11
|
+
* Migration:
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // Old (deprecated):
|
|
14
|
+
* const { createEntity } = useEntityMutations('Task');
|
|
15
|
+
*
|
|
16
|
+
* // New (recommended):
|
|
17
|
+
* const { createEntity } = useOrbitalMutations('Task', 'TaskManager');
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* @see useOrbitalMutations
|
|
21
|
+
*/
|
|
22
|
+
import { type OrbitalEventResponse } from './useOrbitalMutations';
|
|
23
|
+
export interface EntityMutationResult {
|
|
24
|
+
id: string;
|
|
25
|
+
[key: string]: unknown;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Hook for creating entities
|
|
29
|
+
*/
|
|
30
|
+
export declare function useCreateEntity(entityName: string): import("@tanstack/react-query").UseMutationResult<EntityMutationResult, Error, Record<string, unknown>, unknown>;
|
|
31
|
+
/**
|
|
32
|
+
* Hook for updating entities
|
|
33
|
+
*/
|
|
34
|
+
export declare function useUpdateEntity(entityName: string): import("@tanstack/react-query").UseMutationResult<EntityMutationResult, Error, {
|
|
35
|
+
id: string;
|
|
36
|
+
data: Record<string, unknown>;
|
|
37
|
+
}, unknown>;
|
|
38
|
+
/**
|
|
39
|
+
* Hook for deleting entities
|
|
40
|
+
*/
|
|
41
|
+
export declare function useDeleteEntity(entityName: string): import("@tanstack/react-query").UseMutationResult<{
|
|
42
|
+
id: string;
|
|
43
|
+
}, Error, string, unknown>;
|
|
44
|
+
export interface UseEntityMutationsOptions {
|
|
45
|
+
/**
|
|
46
|
+
* If provided, mutations go through orbital events route instead of direct CRUD.
|
|
47
|
+
* This is the recommended approach for Phase 7+ compliance.
|
|
48
|
+
*/
|
|
49
|
+
orbitalName?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Custom event names when using orbital-based mutations
|
|
52
|
+
*/
|
|
53
|
+
events?: {
|
|
54
|
+
create?: string;
|
|
55
|
+
update?: string;
|
|
56
|
+
delete?: string;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Combined hook that provides all entity mutations
|
|
61
|
+
* Used by trait hooks for persist_data effects
|
|
62
|
+
*
|
|
63
|
+
* @param entityName - The entity type name
|
|
64
|
+
* @param options - Optional configuration including orbital-based mutations
|
|
65
|
+
*
|
|
66
|
+
* @deprecated For new code, prefer useOrbitalMutations directly
|
|
67
|
+
*/
|
|
68
|
+
export declare function useEntityMutations(entityName: string, options?: UseEntityMutationsOptions): {
|
|
69
|
+
createEntity: (entityOrData: string | Record<string, unknown>, data?: Record<string, unknown>) => Promise<OrbitalEventResponse | EntityMutationResult | undefined>;
|
|
70
|
+
updateEntity: (id: string | undefined, data: Record<string, unknown>) => Promise<OrbitalEventResponse | EntityMutationResult | undefined>;
|
|
71
|
+
deleteEntity: (id: string | undefined) => Promise<OrbitalEventResponse | {
|
|
72
|
+
id: string;
|
|
73
|
+
} | undefined>;
|
|
74
|
+
isCreating: boolean;
|
|
75
|
+
isUpdating: boolean;
|
|
76
|
+
isDeleting: boolean;
|
|
77
|
+
createError: Error | null;
|
|
78
|
+
updateError: Error | null;
|
|
79
|
+
deleteError: Error | null;
|
|
80
|
+
};
|