@almadar/ui 5.75.0 → 5.76.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/avl/index.cjs +2545 -6006
- package/dist/avl/index.d.ts +43 -43
- package/dist/avl/index.js +1250 -4711
- package/dist/components/avl/atoms/AvlApplication.d.ts +1 -1
- package/dist/components/avl/atoms/AvlBindingRef.d.ts +1 -1
- package/dist/components/avl/atoms/AvlEffect.d.ts +1 -1
- package/dist/components/avl/atoms/AvlEntity.d.ts +1 -1
- package/dist/components/avl/atoms/AvlEvent.d.ts +1 -1
- package/dist/components/avl/atoms/AvlField.d.ts +1 -1
- package/dist/components/avl/atoms/AvlFieldType.d.ts +1 -1
- package/dist/components/avl/atoms/AvlGuard.d.ts +1 -1
- package/dist/components/avl/atoms/AvlLiteral.d.ts +1 -1
- package/dist/components/avl/atoms/AvlOperator.d.ts +1 -1
- package/dist/components/avl/atoms/AvlPage.d.ts +1 -1
- package/dist/components/avl/atoms/AvlPersistence.d.ts +1 -1
- package/dist/components/avl/atoms/AvlSExpr.d.ts +1 -1
- package/dist/components/avl/atoms/AvlState.d.ts +2 -2
- package/dist/components/avl/atoms/index.d.ts +4 -4
- package/dist/components/avl/{molecules → lib}/avl-behavior-compose-converter.d.ts +1 -1
- package/dist/components/avl/{molecules → lib}/avl-elk-layout.d.ts +2 -2
- package/dist/components/avl/{molecules → lib}/avl-flow-converter.d.ts +1 -1
- package/dist/components/avl/{molecules → lib}/avl-preview-converter.d.ts +1 -1
- package/dist/components/avl/{molecules → lib}/avl-story-schemas.d.ts +6 -6
- package/dist/components/avl/{molecules → lib}/avl-zoom-band.d.ts +1 -1
- package/dist/components/avl/molecules/Avl3DExprTree.d.ts +1 -1
- package/dist/components/avl/molecules/AvlBehaviorGlyph.d.ts +1 -1
- package/dist/components/avl/molecules/AvlClosedCircuit.d.ts +1 -1
- package/dist/components/avl/molecules/AvlOrbitalUnit.d.ts +1 -1
- package/dist/components/avl/molecules/AvlStateMachine.d.ts +1 -1
- package/dist/components/avl/molecules/AvlTransitionLane.d.ts +1 -1
- package/dist/components/avl/molecules/BehaviorView.d.ts +1 -1
- package/dist/components/avl/molecules/DetailView.d.ts +1 -1
- package/dist/components/avl/molecules/MiniStateMachine.d.ts +1 -1
- package/dist/components/avl/molecules/ModuleCard.d.ts +1 -1
- package/dist/components/avl/molecules/OrbPreviewNode.d.ts +1 -1
- package/dist/components/avl/molecules/SystemNode.d.ts +1 -1
- package/dist/components/avl/molecules/index.d.ts +9 -9
- package/dist/components/avl/organisms/Avl3DApplicationScene.d.ts +1 -1
- package/dist/components/avl/organisms/Avl3DEffects.d.ts +1 -1
- package/dist/components/avl/organisms/Avl3DOrbitalScene.d.ts +1 -1
- package/dist/components/avl/organisms/Avl3DTraitScene.d.ts +1 -1
- package/dist/components/avl/organisms/Avl3DTransitionScene.d.ts +1 -1
- package/dist/components/avl/organisms/Avl3DViewer.d.ts +2 -2
- package/dist/components/avl/organisms/AvlCosmicZoom.d.ts +1 -1
- package/dist/components/avl/organisms/AvlLegend.d.ts +1 -1
- package/dist/components/avl/organisms/AvlTraitScene.d.ts +1 -1
- package/dist/components/avl/organisms/AvlTransitionDetail.d.ts +1 -1
- package/dist/components/avl/organisms/AvlTransitionScene.d.ts +1 -1
- package/dist/components/avl/organisms/FlowCanvas.d.ts +2 -2
- package/dist/components/avl/organisms/OrbInspector.d.ts +1 -1
- package/dist/components/avl/organisms/ZoomBreadcrumb.d.ts +1 -1
- package/dist/components/avl/organisms/ZoomLegend.d.ts +1 -1
- package/dist/components/avl/organisms/index.d.ts +2 -2
- package/dist/components/avl/{molecules → types}/avl-behavior-compose-types.d.ts +1 -1
- package/dist/components/avl/{molecules → types}/avl-canvas-types.d.ts +1 -1
- package/dist/components/core/atoms/index.d.ts +2 -3
- package/dist/components/core/molecules/Breadcrumb.d.ts +1 -1
- package/dist/components/core/molecules/Card.d.ts +1 -1
- package/dist/components/core/molecules/Chart.d.ts +0 -2
- package/dist/components/core/molecules/ConfirmDialog.d.ts +0 -2
- package/dist/components/core/molecules/DataGrid.d.ts +1 -1
- package/dist/components/core/molecules/DataList.d.ts +1 -1
- package/dist/components/core/molecules/EmptyState.d.ts +1 -1
- package/dist/components/core/molecules/FloatingActionButton.d.ts +1 -1
- package/dist/components/core/molecules/FormSectionHeader.d.ts +1 -1
- package/dist/components/core/molecules/GraphCanvas.d.ts +0 -2
- package/dist/components/core/molecules/Header.d.ts +1 -1
- package/dist/components/core/molecules/Menu.d.ts +1 -1
- package/dist/components/core/molecules/Navigation.d.ts +1 -1
- package/dist/components/core/molecules/OrbitalVisualization.d.ts +0 -2
- package/dist/components/core/molecules/PageHeader.d.ts +1 -1
- package/dist/components/core/molecules/Section.d.ts +0 -2
- package/dist/components/core/molecules/Sidebar.d.ts +1 -1
- package/dist/components/core/molecules/SignaturePad.d.ts +0 -2
- package/dist/components/core/molecules/Split.d.ts +0 -2
- package/dist/components/core/molecules/StatDisplay.d.ts +1 -1
- package/dist/components/core/molecules/SwipeableRow.d.ts +1 -1
- package/dist/components/core/molecules/TableView.d.ts +1 -1
- package/dist/components/core/molecules/Tabs.d.ts +1 -1
- package/dist/components/core/molecules/UploadDropZone.d.ts +1 -1
- package/dist/components/core/molecules/WizardContainer.d.ts +0 -2
- package/dist/components/core/molecules/index.d.ts +1 -1
- package/dist/components/core/organisms/UISlotRenderer.d.ts +1 -1
- package/dist/components/core/organisms/index.d.ts +4 -4
- package/dist/components/core/templates/index.d.ts +12 -12
- package/dist/components/game/2d/{ActionButton.d.ts → atoms/ActionButton.d.ts} +1 -1
- package/dist/components/game/2d/{ChoiceButton.d.ts → atoms/ChoiceButton.d.ts} +1 -1
- package/dist/components/game/2d/{ControlButton.d.ts → atoms/ControlButton.d.ts} +1 -1
- package/dist/components/game/2d/{GameAudioToggle.d.ts → atoms/GameAudioToggle.d.ts} +1 -3
- package/dist/components/game/2d/atoms/GameIcon.d.ts +18 -0
- package/dist/components/game/2d/{ItemSlot.d.ts → atoms/ItemSlot.d.ts} +1 -1
- package/dist/components/game/2d/{MiniMap.d.ts → atoms/MiniMap.d.ts} +1 -1
- package/dist/components/game/2d/{ResourceCounter.d.ts → atoms/ResourceCounter.d.ts} +2 -2
- package/dist/components/game/2d/{ScoreDisplay.d.ts → atoms/ScoreDisplay.d.ts} +1 -1
- package/dist/components/game/2d/{Sprite.d.ts → atoms/Sprite.d.ts} +1 -1
- package/dist/components/game/2d/{StateIndicator.d.ts → atoms/StateIndicator.d.ts} +5 -4
- package/dist/components/game/2d/{StatusEffect.d.ts → atoms/StatusEffect.d.ts} +2 -2
- package/dist/components/game/2d/{WaypointMarker.d.ts → atoms/WaypointMarker.d.ts} +1 -1
- package/dist/components/game/2d/{Canvas2D.d.ts → molecules/Canvas2D.d.ts} +3 -3
- package/dist/components/game/2d/{ControlGrid.d.ts → molecules/ControlGrid.d.ts} +3 -2
- package/dist/components/game/2d/{GameHud.d.ts → molecules/GameHud.d.ts} +3 -1
- package/dist/components/game/2d/{GameMenu.d.ts → molecules/GameMenu.d.ts} +1 -1
- package/dist/components/game/2d/{InventoryGrid.d.ts → molecules/InventoryGrid.d.ts} +3 -2
- package/dist/components/game/2d/{ResourceBar.d.ts → molecules/ResourceBar.d.ts} +3 -1
- package/dist/components/game/2d/{StatBadge.d.ts → molecules/StatBadge.d.ts} +1 -1
- package/dist/components/game/2d/molecules/index.d.ts +107 -0
- package/dist/components/game/2d/{ActionTile.d.ts → organisms/ActionTile.d.ts} +1 -1
- package/dist/components/game/2d/{BattleBoard.d.ts → organisms/BattleBoard.d.ts} +4 -3
- package/dist/components/game/2d/{BoardgameBoard.d.ts → organisms/BoardgameBoard.d.ts} +3 -3
- package/dist/components/game/2d/{BuilderBoard.d.ts → organisms/BuilderBoard.d.ts} +7 -3
- package/dist/components/game/2d/{CanvasEffect.d.ts → organisms/CanvasEffect.d.ts} +4 -4
- package/dist/components/game/2d/{CardBattlerBoard.d.ts → organisms/CardBattlerBoard.d.ts} +1 -1
- package/dist/components/game/2d/{CastleBoard.d.ts → organisms/CastleBoard.d.ts} +2 -1
- package/dist/components/game/2d/{CityBuilderBoard.d.ts → organisms/CityBuilderBoard.d.ts} +1 -1
- package/dist/components/game/2d/{ClassifierBoard.d.ts → organisms/ClassifierBoard.d.ts} +7 -3
- package/dist/components/game/2d/{DebuggerBoard.d.ts → organisms/DebuggerBoard.d.ts} +7 -3
- package/dist/components/game/2d/{EventHandlerBoard.d.ts → organisms/EventHandlerBoard.d.ts} +1 -1
- package/dist/components/game/2d/{FishingBoard.d.ts → organisms/FishingBoard.d.ts} +12 -2
- package/dist/components/game/2d/{HexStrategyBoard.d.ts → organisms/HexStrategyBoard.d.ts} +13 -6
- package/dist/components/game/2d/{HolidayRunnerBoard.d.ts → organisms/HolidayRunnerBoard.d.ts} +3 -3
- package/dist/components/game/2d/{MatchPuzzleBoard.d.ts → organisms/MatchPuzzleBoard.d.ts} +3 -3
- package/dist/components/game/2d/{MinigolfBoard.d.ts → organisms/MinigolfBoard.d.ts} +3 -3
- package/dist/components/game/2d/{NegotiatorBoard.d.ts → organisms/NegotiatorBoard.d.ts} +7 -3
- package/dist/components/game/2d/{PinballBoard.d.ts → organisms/PinballBoard.d.ts} +12 -4
- package/dist/components/game/2d/{PirateBoard.d.ts → organisms/PirateBoard.d.ts} +13 -6
- package/dist/components/game/2d/{PlatformerBoard.d.ts → organisms/PlatformerBoard.d.ts} +1 -1
- package/dist/components/game/2d/{RacingBoard.d.ts → organisms/RacingBoard.d.ts} +13 -6
- package/dist/components/game/2d/{RoguelikeBoard.d.ts → organisms/RoguelikeBoard.d.ts} +2 -2
- package/dist/components/game/2d/{SequencerBoard.d.ts → organisms/SequencerBoard.d.ts} +1 -1
- package/dist/components/game/2d/{SimulationCanvas.d.ts → organisms/SimulationCanvas.d.ts} +3 -2
- package/dist/components/game/2d/{SimulationControls.d.ts → organisms/SimulationControls.d.ts} +6 -1
- package/dist/components/game/2d/{SimulatorBoard.d.ts → organisms/SimulatorBoard.d.ts} +7 -3
- package/dist/components/game/2d/{SokobanBoard.d.ts → organisms/SokobanBoard.d.ts} +3 -3
- package/dist/components/game/2d/{SpaceShmupBoard.d.ts → organisms/SpaceShmupBoard.d.ts} +13 -6
- package/dist/components/game/2d/{SpaceStationBoard.d.ts → organisms/SpaceStationBoard.d.ts} +3 -3
- package/dist/components/game/2d/{SportsBoard.d.ts → organisms/SportsBoard.d.ts} +3 -3
- package/dist/components/game/2d/{StateArchitectBoard.d.ts → organisms/StateArchitectBoard.d.ts} +1 -1
- package/dist/components/game/2d/{StateNode.d.ts → organisms/StateNode.d.ts} +1 -1
- package/dist/components/game/2d/{TanksBoard.d.ts → organisms/TanksBoard.d.ts} +3 -3
- package/dist/components/game/2d/{TowerDefenseBoard.d.ts → organisms/TowerDefenseBoard.d.ts} +1 -1
- package/dist/components/game/2d/{TraitSlot.d.ts → organisms/TraitSlot.d.ts} +1 -1
- package/dist/components/game/2d/{TraitStateViewer.d.ts → organisms/TraitStateViewer.d.ts} +2 -2
- package/dist/components/game/2d/{TransitionArrow.d.ts → organisms/TransitionArrow.d.ts} +1 -1
- package/dist/components/game/2d/{UncontrolledBattleBoard.d.ts → organisms/UncontrolledBattleBoard.d.ts} +1 -1
- package/dist/components/game/2d/{VisualNovelBoard.d.ts → organisms/VisualNovelBoard.d.ts} +1 -9
- package/dist/components/game/2d/{WorldMapBoard.d.ts → organisms/WorldMapBoard.d.ts} +4 -3
- package/dist/components/game/2d/{BattleTemplate.d.ts → templates/BattleTemplate.d.ts} +4 -4
- package/dist/components/game/2d/{CardBattlerTemplate.d.ts → templates/CardBattlerTemplate.d.ts} +2 -2
- package/dist/components/game/2d/{CastleTemplate.d.ts → templates/CastleTemplate.d.ts} +4 -4
- package/dist/components/game/2d/{CityBuilderTemplate.d.ts → templates/CityBuilderTemplate.d.ts} +2 -2
- package/dist/components/game/2d/{GameTemplate.d.ts → templates/GameTemplate.d.ts} +1 -1
- package/dist/components/game/2d/{PlatformerTemplate.d.ts → templates/PlatformerTemplate.d.ts} +2 -2
- package/dist/components/game/2d/{RoguelikeTemplate.d.ts → templates/RoguelikeTemplate.d.ts} +3 -3
- package/dist/components/game/2d/{TopDownShooterTemplate.d.ts → templates/TopDownShooterTemplate.d.ts} +2 -2
- package/dist/components/game/2d/{TowerDefenseTemplate.d.ts → templates/TowerDefenseTemplate.d.ts} +2 -2
- package/dist/components/game/2d/{VisualNovelTemplate.d.ts → templates/VisualNovelTemplate.d.ts} +2 -2
- package/dist/components/game/2d/{WorldMapTemplate.d.ts → templates/WorldMapTemplate.d.ts} +4 -4
- package/dist/components/game/3d/{Canvas3D.d.ts → molecules/Canvas3D.d.ts} +1 -1
- package/dist/components/game/3d/{GameCanvas3D.d.ts → molecules/GameCanvas3D.d.ts} +3 -3
- package/dist/components/game/3d/{index.d.ts → molecules/index.d.ts} +20 -25
- package/dist/components/game/3d/{GameBoard3D.d.ts → organisms/GameBoard3D.d.ts} +2 -2
- package/dist/components/game/3d/{GameCanvas3DBattleTemplate.d.ts → templates/GameCanvas3DBattleTemplate.d.ts} +3 -3
- package/dist/components/game/3d/{GameCanvas3DCastleTemplate.d.ts → templates/GameCanvas3DCastleTemplate.d.ts} +3 -3
- package/dist/components/game/3d/{GameCanvas3DWorldMapTemplate.d.ts → templates/GameCanvas3DWorldMapTemplate.d.ts} +3 -3
- package/dist/components/game/{3d → shared/hooks}/useAssetLoader.d.ts +1 -1
- package/dist/components/game/{2d → shared/hooks}/useBattleState.d.ts +1 -1
- package/dist/components/game/{2d → shared/hooks}/useCamera.d.ts +1 -1
- package/dist/components/game/{2d → shared/hooks}/useCanvasEffects.d.ts +1 -1
- package/dist/components/game/{3d → shared/hooks}/useGameCanvas3DEvents.d.ts +1 -1
- package/dist/components/game/{3d → shared/hooks}/useThree.d.ts +1 -1
- package/dist/components/game/{2d → shared/hooks}/useUnitSpriteAtlas.d.ts +2 -2
- package/dist/components/game/shared/index.d.ts +0 -2
- package/dist/components/game/{2d → shared/lib}/editorUtils.d.ts +6 -1
- package/dist/components/game/{2d → shared/lib}/game3dAssetManifest.d.ts +1 -1
- package/dist/components/game/{2d → shared/lib}/mechanics.d.ts +1 -1
- package/dist/components/game/{2d → shared/lib}/physicsPresets.d.ts +2 -2
- package/dist/components/game/{2d → shared/lib}/puzzleObject.d.ts +1 -1
- package/dist/components/game/{2d → shared/providers}/GameAudioProvider.d.ts +3 -4
- package/dist/components/index.cjs +4459 -5117
- package/dist/components/index.d.ts +5 -5
- package/dist/components/index.js +3378 -4061
- package/dist/context/index.cjs +93 -827
- package/dist/context/index.d.ts +8 -8
- package/dist/context/index.js +3 -807
- package/dist/hooks/index.cjs +9 -278
- package/dist/hooks/index.d.ts +5 -6
- package/dist/hooks/index.js +11 -262
- package/dist/hooks/useAgentChat.d.ts +7 -6
- package/dist/{renderer → hooks}/useClientEffects.d.ts +1 -1
- package/dist/hooks/useCompile.d.ts +2 -6
- package/dist/hooks/useDeepAgentGeneration.d.ts +4 -4
- package/dist/hooks/useEventBus.d.ts +5 -3
- package/dist/hooks/useFileSystem.d.ts +11 -1
- package/dist/hooks/useOrbitalHistory.d.ts +2 -2
- package/dist/hooks/useQuerySingleton.d.ts +5 -4
- package/dist/{runtime → hooks}/useResolvedSchema.d.ts +1 -1
- package/dist/{runtime → hooks}/useTraitStateMachine.d.ts +5 -5
- package/dist/hooks/useUISlots.d.ts +7 -10
- package/dist/lib/api-client.d.ts +4 -3
- package/dist/{renderer → lib}/client-effect-executor.d.ts +4 -15
- package/dist/{runtime → lib}/createClientEffectHandlers.d.ts +4 -4
- package/dist/{renderer → lib}/data-resolver.d.ts +3 -16
- package/dist/lib/debugRegistry.d.ts +8 -7
- package/dist/lib/entityDebug.d.ts +4 -3
- package/dist/lib/getNestedValue.d.ts +15 -3
- package/dist/lib/guardRegistry.d.ts +3 -2
- package/dist/lib/index.cjs +11 -12
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +11 -12
- package/dist/lib/jazari/layout.d.ts +3 -2
- package/dist/{renderer → lib}/offline-executor.d.ts +6 -5
- package/dist/lib/parseContentSegments.d.ts +2 -1
- package/dist/{renderer → lib}/pattern-resolver.d.ts +2 -2
- package/dist/{runtime → lib}/perf.d.ts +0 -2
- package/dist/{renderer → lib}/slot-definitions.d.ts +3 -15
- package/dist/{renderer → lib}/trait-binding-resolver.d.ts +6 -2
- package/dist/lib/visualizer/browser.d.ts +3 -2
- package/dist/lib/visualizer/index.d.ts +6 -5
- package/dist/marketing/index.cjs +6 -6
- package/dist/marketing/index.js +6 -6
- package/dist/{runtime → providers}/EntitySchemaContext.d.ts +0 -4
- package/dist/providers/EventBusProvider.d.ts +3 -2
- package/dist/providers/OfflineModeProvider.d.ts +1 -1
- package/dist/providers/OrbitalProvider.d.ts +5 -4
- package/dist/providers/SelectionProvider.d.ts +6 -5
- package/dist/{runtime → providers}/ServerBridge.d.ts +14 -11
- package/dist/{context → providers}/ThemeContext.d.ts +5 -5
- package/dist/{runtime → providers}/TraitProvider.d.ts +4 -3
- package/dist/{context → providers}/UISlotContext.d.ts +2 -2
- package/dist/{context → providers}/UserContext.d.ts +3 -2
- package/dist/providers/VerificationProvider.d.ts +2 -1
- package/dist/providers/index.cjs +2679 -5114
- package/dist/providers/index.d.ts +7 -1
- package/dist/providers/index.js +1597 -4087
- package/dist/{renderer → providers}/navigation.d.ts +7 -7
- package/dist/renderer/index.cjs +84 -322
- package/dist/renderer/index.d.ts +12 -12
- package/dist/renderer/index.js +30 -301
- package/dist/runtime/OrbPreview.d.ts +1 -1
- package/dist/runtime/index.cjs +2809 -6315
- package/dist/runtime/index.d.ts +11 -11
- package/dist/runtime/index.js +1740 -5270
- package/dist/{hooks → types}/event-bus-types.d.ts +2 -1
- package/dist/{renderer/types.d.ts → types/renderer-types.d.ts} +14 -28
- package/dist/types/runtime-types.d.ts +21 -0
- package/dist/{runtime/ui → types}/slot-types.d.ts +5 -4
- package/locales/index.ts +1 -1
- package/package.json +4 -21
- package/dist/components/core/atoms/ThemeSelector.d.ts +0 -21
- package/dist/components/game/2d/CardHand.d.ts +0 -35
- package/dist/components/game/2d/CombatLog.d.ts +0 -30
- package/dist/components/game/2d/CraftingRecipe.d.ts +0 -40
- package/dist/components/game/2d/DialogueBox.d.ts +0 -66
- package/dist/components/game/2d/EnemyPlate.d.ts +0 -30
- package/dist/components/game/2d/GameCanvas2D.d.ts +0 -27
- package/dist/components/game/2d/GameOverScreen.d.ts +0 -57
- package/dist/components/game/2d/HealthPanel.d.ts +0 -31
- package/dist/components/game/2d/InventoryPanel.d.ts +0 -58
- package/dist/components/game/2d/IsometricCanvas.d.ts +0 -137
- package/dist/components/game/2d/PlatformerCanvas.d.ts +0 -60
- package/dist/components/game/2d/PowerupSlots.d.ts +0 -26
- package/dist/components/game/2d/QuestTracker.d.ts +0 -20
- package/dist/components/game/2d/ScoreBoard.d.ts +0 -18
- package/dist/components/game/2d/TurnPanel.d.ts +0 -32
- package/dist/components/game/2d/UnitCommandBar.d.ts +0 -25
- package/dist/components/game/2d/index.d.ts +0 -122
- package/dist/components/game/3d/FeatureRenderer.d.ts +0 -38
- package/dist/components/game/3d/FeatureRenderer3D.d.ts +0 -44
- package/dist/components/game/3d/PhysicsObject3D.d.ts +0 -74
- package/dist/components/game/3d/TileRenderer.d.ts +0 -57
- package/dist/components/game/3d/UnitRenderer.d.ts +0 -46
- package/dist/components/game/3d/index.cjs +0 -7715
- package/dist/components/game/3d/index.css +0 -503
- package/dist/components/game/3d/index.js +0 -7633
- package/dist/components/game/3d/patterns.d.ts +0 -20
- package/dist/components/game/shared/combatEffects.d.ts +0 -64
- package/dist/docs/index.cjs +0 -7024
- package/dist/docs/index.css +0 -1252
- package/dist/docs/index.d.cts +0 -574
- package/dist/docs/index.d.ts +0 -29
- package/dist/docs/index.js +0 -6981
- package/dist/hooks/useAgentTrace.d.ts +0 -85
- package/dist/hooks/useEntities.d.ts +0 -52
- package/dist/hooks/usePinchZoom.d.ts +0 -22
- package/dist/runtime/types.d.ts +0 -37
- package/dist/stores/entityStore.d.ts +0 -99
- package/dist/stores/filtering.d.ts +0 -51
- package/dist/stores/index.cjs +0 -217
- package/dist/stores/index.d.ts +0 -7
- package/dist/stores/index.js +0 -194
- /package/dist/components/avl/{molecules → hooks}/useCanvasDnd.d.ts +0 -0
- /package/dist/components/avl/{organisms → lib}/avl-3d-layout.d.ts +0 -0
- /package/dist/components/avl/{molecules → lib}/avl-layout.d.ts +0 -0
- /package/dist/components/avl/{organisms → lib}/avl-schema-parser.d.ts +0 -0
- /package/dist/components/avl/{organisms → lib}/avl-zoom-state.d.ts +0 -0
- /package/dist/components/avl/{derive-edit-focus.d.ts → lib/derive-edit-focus.d.ts} +0 -0
- /package/dist/components/avl/{molecules → lib}/wire-validation.d.ts +0 -0
- /package/dist/components/avl/{organisms → providers}/avl-3d-context.d.ts +0 -0
- /package/dist/components/avl/{atoms/types.d.ts → types/avl-atom-types.d.ts} +0 -0
- /package/dist/components/avl/{molecules → types}/avl-preview-types.d.ts +0 -0
- /package/dist/components/game/2d/{ComboCounter.d.ts → atoms/ComboCounter.d.ts} +0 -0
- /package/dist/components/game/2d/{DamageNumber.d.ts → atoms/DamageNumber.d.ts} +0 -0
- /package/dist/components/game/2d/{DialogueBubble.d.ts → atoms/DialogueBubble.d.ts} +0 -0
- /package/dist/components/game/2d/{GameCard.d.ts → atoms/GameCard.d.ts} +0 -0
- /package/dist/components/game/2d/{HealthBar.d.ts → atoms/HealthBar.d.ts} +0 -0
- /package/dist/components/game/2d/{TimerDisplay.d.ts → atoms/TimerDisplay.d.ts} +0 -0
- /package/dist/components/game/2d/{TurnIndicator.d.ts → atoms/TurnIndicator.d.ts} +0 -0
- /package/dist/components/game/2d/{ActionPalette.d.ts → organisms/ActionPalette.d.ts} +0 -0
- /package/dist/components/game/2d/{EventLog.d.ts → organisms/EventLog.d.ts} +0 -0
- /package/dist/components/game/2d/{ObjectRulePanel.d.ts → organisms/ObjectRulePanel.d.ts} +0 -0
- /package/dist/components/game/2d/{RuleEditor.d.ts → organisms/RuleEditor.d.ts} +0 -0
- /package/dist/components/game/2d/{SequenceBar.d.ts → organisms/SequenceBar.d.ts} +0 -0
- /package/dist/components/game/2d/{SimulationGraph.d.ts → organisms/SimulationGraph.d.ts} +0 -0
- /package/dist/components/game/2d/{StateJsonView.d.ts → organisms/StateJsonView.d.ts} +0 -0
- /package/dist/components/game/2d/{TopDownShooterBoard.d.ts → organisms/TopDownShooterBoard.d.ts} +0 -0
- /package/dist/components/game/2d/{VariablePanel.d.ts → organisms/VariablePanel.d.ts} +0 -0
- /package/dist/components/game/2d/{GameShell.d.ts → templates/GameShell.d.ts} +0 -0
- /package/dist/components/game/3d/{Camera3D.d.ts → molecules/Camera3D.d.ts} +0 -0
- /package/dist/components/game/3d/{Canvas3DErrorBoundary.d.ts → molecules/Canvas3DErrorBoundary.d.ts} +0 -0
- /package/dist/components/game/3d/{Canvas3DLoadingState.d.ts → molecules/Canvas3DLoadingState.d.ts} +0 -0
- /package/dist/components/game/3d/{Lighting3D.d.ts → molecules/Lighting3D.d.ts} +0 -0
- /package/dist/components/game/3d/{ModelLoader.d.ts → molecules/ModelLoader.d.ts} +0 -0
- /package/dist/components/game/3d/{Scene3D.d.ts → molecules/Scene3D.d.ts} +0 -0
- /package/dist/components/game/{2d → shared/hooks}/useGameAudio.d.ts +0 -0
- /package/dist/components/game/{3d → shared/hooks}/useRaycaster.d.ts +0 -0
- /package/dist/components/game/{3d → shared/hooks}/useSceneGraph.d.ts +0 -0
- /package/dist/components/game/{3d → shared/lib}/AssetLoader.d.ts +0 -0
- /package/dist/components/game/{3d → shared/lib}/culling.d.ts +0 -0
- /package/dist/components/game/{3d → shared/lib}/grid3D.d.ts +0 -0
- /package/dist/components/game/{2d/types.d.ts → shared/lib/physicsTypes.d.ts} +0 -0
- /package/dist/{runtime → lib}/embedded-traits.d.ts +0 -0
- /package/dist/{runtime → lib}/fn-form-lambda.d.ts +0 -0
- /package/dist/{renderer → lib}/init.d.ts +0 -0
- /package/dist/{runtime → lib}/orbitalsByTrait.d.ts +0 -0
- /package/dist/{runtime → lib}/prepareSchemaForPreview.d.ts +0 -0
- /package/dist/{context → lib}/themeTokens.d.ts +0 -0
- /package/dist/{runtime → lib}/wrapCallbackForEvent.d.ts +0 -0
- /package/dist/{context → providers}/CurrentPagePathContext.d.ts +0 -0
- /package/dist/{context → providers}/DesignThemeContext.d.ts +0 -0
- /package/dist/{context → providers}/OrbitalThemeProvider.d.ts +0 -0
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { TraceActivity, TraceSubagent, TraceSubagentMessage, TraceChatMessage } from '@almadar/core';
|
|
2
|
-
/** Coarse run status surfaced by the trace UI (drives ChatBar's action button). */
|
|
3
|
-
export type TraceStatus = 'idle' | 'running' | 'paused' | 'complete' | 'error';
|
|
4
|
-
/** The accumulated view-model the trace components render. */
|
|
5
|
-
export interface AgentTraceState {
|
|
6
|
-
activities: TraceActivity[];
|
|
7
|
-
subagents: TraceSubagent[];
|
|
8
|
-
coordinatorMessages: TraceChatMessage[];
|
|
9
|
-
status: TraceStatus;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* A pre-mapped update the runner feeds in. Each variant is a view-model delta —
|
|
13
|
-
* no raw SSE/transport shapes. Subagents upsert by `id`; coordinator messages
|
|
14
|
-
* upsert by index (the runner owns ordering); activities append.
|
|
15
|
-
*/
|
|
16
|
-
export type TraceUpdate =
|
|
17
|
-
/** Append one already-mapped activity to the page-level stream. */
|
|
18
|
-
{
|
|
19
|
-
kind: 'activity';
|
|
20
|
-
activity: TraceActivity;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Upsert a subagent by `id`. A partial patch merges into the existing record
|
|
24
|
-
* (status/duration/task changes); a full record inserts when `id` is new.
|
|
25
|
-
*/
|
|
26
|
-
| {
|
|
27
|
-
kind: 'subagent-upsert';
|
|
28
|
-
id: string;
|
|
29
|
-
subagent: SubagentUpsert;
|
|
30
|
-
}
|
|
31
|
-
/** Append a progress message to a known subagent's running log. */
|
|
32
|
-
| {
|
|
33
|
-
kind: 'subagent-message';
|
|
34
|
-
id: string;
|
|
35
|
-
message: TraceSubagentMessage;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Set a coordinator message at `index`. The runner emits messages in order;
|
|
39
|
-
* a known index replaces (e.g. streaming content grew), a new index appends.
|
|
40
|
-
*/
|
|
41
|
-
| {
|
|
42
|
-
kind: 'coordinator-message';
|
|
43
|
-
index: number;
|
|
44
|
-
message: TraceChatMessage;
|
|
45
|
-
}
|
|
46
|
-
/** Set the coarse run status. */
|
|
47
|
-
| {
|
|
48
|
-
kind: 'status';
|
|
49
|
-
status: TraceStatus;
|
|
50
|
-
}
|
|
51
|
-
/** Reset the whole view-model (new turn). */
|
|
52
|
-
| {
|
|
53
|
-
kind: 'reset';
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* A subagent upsert payload: every field optional except `name`/`role`/`task`
|
|
57
|
-
* are required only when the id is new. Partial patches merge into the existing
|
|
58
|
-
* record; that's why the fields are all optional here and the reducer fills
|
|
59
|
-
* defaults on first insert.
|
|
60
|
-
*/
|
|
61
|
-
export interface SubagentUpsert {
|
|
62
|
-
name?: string;
|
|
63
|
-
role?: string;
|
|
64
|
-
orbitalName?: string;
|
|
65
|
-
parentId?: string;
|
|
66
|
-
status?: TraceSubagent['status'];
|
|
67
|
-
task?: string;
|
|
68
|
-
durationMs?: number;
|
|
69
|
-
}
|
|
70
|
-
/** What the hook returns: the state plus an `apply` to feed it updates. */
|
|
71
|
-
export interface UseAgentTraceResult extends AgentTraceState {
|
|
72
|
-
/** Apply one pre-mapped view-model update (from the runner). */
|
|
73
|
-
apply: (update: TraceUpdate) => void;
|
|
74
|
-
/** Apply a batch of updates in order (single render). */
|
|
75
|
-
applyAll: (updates: readonly TraceUpdate[]) => void;
|
|
76
|
-
/** Reset to the empty view-model. */
|
|
77
|
-
reset: () => void;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Accumulate agent-trace view-model from pre-mapped updates.
|
|
81
|
-
*
|
|
82
|
-
* The consumer maps SSE/runner events to `TraceUpdate`s upstream and calls
|
|
83
|
-
* `apply`/`applyAll`; this hook holds nothing but the accumulated render state.
|
|
84
|
-
*/
|
|
85
|
-
export declare function useAgentTrace(): UseAgentTraceResult;
|
|
@@ -1,52 +0,0 @@
|
|
|
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, };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
export interface PinchZoomResult {
|
|
3
|
-
/** Current zoom scale (1 = no zoom) */
|
|
4
|
-
scale: number;
|
|
5
|
-
/** Whether a pinch gesture is active */
|
|
6
|
-
isPinching: boolean;
|
|
7
|
-
/** Props to spread on the zoomable container */
|
|
8
|
-
gestureProps: {
|
|
9
|
-
onTouchStart: (e: React.TouchEvent) => void;
|
|
10
|
-
onTouchMove: (e: React.TouchEvent) => void;
|
|
11
|
-
onTouchEnd: () => void;
|
|
12
|
-
};
|
|
13
|
-
/** Reset zoom to 1 */
|
|
14
|
-
resetZoom: () => void;
|
|
15
|
-
}
|
|
16
|
-
export interface PinchZoomOptions {
|
|
17
|
-
/** Minimum zoom scale (default: 0.5) */
|
|
18
|
-
minScale?: number;
|
|
19
|
-
/** Maximum zoom scale (default: 4) */
|
|
20
|
-
maxScale?: number;
|
|
21
|
-
}
|
|
22
|
-
export declare function usePinchZoom(options?: PinchZoomOptions): PinchZoomResult;
|
package/dist/runtime/types.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OrbitalRuntime Types
|
|
3
|
-
*
|
|
4
|
-
* Re-exports IR types from @almadar/core.
|
|
5
|
-
* This ensures runtime uses the same types as the compiler.
|
|
6
|
-
*
|
|
7
|
-
* @packageDocumentation
|
|
8
|
-
*/
|
|
9
|
-
export type { TransitionFrom, ResolvedField, ResolvedEntity, ResolvedEntityBinding, ResolvedTraitState, ResolvedTraitEvent, ResolvedTraitTransition, ResolvedTraitGuard, ResolvedTraitTick, ResolvedTraitDataEntity, ResolvedTraitUIBinding, ResolvedTrait, ResolvedTraitBinding, ResolvedPattern, ResolvedSectionEvent, ResolvedSection, ResolvedNavigation, ResolvedPage, ResolvedIR, } from '@almadar/core';
|
|
10
|
-
import type { ResolvedTraitListener as CoreResolvedTraitListener } from '@almadar/core';
|
|
11
|
-
/**
|
|
12
|
-
* Listen scope descriptor carried by the resolved orb at runtime.
|
|
13
|
-
*
|
|
14
|
-
* Emitted by the compiler in the `listens[i].source` field of each
|
|
15
|
-
* `ResolvedTraitListener`. Core's type doesn't declare this field yet
|
|
16
|
-
* (@almadar/core 5.7.0) even though the Rust compiler and .lolo parser
|
|
17
|
-
* both populate it. We declare it here in @almadar/ui (the consumer)
|
|
18
|
-
* rather than modify core.
|
|
19
|
-
*
|
|
20
|
-
* - `any`: accept emits from any trait
|
|
21
|
-
* - `trait`: only accept emits whose `BusEvent.source.trait` matches
|
|
22
|
-
* - `orbital`: only accept emits whose `source.orbital[.trait?]` matches
|
|
23
|
-
*/
|
|
24
|
-
export interface ListenSource {
|
|
25
|
-
kind?: 'any' | 'trait' | 'orbital';
|
|
26
|
-
trait?: string;
|
|
27
|
-
orbital?: string;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Extended `ResolvedTraitListener` carrying the runtime-only `source`
|
|
31
|
-
* scope descriptor that `@almadar/core`'s type hasn't picked up yet.
|
|
32
|
-
* Intended as a local shim until core publishes a version with `source`.
|
|
33
|
-
*/
|
|
34
|
-
export type ResolvedTraitListener = CoreResolvedTraitListener & {
|
|
35
|
-
source?: ListenSource;
|
|
36
|
-
};
|
|
37
|
-
export { createEmptyResolvedTrait, createEmptyResolvedPage, createResolvedField, inferTsType, isResolvedIR, } from '@almadar/core';
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Entity Store
|
|
3
|
-
*
|
|
4
|
-
* Simple module-level store for runtime entities.
|
|
5
|
-
* No providers needed - hooks import and use directly.
|
|
6
|
-
*
|
|
7
|
-
* NOTE: Mutations create new Map instances to trigger React rerenders
|
|
8
|
-
* when using useSyncExternalStore.
|
|
9
|
-
*/
|
|
10
|
-
import { type EntityFilterValue, type FilterOperator, type EntityFilters, applyFilters, createFilter } from './filtering';
|
|
11
|
-
export type { EntityFilterValue, FilterOperator, EntityFilters };
|
|
12
|
-
export { applyFilters, createFilter };
|
|
13
|
-
export interface Entity {
|
|
14
|
-
id: string;
|
|
15
|
-
type: string;
|
|
16
|
-
[key: string]: unknown;
|
|
17
|
-
}
|
|
18
|
-
type Listener = () => void;
|
|
19
|
-
/**
|
|
20
|
-
* Subscribe to store changes
|
|
21
|
-
*/
|
|
22
|
-
export declare function subscribe(listener: Listener): () => void;
|
|
23
|
-
/**
|
|
24
|
-
* Get all entities
|
|
25
|
-
*/
|
|
26
|
-
export declare function getEntities(): Map<string, Entity>;
|
|
27
|
-
/**
|
|
28
|
-
* Get entity by ID
|
|
29
|
-
*/
|
|
30
|
-
export declare function getEntity(id: string): Entity | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* Get entities by type
|
|
33
|
-
*/
|
|
34
|
-
export declare function getByType(type: string | string[]): Entity[];
|
|
35
|
-
/**
|
|
36
|
-
* Get all entities as array
|
|
37
|
-
*/
|
|
38
|
-
export declare function getAllEntities(): Entity[];
|
|
39
|
-
/**
|
|
40
|
-
* Get singleton entity by type (first of that type)
|
|
41
|
-
*/
|
|
42
|
-
export declare function getSingleton(type: string): Entity | undefined;
|
|
43
|
-
/**
|
|
44
|
-
* Spawn a new entity
|
|
45
|
-
*/
|
|
46
|
-
export declare function spawnEntity(config: {
|
|
47
|
-
type: string;
|
|
48
|
-
id?: string;
|
|
49
|
-
[key: string]: unknown;
|
|
50
|
-
}): string;
|
|
51
|
-
/**
|
|
52
|
-
* Update an entity
|
|
53
|
-
*/
|
|
54
|
-
export declare function updateEntity(id: string, updates: Partial<Entity>): void;
|
|
55
|
-
/**
|
|
56
|
-
* Update singleton entity by type
|
|
57
|
-
*/
|
|
58
|
-
export declare function updateSingleton(type: string, updates: Partial<Entity>): void;
|
|
59
|
-
/**
|
|
60
|
-
* Remove an entity
|
|
61
|
-
*/
|
|
62
|
-
export declare function removeEntity(id: string): void;
|
|
63
|
-
/**
|
|
64
|
-
* Clear all entities
|
|
65
|
-
*/
|
|
66
|
-
export declare function clearEntities(): void;
|
|
67
|
-
/**
|
|
68
|
-
* Set a filter for an entity type
|
|
69
|
-
* @param entityType - The entity type to filter (e.g., "Player", "Enemy")
|
|
70
|
-
* @param field - The filter key (e.g., 'status' or 'date_from')
|
|
71
|
-
* @param value - The filter value
|
|
72
|
-
* @param operator - The comparison operator
|
|
73
|
-
* @param targetField - The actual record field to compare (defaults to field)
|
|
74
|
-
*/
|
|
75
|
-
export declare function setFilter(entityType: string, field: string, value: unknown, operator?: FilterOperator, targetField?: string): void;
|
|
76
|
-
/**
|
|
77
|
-
* Clear a specific filter
|
|
78
|
-
*/
|
|
79
|
-
export declare function clearFilter(entityType: string, field: string): void;
|
|
80
|
-
/**
|
|
81
|
-
* Clear all filters for an entity type
|
|
82
|
-
*/
|
|
83
|
-
export declare function clearAllFilters(entityType: string): void;
|
|
84
|
-
/**
|
|
85
|
-
* Get active filters for an entity type
|
|
86
|
-
*/
|
|
87
|
-
export declare function getFilters(entityType: string): EntityFilters;
|
|
88
|
-
/**
|
|
89
|
-
* Get entities by type with optional filtering
|
|
90
|
-
*/
|
|
91
|
-
export declare function getByTypeFiltered(type: string | string[]): Entity[];
|
|
92
|
-
/**
|
|
93
|
-
* Get snapshot for React useSyncExternalStore
|
|
94
|
-
*/
|
|
95
|
-
export declare function getSnapshot(): Map<string, Entity>;
|
|
96
|
-
/**
|
|
97
|
-
* Get filter snapshot for React useSyncExternalStore
|
|
98
|
-
*/
|
|
99
|
-
export declare function getFilterSnapshot(): Map<string, EntityFilters>;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Entity Filtering Utilities
|
|
3
|
-
*
|
|
4
|
-
* Provides filter types and utility functions for filtering entity records.
|
|
5
|
-
* Used by EntityStore and can be imported by runtime preview.
|
|
6
|
-
*/
|
|
7
|
-
/** Filter value for a single field (entity filtering) */
|
|
8
|
-
export interface EntityFilterValue {
|
|
9
|
-
/** The field key (may include suffix like _from, _to for date ranges) */
|
|
10
|
-
field: string;
|
|
11
|
-
/** The actual record field to compare against (defaults to field if not specified) */
|
|
12
|
-
targetField?: string;
|
|
13
|
-
value: unknown;
|
|
14
|
-
/** Comparison operator for filtering
|
|
15
|
-
* - eq: exact match (default)
|
|
16
|
-
* - contains: substring match for strings
|
|
17
|
-
* - in: value is in array
|
|
18
|
-
* - date_eq: same date (ignoring time)
|
|
19
|
-
* - date_gte: on or after date
|
|
20
|
-
* - date_lte: on or before date
|
|
21
|
-
*/
|
|
22
|
-
operator?: FilterOperator;
|
|
23
|
-
}
|
|
24
|
-
/** Operator type for filter */
|
|
25
|
-
export type FilterOperator = 'eq' | 'contains' | 'in' | 'date_eq' | 'date_gte' | 'date_lte' | 'search';
|
|
26
|
-
/** Filter state for an entity - Map of field key to filter value */
|
|
27
|
-
export type EntityFilters = Map<string, EntityFilterValue>;
|
|
28
|
-
/** Record type that can be filtered */
|
|
29
|
-
export interface FilterableRecord {
|
|
30
|
-
id: string;
|
|
31
|
-
[key: string]: unknown;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Extract date part from ISO string or Date object.
|
|
35
|
-
* Returns format: "YYYY-MM-DD"
|
|
36
|
-
*/
|
|
37
|
-
export declare function getDateString(value: unknown): string | null;
|
|
38
|
-
/**
|
|
39
|
-
* Apply a single filter to check if a record matches.
|
|
40
|
-
* Returns true if the record passes the filter.
|
|
41
|
-
*/
|
|
42
|
-
export declare function matchesFilter(record: FilterableRecord, filter: EntityFilterValue): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Apply all filters to a list of records.
|
|
45
|
-
* Returns only records that match ALL filters.
|
|
46
|
-
*/
|
|
47
|
-
export declare function applyFilters<T extends FilterableRecord>(records: T[], entityFilters: EntityFilters): T[];
|
|
48
|
-
/**
|
|
49
|
-
* Create a filter value with proper defaults.
|
|
50
|
-
*/
|
|
51
|
-
export declare function createFilter(field: string, value: unknown, operator?: FilterOperator, targetField?: string): EntityFilterValue;
|
package/dist/stores/index.cjs
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// stores/filtering.ts
|
|
4
|
-
function getDateString(value) {
|
|
5
|
-
if (!value) return null;
|
|
6
|
-
if (typeof value === "string") {
|
|
7
|
-
const match = value.match(/^(\d{4}-\d{2}-\d{2})/);
|
|
8
|
-
return match ? match[1] : null;
|
|
9
|
-
}
|
|
10
|
-
if (value instanceof Date) {
|
|
11
|
-
return value.toISOString().split("T")[0];
|
|
12
|
-
}
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
function matchesFilter(record, filter) {
|
|
16
|
-
const fieldToCompare = filter.targetField || filter.field;
|
|
17
|
-
const recordValue = record[fieldToCompare];
|
|
18
|
-
const filterValue = filter.value;
|
|
19
|
-
const operator = filter.operator || "eq";
|
|
20
|
-
if (filterValue === null || filterValue === void 0 || filterValue === "") {
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
switch (operator) {
|
|
24
|
-
case "eq":
|
|
25
|
-
if (typeof recordValue === "string" && typeof filterValue === "string") {
|
|
26
|
-
return recordValue.toLowerCase() === filterValue.toLowerCase();
|
|
27
|
-
}
|
|
28
|
-
return recordValue === filterValue;
|
|
29
|
-
case "contains":
|
|
30
|
-
if (typeof recordValue !== "string") return false;
|
|
31
|
-
return recordValue.toLowerCase().includes(String(filterValue).toLowerCase());
|
|
32
|
-
case "in":
|
|
33
|
-
if (Array.isArray(filterValue)) {
|
|
34
|
-
const normalizedFilterValues = filterValue.map(
|
|
35
|
-
(v) => typeof v === "string" ? v.toLowerCase() : v
|
|
36
|
-
);
|
|
37
|
-
const normalizedRecordValue = typeof recordValue === "string" ? recordValue.toLowerCase() : recordValue;
|
|
38
|
-
return normalizedFilterValues.includes(normalizedRecordValue);
|
|
39
|
-
}
|
|
40
|
-
return false;
|
|
41
|
-
case "date_eq": {
|
|
42
|
-
const recordDate = getDateString(recordValue);
|
|
43
|
-
const filterDate = getDateString(filterValue);
|
|
44
|
-
return Boolean(recordDate && filterDate && recordDate === filterDate);
|
|
45
|
-
}
|
|
46
|
-
case "date_gte": {
|
|
47
|
-
const recordDate = getDateString(recordValue);
|
|
48
|
-
const filterDate = getDateString(filterValue);
|
|
49
|
-
return Boolean(recordDate && filterDate && recordDate >= filterDate);
|
|
50
|
-
}
|
|
51
|
-
case "date_lte": {
|
|
52
|
-
const recordDate = getDateString(recordValue);
|
|
53
|
-
const filterDate = getDateString(filterValue);
|
|
54
|
-
return Boolean(recordDate && filterDate && recordDate <= filterDate);
|
|
55
|
-
}
|
|
56
|
-
case "search": {
|
|
57
|
-
if (typeof filterValue !== "string" || !filterValue.trim()) {
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
const searchTerm = filterValue.toLowerCase();
|
|
61
|
-
return Object.values(record).some((value) => {
|
|
62
|
-
if (value === null || value === void 0) return false;
|
|
63
|
-
return String(value).toLowerCase().includes(searchTerm);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
default:
|
|
67
|
-
return true;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function applyFilters(records, entityFilters) {
|
|
71
|
-
if (entityFilters.size === 0) return records;
|
|
72
|
-
return records.filter((record) => {
|
|
73
|
-
for (const [, filter] of entityFilters) {
|
|
74
|
-
if (!matchesFilter(record, filter)) {
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return true;
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
function createFilter(field, value, operator = "eq", targetField) {
|
|
82
|
-
return {
|
|
83
|
-
field,
|
|
84
|
-
value,
|
|
85
|
-
operator,
|
|
86
|
-
targetField: targetField || field
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// stores/entityStore.ts
|
|
91
|
-
var entities = /* @__PURE__ */ new Map();
|
|
92
|
-
var filters = /* @__PURE__ */ new Map();
|
|
93
|
-
var listeners = /* @__PURE__ */ new Set();
|
|
94
|
-
var idCounter = 0;
|
|
95
|
-
function subscribe(listener) {
|
|
96
|
-
listeners.add(listener);
|
|
97
|
-
return () => listeners.delete(listener);
|
|
98
|
-
}
|
|
99
|
-
function notify() {
|
|
100
|
-
listeners.forEach((listener) => listener());
|
|
101
|
-
}
|
|
102
|
-
function getEntities() {
|
|
103
|
-
return entities;
|
|
104
|
-
}
|
|
105
|
-
function getEntity(id) {
|
|
106
|
-
return entities.get(id);
|
|
107
|
-
}
|
|
108
|
-
function getByType(type) {
|
|
109
|
-
const types = Array.isArray(type) ? type : [type];
|
|
110
|
-
return [...entities.values()].filter((e) => types.includes(e.type));
|
|
111
|
-
}
|
|
112
|
-
function getAllEntities() {
|
|
113
|
-
return [...entities.values()];
|
|
114
|
-
}
|
|
115
|
-
function getSingleton(type) {
|
|
116
|
-
return [...entities.values()].find((e) => e.type === type);
|
|
117
|
-
}
|
|
118
|
-
function spawnEntity(config) {
|
|
119
|
-
const id = config.id ?? `entity_${++idCounter}`;
|
|
120
|
-
const entity = { ...config, id };
|
|
121
|
-
entities = new Map(entities);
|
|
122
|
-
entities.set(id, entity);
|
|
123
|
-
notify();
|
|
124
|
-
return id;
|
|
125
|
-
}
|
|
126
|
-
function updateEntity(id, updates) {
|
|
127
|
-
const entity = entities.get(id);
|
|
128
|
-
if (entity) {
|
|
129
|
-
entities = new Map(entities);
|
|
130
|
-
entities.set(id, { ...entity, ...updates });
|
|
131
|
-
notify();
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
function updateSingleton(type, updates) {
|
|
135
|
-
const entity = getSingleton(type);
|
|
136
|
-
if (entity) {
|
|
137
|
-
updateEntity(entity.id, updates);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
function removeEntity(id) {
|
|
141
|
-
if (entities.has(id)) {
|
|
142
|
-
entities = new Map(entities);
|
|
143
|
-
entities.delete(id);
|
|
144
|
-
notify();
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
function clearEntities() {
|
|
148
|
-
entities = /* @__PURE__ */ new Map();
|
|
149
|
-
notify();
|
|
150
|
-
}
|
|
151
|
-
function setFilter(entityType, field, value, operator = "eq", targetField) {
|
|
152
|
-
filters = new Map(filters);
|
|
153
|
-
const entityFilters = new Map(filters.get(entityType) || []);
|
|
154
|
-
entityFilters.set(field, createFilter(field, value, operator, targetField));
|
|
155
|
-
filters.set(entityType, entityFilters);
|
|
156
|
-
notify();
|
|
157
|
-
}
|
|
158
|
-
function clearFilter(entityType, field) {
|
|
159
|
-
const entityFilters = filters.get(entityType);
|
|
160
|
-
if (entityFilters && entityFilters.has(field)) {
|
|
161
|
-
filters = new Map(filters);
|
|
162
|
-
const newFilters = new Map(entityFilters);
|
|
163
|
-
newFilters.delete(field);
|
|
164
|
-
filters.set(entityType, newFilters);
|
|
165
|
-
notify();
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
function clearAllFilters(entityType) {
|
|
169
|
-
if (filters.has(entityType)) {
|
|
170
|
-
filters = new Map(filters);
|
|
171
|
-
filters.set(entityType, /* @__PURE__ */ new Map());
|
|
172
|
-
notify();
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
function getFilters(entityType) {
|
|
176
|
-
return filters.get(entityType) || /* @__PURE__ */ new Map();
|
|
177
|
-
}
|
|
178
|
-
function getByTypeFiltered(type) {
|
|
179
|
-
const types = Array.isArray(type) ? type : [type];
|
|
180
|
-
let result = [...entities.values()].filter((e) => types.includes(e.type));
|
|
181
|
-
for (const t of types) {
|
|
182
|
-
const typeFilters = filters.get(t);
|
|
183
|
-
if (typeFilters && typeFilters.size > 0) {
|
|
184
|
-
result = applyFilters(result, typeFilters);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
return result;
|
|
188
|
-
}
|
|
189
|
-
function getSnapshot() {
|
|
190
|
-
return entities;
|
|
191
|
-
}
|
|
192
|
-
function getFilterSnapshot() {
|
|
193
|
-
return filters;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
exports.applyFilters = applyFilters;
|
|
197
|
-
exports.clearAllFilters = clearAllFilters;
|
|
198
|
-
exports.clearEntities = clearEntities;
|
|
199
|
-
exports.clearFilter = clearFilter;
|
|
200
|
-
exports.createFilter = createFilter;
|
|
201
|
-
exports.getAllEntities = getAllEntities;
|
|
202
|
-
exports.getByType = getByType;
|
|
203
|
-
exports.getByTypeFiltered = getByTypeFiltered;
|
|
204
|
-
exports.getDateString = getDateString;
|
|
205
|
-
exports.getEntities = getEntities;
|
|
206
|
-
exports.getEntity = getEntity;
|
|
207
|
-
exports.getFilterSnapshot = getFilterSnapshot;
|
|
208
|
-
exports.getFilters = getFilters;
|
|
209
|
-
exports.getSingleton = getSingleton;
|
|
210
|
-
exports.getSnapshot = getSnapshot;
|
|
211
|
-
exports.matchesFilter = matchesFilter;
|
|
212
|
-
exports.removeEntity = removeEntity;
|
|
213
|
-
exports.setFilter = setFilter;
|
|
214
|
-
exports.spawnEntity = spawnEntity;
|
|
215
|
-
exports.subscribe = subscribe;
|
|
216
|
-
exports.updateEntity = updateEntity;
|
|
217
|
-
exports.updateSingleton = updateSingleton;
|