@almadar/ui 5.79.1 → 5.79.2
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/KaTeX_AMS-Regular-CYEKBG2K.woff +0 -0
- package/dist/KaTeX_AMS-Regular-JKX5W2C4.ttf +0 -0
- package/dist/KaTeX_AMS-Regular-U6PRYMIZ.woff2 +0 -0
- package/dist/KaTeX_Caligraphic-Bold-5QL5CMTE.woff2 +0 -0
- package/dist/KaTeX_Caligraphic-Bold-WZ3QSGD3.woff +0 -0
- package/dist/KaTeX_Caligraphic-Bold-ZTS3R3HK.ttf +0 -0
- package/dist/KaTeX_Caligraphic-Regular-3LKEU76G.woff +0 -0
- package/dist/KaTeX_Caligraphic-Regular-A7XRTZ5Q.ttf +0 -0
- package/dist/KaTeX_Caligraphic-Regular-KX5MEWCF.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Bold-2QVFK6NQ.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Bold-T4SWXBMT.woff +0 -0
- package/dist/KaTeX_Fraktur-Bold-WGHVTYOR.ttf +0 -0
- package/dist/KaTeX_Fraktur-Regular-2PEIFJSJ.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Regular-5U4OPH2X.ttf +0 -0
- package/dist/KaTeX_Fraktur-Regular-PQMHCIK6.woff +0 -0
- package/dist/KaTeX_Main-Bold-2GA4IZIN.woff +0 -0
- package/dist/KaTeX_Main-Bold-W5FBVCZM.ttf +0 -0
- package/dist/KaTeX_Main-Bold-YP5VVQRP.woff2 +0 -0
- package/dist/KaTeX_Main-BoldItalic-4P4C7HJH.woff +0 -0
- package/dist/KaTeX_Main-BoldItalic-N4V3DX7S.woff2 +0 -0
- package/dist/KaTeX_Main-BoldItalic-ODMLBJJQ.ttf +0 -0
- package/dist/KaTeX_Main-Italic-I43T2HSR.ttf +0 -0
- package/dist/KaTeX_Main-Italic-RELBIK7M.woff2 +0 -0
- package/dist/KaTeX_Main-Italic-SASNQFN2.woff +0 -0
- package/dist/KaTeX_Main-Regular-ARRPAO67.woff2 +0 -0
- package/dist/KaTeX_Main-Regular-P5I74A2A.woff +0 -0
- package/dist/KaTeX_Main-Regular-W74P5G27.ttf +0 -0
- package/dist/KaTeX_Math-BoldItalic-6EBV3DK5.woff +0 -0
- package/dist/KaTeX_Math-BoldItalic-K4WTGH3J.woff2 +0 -0
- package/dist/KaTeX_Math-BoldItalic-VB447A4D.ttf +0 -0
- package/dist/KaTeX_Math-Italic-6KGCHLFN.woff2 +0 -0
- package/dist/KaTeX_Math-Italic-KKK3USB2.woff +0 -0
- package/dist/KaTeX_Math-Italic-SON4MRCA.ttf +0 -0
- package/dist/KaTeX_SansSerif-Bold-RRNVJFFW.woff2 +0 -0
- package/dist/KaTeX_SansSerif-Bold-STQ6RXC7.ttf +0 -0
- package/dist/KaTeX_SansSerif-Bold-X5M5EMOD.woff +0 -0
- package/dist/KaTeX_SansSerif-Italic-HMPFTM52.woff2 +0 -0
- package/dist/KaTeX_SansSerif-Italic-PSN4QKYX.woff +0 -0
- package/dist/KaTeX_SansSerif-Italic-WTBAZBGY.ttf +0 -0
- package/dist/KaTeX_SansSerif-Regular-2TL3USAE.ttf +0 -0
- package/dist/KaTeX_SansSerif-Regular-OQCII6EP.woff +0 -0
- package/dist/KaTeX_SansSerif-Regular-XIQ62X4E.woff2 +0 -0
- package/dist/KaTeX_Script-Regular-72OLXYNA.ttf +0 -0
- package/dist/KaTeX_Script-Regular-A5IFOEBS.woff +0 -0
- package/dist/KaTeX_Script-Regular-APUWIHLP.woff2 +0 -0
- package/dist/KaTeX_Size1-Regular-4HRHTS65.woff +0 -0
- package/dist/KaTeX_Size1-Regular-5LRUTBFT.woff2 +0 -0
- package/dist/KaTeX_Size1-Regular-7K6AASVL.ttf +0 -0
- package/dist/KaTeX_Size2-Regular-222HN3GT.ttf +0 -0
- package/dist/KaTeX_Size2-Regular-K5ZHAIS6.woff +0 -0
- package/dist/KaTeX_Size2-Regular-LELKET5D.woff2 +0 -0
- package/dist/KaTeX_Size3-Regular-TLFPAHDE.woff +0 -0
- package/dist/KaTeX_Size3-Regular-UFCO6WCA.ttf +0 -0
- package/dist/KaTeX_Size3-Regular-WQRQ47UD.woff2 +0 -0
- package/dist/KaTeX_Size4-Regular-7PGNVPQK.ttf +0 -0
- package/dist/KaTeX_Size4-Regular-CDMV7U5C.woff2 +0 -0
- package/dist/KaTeX_Size4-Regular-PKMWZHNC.woff +0 -0
- package/dist/KaTeX_Typewriter-Regular-3F5K6SQ6.ttf +0 -0
- package/dist/KaTeX_Typewriter-Regular-MJMFSK64.woff +0 -0
- package/dist/KaTeX_Typewriter-Regular-VBYJ4NRC.woff2 +0 -0
- package/dist/avl/index.cjs +64422 -0
- package/dist/avl/index.css +1252 -0
- package/dist/avl/index.d.cts +1853 -0
- package/dist/avl/index.d.ts +64 -0
- package/dist/avl/index.js +64310 -0
- package/dist/components/avl/atoms/Avl3DLabel.d.ts +23 -0
- package/dist/components/avl/atoms/Avl3DTooltip.d.ts +25 -0
- package/dist/components/avl/atoms/AvlApplication.d.ts +8 -0
- package/dist/components/avl/atoms/AvlBinding.d.ts +12 -0
- package/dist/components/avl/atoms/AvlBindingRef.d.ts +7 -0
- package/dist/components/avl/atoms/AvlEffect.d.ts +10 -0
- package/dist/components/avl/atoms/AvlEntity.d.ts +9 -0
- package/dist/components/avl/atoms/AvlEvent.d.ts +7 -0
- package/dist/components/avl/atoms/AvlField.d.ts +10 -0
- package/dist/components/avl/atoms/AvlFieldType.d.ts +8 -0
- package/dist/components/avl/atoms/AvlGuard.d.ts +7 -0
- package/dist/components/avl/atoms/AvlLiteral.d.ts +7 -0
- package/dist/components/avl/atoms/AvlOperator.d.ts +8 -0
- package/dist/components/avl/atoms/AvlOrbital.d.ts +11 -0
- package/dist/components/avl/atoms/AvlPage.d.ts +7 -0
- package/dist/components/avl/atoms/AvlPersistence.d.ts +8 -0
- package/dist/components/avl/atoms/AvlSExpr.d.ts +8 -0
- package/dist/components/avl/atoms/AvlState.d.ts +15 -0
- package/dist/components/avl/atoms/AvlTrait.d.ts +13 -0
- package/dist/components/avl/atoms/AvlTransition.d.ts +18 -0
- package/dist/components/avl/atoms/index.d.ts +24 -0
- package/dist/components/avl/hooks/useCanvasDnd.d.ts +155 -0
- package/dist/components/avl/lib/avl-3d-layout.d.ts +116 -0
- package/dist/components/avl/lib/avl-behavior-compose-converter.d.ts +55 -0
- package/dist/components/avl/lib/avl-elk-layout.d.ts +55 -0
- package/dist/components/avl/lib/avl-flow-converter.d.ts +17 -0
- package/dist/components/avl/lib/avl-layout.d.ts +32 -0
- package/dist/components/avl/lib/avl-preview-converter.d.ts +71 -0
- package/dist/components/avl/lib/avl-schema-parser.d.ts +128 -0
- package/dist/components/avl/lib/avl-story-schemas.d.ts +34 -0
- package/dist/components/avl/lib/avl-zoom-band.d.ts +19 -0
- package/dist/components/avl/lib/avl-zoom-state.d.ts +72 -0
- package/dist/components/avl/lib/derive-edit-focus.d.ts +8 -0
- package/dist/components/avl/lib/wire-validation.d.ts +30 -0
- package/dist/components/avl/molecules/Avl3DCrossWire.d.ts +22 -0
- package/dist/components/avl/molecules/Avl3DEntityCore.d.ts +26 -0
- package/dist/components/avl/molecules/Avl3DExprTree.d.ts +21 -0
- package/dist/components/avl/molecules/Avl3DOrbitalNode.d.ts +29 -0
- package/dist/components/avl/molecules/Avl3DStateNode.d.ts +34 -0
- package/dist/components/avl/molecules/Avl3DTransitionArc.d.ts +38 -0
- package/dist/components/avl/molecules/AvlBackwardEdge.d.ts +8 -0
- package/dist/components/avl/molecules/AvlBehaviorGlyph.d.ts +61 -0
- package/dist/components/avl/molecules/AvlBindingEdge.d.ts +9 -0
- package/dist/components/avl/molecules/AvlClosedCircuit.d.ts +20 -0
- package/dist/components/avl/molecules/AvlEmitListen.d.ts +16 -0
- package/dist/components/avl/molecules/AvlEventWireEdge.d.ts +15 -0
- package/dist/components/avl/molecules/AvlExprTree.d.ts +13 -0
- package/dist/components/avl/molecules/AvlOrbitalNode.d.ts +12 -0
- package/dist/components/avl/molecules/AvlOrbitalUnit.d.ts +20 -0
- package/dist/components/avl/molecules/AvlPageEdge.d.ts +8 -0
- package/dist/components/avl/molecules/AvlSlotMap.d.ts +18 -0
- package/dist/components/avl/molecules/AvlStateMachine.d.ts +22 -0
- package/dist/components/avl/molecules/AvlSwimLane.d.ts +10 -0
- package/dist/components/avl/molecules/AvlTransitionEdge.d.ts +17 -0
- package/dist/components/avl/molecules/AvlTransitionLane.d.ts +18 -0
- package/dist/components/avl/molecules/BehaviorComposeNode.d.ts +13 -0
- package/dist/components/avl/molecules/BehaviorView.d.ts +12 -0
- package/dist/components/avl/molecules/DetailView.d.ts +13 -0
- package/dist/components/avl/molecules/EventFlowEdge.d.ts +13 -0
- package/dist/components/avl/molecules/MiniStateMachine.d.ts +14 -0
- package/dist/components/avl/molecules/ModuleCard.d.ts +22 -0
- package/dist/components/avl/molecules/OrbPreviewNode.d.ts +38 -0
- package/dist/components/avl/molecules/SystemNode.d.ts +12 -0
- package/dist/components/avl/molecules/TraitCardNode.d.ts +33 -0
- package/dist/components/avl/molecules/index.d.ts +38 -0
- package/dist/components/avl/organisms/Avl3DApplicationScene.d.ts +19 -0
- package/dist/components/avl/organisms/Avl3DEffects.d.ts +18 -0
- package/dist/components/avl/organisms/Avl3DOrbitalScene.d.ts +23 -0
- package/dist/components/avl/organisms/Avl3DTraitScene.d.ts +19 -0
- package/dist/components/avl/organisms/Avl3DTransitionScene.d.ts +17 -0
- package/dist/components/avl/organisms/Avl3DViewer.d.ts +40 -0
- package/dist/components/avl/organisms/AvlClickTarget.d.ts +31 -0
- package/dist/components/avl/organisms/AvlCosmicZoom.d.ts +41 -0
- package/dist/components/avl/organisms/AvlLegend.d.ts +15 -0
- package/dist/components/avl/organisms/AvlOrbitalsCosmicZoom.d.ts +54 -0
- package/dist/components/avl/organisms/AvlTraitScene.d.ts +17 -0
- package/dist/components/avl/organisms/AvlTransitionDetail.d.ts +20 -0
- package/dist/components/avl/organisms/AvlTransitionScene.d.ts +13 -0
- package/dist/components/avl/organisms/FlowCanvas.d.ts +134 -0
- package/dist/components/avl/organisms/OrbInspector.d.ts +45 -0
- package/dist/components/avl/organisms/ZoomBreadcrumb.d.ts +16 -0
- package/dist/components/avl/organisms/ZoomLegend.d.ts +10 -0
- package/dist/components/avl/organisms/index.d.ts +19 -0
- package/dist/components/avl/providers/avl-3d-context.d.ts +32 -0
- package/dist/components/avl/types/avl-atom-types.d.ts +53 -0
- package/dist/components/avl/types/avl-behavior-compose-types.d.ts +120 -0
- package/dist/components/avl/types/avl-canvas-types.d.ts +39 -0
- package/dist/components/avl/types/avl-preview-types.d.ts +240 -0
- package/dist/components/core/atoms/Aside.d.ts +15 -0
- package/dist/components/core/atoms/Avatar.d.ts +61 -0
- package/dist/components/core/atoms/Badge.d.ts +26 -0
- package/dist/components/core/atoms/Box.d.ts +66 -0
- package/dist/components/core/atoms/Button.d.ts +31 -0
- package/dist/components/core/atoms/Card.d.ts +34 -0
- package/dist/components/core/atoms/Center.d.ts +33 -0
- package/dist/components/core/atoms/Checkbox.d.ts +14 -0
- package/dist/components/core/atoms/ConditionalWrapper.d.ts +69 -0
- package/dist/components/core/atoms/ConfettiEffect.d.ts +19 -0
- package/dist/components/core/atoms/DayCell.d.ts +22 -0
- package/dist/components/core/atoms/Dialog.d.ts +18 -0
- package/dist/components/core/atoms/Divider.d.ts +29 -0
- package/dist/components/core/atoms/FilterPill.d.ts +30 -0
- package/dist/components/core/atoms/FlipContainer.d.ts +21 -0
- package/dist/components/core/atoms/Icon.d.ts +57 -0
- package/dist/components/core/atoms/InfiniteScrollSentinel.d.ts +24 -0
- package/dist/components/core/atoms/Input.d.ts +39 -0
- package/dist/components/core/atoms/Label.d.ts +12 -0
- package/dist/components/core/atoms/LawReferenceTooltip.d.ts +48 -0
- package/dist/components/core/atoms/Overlay.d.ts +17 -0
- package/dist/components/core/atoms/ProgressBar.d.ts +63 -0
- package/dist/components/core/atoms/Radio.d.ts +35 -0
- package/dist/components/core/atoms/RangeSlider.d.ts +34 -0
- package/dist/components/core/atoms/SectionHeader.d.ts +14 -0
- package/dist/components/core/atoms/Select.d.ts +49 -0
- package/dist/components/core/atoms/Spacer.d.ts +25 -0
- package/dist/components/core/atoms/Sparkline.d.ts +30 -0
- package/dist/components/core/atoms/Spinner.d.ts +10 -0
- package/dist/components/core/atoms/Stack.d.ts +67 -0
- package/dist/components/core/atoms/StatusDot.d.ts +16 -0
- package/dist/components/core/atoms/Switch.d.ts +12 -0
- package/dist/components/core/atoms/TextHighlight.d.ts +54 -0
- package/dist/components/core/atoms/Textarea.d.ts +17 -0
- package/dist/components/core/atoms/ThemeToggle.d.ts +33 -0
- package/dist/components/core/atoms/TimeSlotCell.d.ts +23 -0
- package/dist/components/core/atoms/TraitFrame.d.ts +54 -0
- package/dist/components/core/atoms/TrendIndicator.d.ts +20 -0
- package/dist/components/core/atoms/TypewriterText.d.ts +20 -0
- package/dist/components/core/atoms/Typography.d.ts +39 -0
- package/dist/components/core/atoms/index.d.ts +50 -0
- package/dist/components/core/atoms/svg/SvgBranch.d.ts +16 -0
- package/dist/components/core/atoms/svg/SvgConnection.d.ts +17 -0
- package/dist/components/core/atoms/svg/SvgFlow.d.ts +14 -0
- package/dist/components/core/atoms/svg/SvgGrid.d.ts +18 -0
- package/dist/components/core/atoms/svg/SvgLobe.d.ts +17 -0
- package/dist/components/core/atoms/svg/SvgMesh.d.ts +16 -0
- package/dist/components/core/atoms/svg/SvgMorph.d.ts +15 -0
- package/dist/components/core/atoms/svg/SvgNode.d.ts +16 -0
- package/dist/components/core/atoms/svg/SvgPulse.d.ts +16 -0
- package/dist/components/core/atoms/svg/SvgRing.d.ts +17 -0
- package/dist/components/core/atoms/svg/SvgShield.d.ts +15 -0
- package/dist/components/core/atoms/svg/SvgStack.d.ts +17 -0
- package/dist/components/core/atoms/svg/index.d.ts +12 -0
- package/dist/components/core/atoms/types.d.ts +47 -0
- package/dist/components/core/molecules/Accordion.d.ts +71 -0
- package/dist/components/core/molecules/ActivationBlock.d.ts +22 -0
- package/dist/components/core/molecules/Alert.d.ts +25 -0
- package/dist/components/core/molecules/AnimatedCounter.d.ts +18 -0
- package/dist/components/core/molecules/AssetPicker.d.ts +21 -0
- package/dist/components/core/molecules/BloomQuizBlock.d.ts +25 -0
- package/dist/components/core/molecules/BranchingLogicBuilder.d.ts +33 -0
- package/dist/components/core/molecules/Breadcrumb.d.ts +55 -0
- package/dist/components/core/molecules/ButtonGroup.d.ts +77 -0
- package/dist/components/core/molecules/CalendarGrid.d.ts +61 -0
- package/dist/components/core/molecules/Card.d.ts +58 -0
- package/dist/components/core/molecules/Carousel.d.ts +42 -0
- package/dist/components/core/molecules/Chart.d.ts +106 -0
- package/dist/components/core/molecules/ChartLegend.d.ts +20 -0
- package/dist/components/core/molecules/Coachmark.d.ts +47 -0
- package/dist/components/core/molecules/ConfirmDialog.d.ts +49 -0
- package/dist/components/core/molecules/ConnectionBlock.d.ts +18 -0
- package/dist/components/core/molecules/Container.d.ts +30 -0
- package/dist/components/core/molecules/ContentRenderer.d.ts +23 -0
- package/dist/components/core/molecules/DataGrid.d.ts +117 -0
- package/dist/components/core/molecules/DataList.d.ts +129 -0
- package/dist/components/core/molecules/DateRangePicker.d.ts +56 -0
- package/dist/components/core/molecules/DateRangeSelector.d.ts +21 -0
- package/dist/components/core/molecules/DocBreadcrumb.d.ts +20 -0
- package/dist/components/core/molecules/DocPagination.d.ts +21 -0
- package/dist/components/core/molecules/DocSearch.d.ts +22 -0
- package/dist/components/core/molecules/DocSidebar.d.ts +24 -0
- package/dist/components/core/molecules/DocTOC.d.ts +24 -0
- package/dist/components/core/molecules/DocumentViewer.d.ts +61 -0
- package/dist/components/core/molecules/Drawer.d.ts +47 -0
- package/dist/components/core/molecules/EdgeDecoration.d.ts +36 -0
- package/dist/components/core/molecules/EmptyState.d.ts +29 -0
- package/dist/components/core/molecules/ErrorBoundary.d.ts +54 -0
- package/dist/components/core/molecules/ErrorState.d.ts +14 -0
- package/dist/components/core/molecules/FeatureGrid.d.ts +19 -0
- package/dist/components/core/molecules/FileTree.d.ts +37 -0
- package/dist/components/core/molecules/FilterGroup.d.ts +61 -0
- package/dist/components/core/molecules/Flex.d.ts +43 -0
- package/dist/components/core/molecules/FlipCard.d.ts +24 -0
- package/dist/components/core/molecules/FloatingActionButton.d.ts +83 -0
- package/dist/components/core/molecules/FormField.d.ts +16 -0
- package/dist/components/core/molecules/FormSection.d.ts +39 -0
- package/dist/components/core/molecules/FormSectionHeader.d.ts +31 -0
- package/dist/components/core/molecules/GradientDivider.d.ts +15 -0
- package/dist/components/core/molecules/GraphCanvas.d.ts +83 -0
- package/dist/components/core/molecules/GraphView.d.ts +45 -0
- package/dist/components/core/molecules/Grid.d.ts +54 -0
- package/dist/components/core/molecules/GridPicker.d.ts +44 -0
- package/dist/components/core/molecules/Header.d.ts +113 -0
- package/dist/components/core/molecules/IconPicker.d.ts +18 -0
- package/dist/components/core/molecules/InputGroup.d.ts +24 -0
- package/dist/components/core/molecules/JazariStateMachine.d.ts +34 -0
- package/dist/components/core/molecules/JsonTreeEditor.d.ts +13 -0
- package/dist/components/core/molecules/Lightbox.d.ts +26 -0
- package/dist/components/core/molecules/LikertScale.d.ts +34 -0
- package/dist/components/core/molecules/LineChart.d.ts +33 -0
- package/dist/components/core/molecules/LoadingState.d.ts +7 -0
- package/dist/components/core/molecules/MapView.d.ts +87 -0
- package/dist/components/core/molecules/MatrixQuestion.d.ts +35 -0
- package/dist/components/core/molecules/Menu.d.ts +44 -0
- package/dist/components/core/molecules/Meter.d.ts +52 -0
- package/dist/components/core/molecules/Modal.d.ts +36 -0
- package/dist/components/core/molecules/Navigation.d.ts +67 -0
- package/dist/components/core/molecules/NodeSlotEditor.d.ts +17 -0
- package/dist/components/core/molecules/NumberStepper.d.ts +28 -0
- package/dist/components/core/molecules/OnboardingSpotlight.d.ts +27 -0
- package/dist/components/core/molecules/OptionConstraintGroup.d.ts +44 -0
- package/dist/components/core/molecules/OrbitalVisualization.d.ts +48 -0
- package/dist/components/core/molecules/PageHeader.d.ts +60 -0
- package/dist/components/core/molecules/Pagination.d.ts +71 -0
- package/dist/components/core/molecules/Popover.d.ts +39 -0
- package/dist/components/core/molecules/PositionedCanvas.d.ts +40 -0
- package/dist/components/core/molecules/ProgressDots.d.ts +24 -0
- package/dist/components/core/molecules/PropertyInspector.d.ts +38 -0
- package/dist/components/core/molecules/PullToRefresh.d.ts +22 -0
- package/dist/components/core/molecules/QrScanner.d.ts +24 -0
- package/dist/components/core/molecules/QuizBlock.d.ts +20 -0
- package/dist/components/core/molecules/ReflectionBlock.d.ts +23 -0
- package/dist/components/core/molecules/RelationSelect.d.ts +48 -0
- package/dist/components/core/molecules/RepeatableFormSection.d.ts +60 -0
- package/dist/components/core/molecules/ReplyTree.d.ts +46 -0
- package/dist/components/core/molecules/RichBlockEditor.d.ts +43 -0
- package/dist/components/core/molecules/ScaledDiagram.d.ts +20 -0
- package/dist/components/core/molecules/SearchInput.d.ts +60 -0
- package/dist/components/core/molecules/Section.d.ts +43 -0
- package/dist/components/core/molecules/SidePanel.d.ts +53 -0
- package/dist/components/core/molecules/Sidebar.d.ts +72 -0
- package/dist/components/core/molecules/SignaturePad.d.ts +46 -0
- package/dist/components/core/molecules/SimpleGrid.d.ts +27 -0
- package/dist/components/core/molecules/Skeleton.d.ts +35 -0
- package/dist/components/core/molecules/SocialProof.d.ts +25 -0
- package/dist/components/core/molecules/SortableList.d.ts +19 -0
- package/dist/components/core/molecules/Split.d.ts +41 -0
- package/dist/components/core/molecules/StarRating.d.ts +27 -0
- package/dist/components/core/molecules/StatDisplay.d.ts +58 -0
- package/dist/components/core/molecules/SwipeableRow.d.ts +26 -0
- package/dist/components/core/molecules/TableView.d.ts +111 -0
- package/dist/components/core/molecules/Tabs.d.ts +58 -0
- package/dist/components/core/molecules/TagInput.d.ts +52 -0
- package/dist/components/core/molecules/Toast.d.ts +36 -0
- package/dist/components/core/molecules/Tooltip.d.ts +25 -0
- package/dist/components/core/molecules/UploadDropZone.d.ts +28 -0
- package/dist/components/core/molecules/VersionDiff.d.ts +62 -0
- package/dist/components/core/molecules/ViolationAlert.d.ts +46 -0
- package/dist/components/core/molecules/VoteStack.d.ts +35 -0
- package/dist/components/core/molecules/WizardContainer.d.ts +160 -0
- package/dist/components/core/molecules/WizardNavigation.d.ts +61 -0
- package/dist/components/core/molecules/WizardProgress.d.ts +45 -0
- package/dist/components/core/molecules/index.d.ts +137 -0
- package/dist/components/core/molecules/lessonSegmentUtils.d.ts +18 -0
- package/dist/components/core/molecules/markdown/CodeBlock.d.ts +108 -0
- package/dist/components/core/molecules/markdown/MarkdownContent.d.ts +26 -0
- package/dist/components/core/molecules/markdown/index.d.ts +2 -0
- package/dist/components/core/molecules/parseLessonSegments.d.ts +44 -0
- package/dist/components/core/molecules/useDataDnd.d.ts +63 -0
- package/dist/components/core/organisms/CardGrid.d.ts +84 -0
- package/dist/components/core/organisms/ChatBar.d.ts +31 -0
- package/dist/components/core/organisms/CodeRunnerPanel.d.ts +42 -0
- package/dist/components/core/organisms/ComponentPatterns.d.ts +185 -0
- package/dist/components/core/organisms/CustomPattern.d.ts +105 -0
- package/dist/components/core/organisms/DataTable.d.ts +75 -0
- package/dist/components/core/organisms/DetailPanel.d.ts +80 -0
- package/dist/components/core/organisms/DrawerSlot.d.ts +40 -0
- package/dist/components/core/organisms/Form.d.ts +214 -0
- package/dist/components/core/organisms/LayoutPatterns.d.ts +108 -0
- package/dist/components/core/organisms/List.d.ts +81 -0
- package/dist/components/core/organisms/MasterDetail.d.ts +35 -0
- package/dist/components/core/organisms/MediaGallery.d.ts +63 -0
- package/dist/components/core/organisms/ModalSlot.d.ts +36 -0
- package/dist/components/core/organisms/NotifyListener.d.ts +15 -0
- package/dist/components/core/organisms/SegmentRenderer.d.ts +38 -0
- package/dist/components/core/organisms/StatCard.d.ts +65 -0
- package/dist/components/core/organisms/StateMachineView.d.ts +45 -0
- package/dist/components/core/organisms/SubagentTracePanel.d.ts +50 -0
- package/dist/components/core/organisms/Timeline.d.ts +71 -0
- package/dist/components/core/organisms/ToastSlot.d.ts +39 -0
- package/dist/components/core/organisms/UISlotRenderer.d.ts +116 -0
- package/dist/components/core/organisms/book/index.d.ts +7 -0
- package/dist/components/core/organisms/book/types.d.ts +62 -0
- package/dist/components/core/organisms/component-registry.generated.d.ts +9 -0
- package/dist/components/core/organisms/debug/RuntimeDebugger.d.ts +29 -0
- package/dist/components/core/organisms/debug/WalkMinimap.d.ts +17 -0
- package/dist/components/core/organisms/debug/hooks/useDebugData.d.ts +25 -0
- package/dist/components/core/organisms/debug/index.d.ts +13 -0
- package/dist/components/core/organisms/debug/tabs/EntitiesTab.d.ts +14 -0
- package/dist/components/core/organisms/debug/tabs/EventDispatcherTab.d.ts +18 -0
- package/dist/components/core/organisms/debug/tabs/EventFlowTab.d.ts +14 -0
- package/dist/components/core/organisms/debug/tabs/GuardsPanel.d.ts +14 -0
- package/dist/components/core/organisms/debug/tabs/ServerBridgeTab.d.ts +20 -0
- package/dist/components/core/organisms/debug/tabs/TicksTab.d.ts +14 -0
- package/dist/components/core/organisms/debug/tabs/TraitsTab.d.ts +14 -0
- package/dist/components/core/organisms/debug/tabs/TransitionTimeline.d.ts +19 -0
- package/dist/components/core/organisms/debug/tabs/VerificationTab.d.ts +17 -0
- package/dist/components/core/organisms/index.d.ts +33 -0
- package/dist/components/core/organisms/layout/DashboardGrid.d.ts +33 -0
- package/dist/components/core/organisms/layout/MasterDetailLayout.d.ts +32 -0
- package/dist/components/core/organisms/layout/SplitPane.d.ts +34 -0
- package/dist/components/core/organisms/layout/TabbedContainer.d.ts +42 -0
- package/dist/components/core/organisms/layout/index.d.ts +9 -0
- package/dist/components/core/organisms/marketing-types.d.ts +8 -0
- package/dist/components/core/organisms/trace-edit-focus.d.ts +14 -0
- package/dist/components/core/organisms/types.d.ts +72 -0
- package/dist/components/core/templates/CounterTemplate.d.ts +44 -0
- package/dist/components/core/templates/DashboardLayout.d.ts +110 -0
- package/dist/components/core/templates/GenericAppTemplate.d.ts +24 -0
- package/dist/components/core/templates/index.d.ts +21 -0
- package/dist/components/core/templates/types.d.ts +35 -0
- package/dist/components/game/2d/atoms/ActionButton.d.ts +29 -0
- package/dist/components/game/2d/atoms/ChoiceButton.d.ts +25 -0
- package/dist/components/game/2d/atoms/ComboCounter.d.ts +20 -0
- package/dist/components/game/2d/atoms/ControlButton.d.ts +35 -0
- package/dist/components/game/2d/atoms/DamageNumber.d.ts +18 -0
- package/dist/components/game/2d/atoms/DialogueBubble.d.ts +18 -0
- package/dist/components/game/2d/atoms/GameAudioToggle.d.ts +29 -0
- package/dist/components/game/2d/atoms/GameCard.d.ts +26 -0
- package/dist/components/game/2d/atoms/GameIcon.d.ts +19 -0
- package/dist/components/game/2d/atoms/HealthBar.d.ts +27 -0
- package/dist/components/game/2d/atoms/ItemSlot.d.ts +29 -0
- package/dist/components/game/2d/atoms/MiniMap.d.ts +35 -0
- package/dist/components/game/2d/atoms/ResourceCounter.d.ts +26 -0
- package/dist/components/game/2d/atoms/ScoreDisplay.d.ts +25 -0
- package/dist/components/game/2d/atoms/Sprite.d.ts +52 -0
- package/dist/components/game/2d/atoms/StateIndicator.d.ts +29 -0
- package/dist/components/game/2d/atoms/StatusEffect.d.ts +25 -0
- package/dist/components/game/2d/atoms/TimerDisplay.d.ts +19 -0
- package/dist/components/game/2d/atoms/TurnIndicator.d.ts +22 -0
- package/dist/components/game/2d/atoms/WaypointMarker.d.ts +23 -0
- package/dist/components/game/2d/molecules/Canvas2D.d.ts +161 -0
- package/dist/components/game/2d/molecules/ControlGrid.d.ts +42 -0
- package/dist/components/game/2d/molecules/GameHud.d.ts +52 -0
- package/dist/components/game/2d/molecules/GameMenu.d.ts +45 -0
- package/dist/components/game/2d/molecules/InventoryGrid.d.ts +35 -0
- package/dist/components/game/2d/molecules/ResourceBar.d.ts +26 -0
- package/dist/components/game/2d/molecules/StatBadge.d.ts +39 -0
- package/dist/components/game/2d/molecules/index.d.ts +107 -0
- package/dist/components/game/2d/organisms/ActionPalette.d.ts +34 -0
- package/dist/components/game/2d/organisms/ActionTile.d.ts +30 -0
- package/dist/components/game/2d/organisms/BattleBoard.d.ts +132 -0
- package/dist/components/game/2d/organisms/BoardgameBoard.d.ts +37 -0
- package/dist/components/game/2d/organisms/BuilderBoard.d.ts +60 -0
- package/dist/components/game/2d/organisms/CanvasEffect.d.ts +70 -0
- package/dist/components/game/2d/organisms/CardBattlerBoard.d.ts +45 -0
- package/dist/components/game/2d/organisms/CastleBoard.d.ts +107 -0
- package/dist/components/game/2d/organisms/CityBuilderBoard.d.ts +62 -0
- package/dist/components/game/2d/organisms/ClassifierBoard.d.ts +66 -0
- package/dist/components/game/2d/organisms/DebuggerBoard.d.ts +61 -0
- package/dist/components/game/2d/organisms/EventHandlerBoard.d.ts +42 -0
- package/dist/components/game/2d/organisms/EventLog.d.ts +31 -0
- package/dist/components/game/2d/organisms/FishingBoard.d.ts +41 -0
- package/dist/components/game/2d/organisms/HexStrategyBoard.d.ts +44 -0
- package/dist/components/game/2d/organisms/HolidayRunnerBoard.d.ts +37 -0
- package/dist/components/game/2d/organisms/MatchPuzzleBoard.d.ts +37 -0
- package/dist/components/game/2d/organisms/MinigolfBoard.d.ts +37 -0
- package/dist/components/game/2d/organisms/NegotiatorBoard.d.ts +56 -0
- package/dist/components/game/2d/organisms/ObjectRulePanel.d.ts +27 -0
- package/dist/components/game/2d/organisms/PinballBoard.d.ts +43 -0
- package/dist/components/game/2d/organisms/PirateBoard.d.ts +44 -0
- package/dist/components/game/2d/organisms/PlatformerBoard.d.ts +46 -0
- package/dist/components/game/2d/organisms/RacingBoard.d.ts +44 -0
- package/dist/components/game/2d/organisms/RoguelikeBoard.d.ts +60 -0
- package/dist/components/game/2d/organisms/RuleEditor.d.ts +39 -0
- package/dist/components/game/2d/organisms/SequenceBar.d.ts +41 -0
- package/dist/components/game/2d/organisms/SequencerBoard.d.ts +65 -0
- package/dist/components/game/2d/organisms/SimulationCanvas.d.ts +27 -0
- package/dist/components/game/2d/organisms/SimulationControls.d.ts +34 -0
- package/dist/components/game/2d/organisms/SimulationGraph.d.ts +25 -0
- package/dist/components/game/2d/organisms/SimulatorBoard.d.ts +58 -0
- package/dist/components/game/2d/organisms/SokobanBoard.d.ts +37 -0
- package/dist/components/game/2d/organisms/SpaceShmupBoard.d.ts +44 -0
- package/dist/components/game/2d/organisms/SpaceStationBoard.d.ts +37 -0
- package/dist/components/game/2d/organisms/SportsBoard.d.ts +37 -0
- package/dist/components/game/2d/organisms/StateArchitectBoard.d.ts +61 -0
- package/dist/components/game/2d/organisms/StateJsonView.d.ts +17 -0
- package/dist/components/game/2d/organisms/StateNode.d.ts +31 -0
- package/dist/components/game/2d/organisms/TanksBoard.d.ts +37 -0
- package/dist/components/game/2d/organisms/TopDownShooterBoard.d.ts +63 -0
- package/dist/components/game/2d/organisms/TowerDefenseBoard.d.ts +85 -0
- package/dist/components/game/2d/organisms/TraitSlot.d.ts +96 -0
- package/dist/components/game/2d/organisms/TraitStateViewer.d.ts +54 -0
- package/dist/components/game/2d/organisms/TransitionArrow.d.ts +31 -0
- package/dist/components/game/2d/organisms/UncontrolledBattleBoard.d.ts +43 -0
- package/dist/components/game/2d/organisms/VariablePanel.d.ts +22 -0
- package/dist/components/game/2d/organisms/VisualNovelBoard.d.ts +44 -0
- package/dist/components/game/2d/organisms/WorldMapBoard.d.ts +155 -0
- package/dist/components/game/2d/templates/BattleTemplate.d.ts +34 -0
- package/dist/components/game/2d/templates/CardBattlerTemplate.d.ts +35 -0
- package/dist/components/game/2d/templates/CastleTemplate.d.ts +32 -0
- package/dist/components/game/2d/templates/CityBuilderTemplate.d.ts +40 -0
- package/dist/components/game/2d/templates/GameShell.d.ts +34 -0
- package/dist/components/game/2d/templates/GameTemplate.d.ts +32 -0
- package/dist/components/game/2d/templates/PlatformerTemplate.d.ts +27 -0
- package/dist/components/game/2d/templates/RoguelikeTemplate.d.ts +23 -0
- package/dist/components/game/2d/templates/TopDownShooterTemplate.d.ts +42 -0
- package/dist/components/game/2d/templates/TowerDefenseTemplate.d.ts +43 -0
- package/dist/components/game/2d/templates/VisualNovelTemplate.d.ts +28 -0
- package/dist/components/game/2d/templates/WorldMapTemplate.d.ts +38 -0
- package/dist/components/game/3d/index.cjs +7050 -0
- package/dist/components/game/3d/index.css +503 -0
- package/dist/components/game/3d/index.d.ts +13 -0
- package/dist/components/game/3d/index.js +6974 -0
- package/dist/components/game/3d/molecules/Camera3D.d.ts +60 -0
- package/dist/components/game/3d/molecules/Canvas3D.d.ts +45 -0
- package/dist/components/game/3d/molecules/Canvas3DErrorBoundary.d.ts +51 -0
- package/dist/components/game/3d/molecules/Canvas3DLoadingState.d.ts +44 -0
- package/dist/components/game/3d/molecules/GameCanvas3D.d.ts +226 -0
- package/dist/components/game/3d/molecules/Lighting3D.d.ts +47 -0
- package/dist/components/game/3d/molecules/ModelLoader.d.ts +44 -0
- package/dist/components/game/3d/molecules/Scene3D.d.ts +37 -0
- package/dist/components/game/3d/molecules/index.d.ts +36 -0
- package/dist/components/game/3d/organisms/GameBoard3D.d.ts +66 -0
- package/dist/components/game/3d/patterns.d.ts +20 -0
- package/dist/components/game/3d/templates/GameCanvas3DBattleTemplate.d.ts +82 -0
- package/dist/components/game/3d/templates/GameCanvas3DCastleTemplate.d.ts +87 -0
- package/dist/components/game/3d/templates/GameCanvas3DWorldMapTemplate.d.ts +95 -0
- package/dist/components/game/shared/boardEntity.d.ts +44 -0
- package/dist/components/game/shared/canvasEffects.d.ts +50 -0
- package/dist/components/game/shared/combatPresets.d.ts +15 -0
- package/dist/components/game/shared/effects.d.ts +253 -0
- package/dist/components/game/shared/game.d.ts +92 -0
- package/dist/components/game/shared/hooks/useAssetLoader.d.ts +58 -0
- package/dist/components/game/shared/hooks/useBattleState.d.ts +47 -0
- package/dist/components/game/shared/hooks/useCamera.d.ts +57 -0
- package/dist/components/game/shared/hooks/useCanvasEffects.d.ts +27 -0
- package/dist/components/game/shared/hooks/useGameAudio.d.ts +47 -0
- package/dist/components/game/shared/hooks/useGameCanvas3DEvents.d.ts +123 -0
- package/dist/components/game/shared/hooks/useRaycaster.d.ts +86 -0
- package/dist/components/game/shared/hooks/useSceneGraph.d.ts +67 -0
- package/dist/components/game/shared/hooks/useThree.d.ts +58 -0
- package/dist/components/game/shared/hooks/useUnitSpriteAtlas.d.ts +24 -0
- package/dist/components/game/shared/index.d.ts +21 -0
- package/dist/components/game/shared/isometric.d.ts +83 -0
- package/dist/components/game/shared/isometricTypes.d.ts +130 -0
- package/dist/components/game/shared/lib/AssetLoader.d.ts +80 -0
- package/dist/components/game/shared/lib/culling.d.ts +134 -0
- package/dist/components/game/shared/lib/editorUtils.d.ts +114 -0
- package/dist/components/game/shared/lib/game3dAssetManifest.d.ts +48 -0
- package/dist/components/game/shared/lib/grid3D.d.ts +154 -0
- package/dist/components/game/shared/lib/mechanics.d.ts +4 -0
- package/dist/components/game/shared/lib/physicsPresets.d.ts +4 -0
- package/dist/components/game/shared/lib/physicsTypes.d.ts +43 -0
- package/dist/components/game/shared/lib/puzzleObject.d.ts +32 -0
- package/dist/components/game/shared/makeAsset.d.ts +5 -0
- package/dist/components/game/shared/providers/GameAudioProvider.d.ts +53 -0
- package/dist/components/game/shared/spriteAnimation.d.ts +85 -0
- package/dist/components/game/shared/spriteAnimationTypes.d.ts +97 -0
- package/dist/components/game/shared/spriteSheetConstants.d.ts +16 -0
- package/dist/components/game/shared/useImageCache.d.ts +16 -0
- package/dist/components/index.cjs +57594 -0
- package/dist/components/index.css +1252 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +57335 -0
- package/dist/components/learning/atoms/LearningCanvas.d.ts +80 -0
- package/dist/components/learning/molecules/BiologyCanvas.d.ts +47 -0
- package/dist/components/learning/molecules/ChemistryCanvas.d.ts +55 -0
- package/dist/components/learning/molecules/MathCanvas.d.ts +61 -0
- package/dist/components/learning/molecules/PhysicsCanvas.d.ts +54 -0
- package/dist/components/marketing/atoms/AnimatedCounter.d.ts +20 -0
- package/dist/components/marketing/atoms/AnimatedGraphic.d.ts +32 -0
- package/dist/components/marketing/atoms/AnimatedReveal.d.ts +26 -0
- package/dist/components/marketing/atoms/ContentSection.d.ts +16 -0
- package/dist/components/marketing/atoms/MarketingStatCard.d.ts +13 -0
- package/dist/components/marketing/atoms/PatternTile.d.ts +41 -0
- package/dist/components/marketing/molecules/ArticleSection.d.ts +18 -0
- package/dist/components/marketing/molecules/CTABanner.d.ts +26 -0
- package/dist/components/marketing/molecules/CaseStudyCard.d.ts +24 -0
- package/dist/components/marketing/molecules/CommunityLinks.d.ts +28 -0
- package/dist/components/marketing/molecules/FeatureCard.d.ts +26 -0
- package/dist/components/marketing/molecules/GeometricPattern.d.ts +33 -0
- package/dist/components/marketing/molecules/HeroSection.d.ts +28 -0
- package/dist/components/marketing/molecules/InstallBox.d.ts +16 -0
- package/dist/components/marketing/molecules/MarketingFooter.d.ts +29 -0
- package/dist/components/marketing/molecules/PricingCard.d.ts +19 -0
- package/dist/components/marketing/molecules/PricingGrid.d.ts +13 -0
- package/dist/components/marketing/molecules/PullQuote.d.ts +14 -0
- package/dist/components/marketing/molecules/ServiceCatalog.d.ts +19 -0
- package/dist/components/marketing/molecules/ShowcaseCard.d.ts +18 -0
- package/dist/components/marketing/molecules/SplitSection.d.ts +19 -0
- package/dist/components/marketing/molecules/StatsGrid.d.ts +18 -0
- package/dist/components/marketing/molecules/StepFlow.d.ts +21 -0
- package/dist/components/marketing/molecules/TagCloud.d.ts +18 -0
- package/dist/components/marketing/molecules/TeamCard.d.ts +19 -0
- package/dist/components/marketing/organisms/CaseStudyOrganism.d.ts +29 -0
- package/dist/components/marketing/organisms/FeatureGridOrganism.d.ts +30 -0
- package/dist/components/marketing/organisms/HeroOrganism.d.ts +42 -0
- package/dist/components/marketing/organisms/PricingOrganism.d.ts +33 -0
- package/dist/components/marketing/organisms/ShowcaseOrganism.d.ts +34 -0
- package/dist/components/marketing/organisms/StatsOrganism.d.ts +23 -0
- package/dist/components/marketing/organisms/StepFlowOrganism.d.ts +29 -0
- package/dist/components/marketing/organisms/TeamOrganism.d.ts +28 -0
- package/dist/components/marketing/organisms/book/BookChapterView.d.ts +21 -0
- package/dist/components/marketing/organisms/book/BookCoverPage.d.ts +21 -0
- package/dist/components/marketing/organisms/book/BookNavBar.d.ts +19 -0
- package/dist/components/marketing/organisms/book/BookTableOfContents.d.ts +20 -0
- package/dist/components/marketing/organisms/book/BookViewer.d.ts +31 -0
- package/dist/components/marketing/templates/AboutPageTemplate.d.ts +53 -0
- package/dist/components/marketing/templates/AuthLayout.d.ts +15 -0
- package/dist/components/marketing/templates/FeatureDetailPageTemplate.d.ts +37 -0
- package/dist/components/marketing/templates/LandingPageTemplate.d.ts +70 -0
- package/dist/components/marketing/templates/PricingPageTemplate.d.ts +44 -0
- package/dist/context/index.cjs +957 -0
- package/dist/context/index.d.ts +11 -0
- package/dist/context/index.js +899 -0
- package/dist/hooks/index.cjs +2778 -0
- package/dist/hooks/index.d.ts +32 -0
- package/dist/hooks/index.js +2738 -0
- package/dist/hooks/useAgentChat.d.ts +105 -0
- package/dist/hooks/useAlmadarDndCollision.d.ts +34 -0
- package/dist/hooks/useAuthContext.d.ts +25 -0
- package/dist/hooks/useCanvasGestures.d.ts +44 -0
- package/dist/hooks/useClientEffects.d.ts +88 -0
- package/dist/hooks/useCompile.d.ts +18 -0
- package/dist/hooks/useDeepAgentGeneration.d.ts +46 -0
- package/dist/hooks/useDragReorder.d.ts +26 -0
- package/dist/hooks/useDraggable.d.ts +25 -0
- package/dist/hooks/useDropZone.d.ts +23 -0
- package/dist/hooks/useEventBus.d.ts +99 -0
- package/dist/hooks/useExtensions.d.ts +32 -0
- package/dist/hooks/useFileEditor.d.ts +32 -0
- package/dist/hooks/useFileSystem.d.ts +50 -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/usePreview.d.ts +57 -0
- package/dist/hooks/usePullToRefresh.d.ts +25 -0
- package/dist/hooks/useQuerySingleton.d.ts +79 -0
- package/dist/hooks/useRenderInterpolation.d.ts +33 -0
- package/dist/hooks/useResolvedSchema.d.ts +45 -0
- package/dist/hooks/useSwipeGesture.d.ts +26 -0
- package/dist/hooks/useTapReveal.d.ts +32 -0
- package/dist/hooks/useTraitStateMachine.d.ts +105 -0
- package/dist/hooks/useTranslate.d.ts +35 -0
- package/dist/hooks/useUIEvents.d.ts +41 -0
- package/dist/hooks/useUISlots.d.ts +214 -0
- package/dist/hooks/useValidation.d.ts +46 -0
- package/dist/lib/api-client.d.ts +43 -0
- package/dist/lib/client-effect-executor.d.ts +57 -0
- package/dist/lib/cn.d.ts +6 -0
- package/dist/lib/createClientEffectHandlers.d.ts +42 -0
- package/dist/lib/data-resolver.d.ts +55 -0
- package/dist/lib/debug.d.ts +36 -0
- package/dist/lib/debugRegistry.d.ts +30 -0
- package/dist/lib/debugUtils.d.ts +27 -0
- package/dist/lib/embedded-traits.d.ts +39 -0
- package/dist/lib/entityDebug.d.ts +39 -0
- package/dist/lib/fn-form-lambda.d.ts +27 -0
- package/dist/lib/getNestedValue.d.ts +34 -0
- package/dist/lib/guardRegistry.d.ts +33 -0
- package/dist/lib/iconFamily.d.ts +41 -0
- package/dist/lib/index.cjs +1616 -0
- package/dist/lib/index.d.ts +18 -0
- package/dist/lib/index.js +1524 -0
- package/dist/lib/init.d.ts +14 -0
- package/dist/lib/jazari/index.d.ts +5 -0
- package/dist/lib/jazari/layout.d.ts +31 -0
- package/dist/lib/jazari/svg-paths.d.ts +61 -0
- package/dist/lib/jazari/types.d.ts +91 -0
- package/dist/lib/offline-executor.d.ts +239 -0
- package/dist/lib/orbitalsByTrait.d.ts +34 -0
- package/dist/lib/parseContentSegments.d.ts +42 -0
- package/dist/lib/pattern-resolver.d.ts +88 -0
- package/dist/lib/perf.d.ts +32 -0
- package/dist/lib/prepareSchemaForPreview.d.ts +71 -0
- package/dist/lib/slot-definitions.d.ts +33 -0
- package/dist/lib/themeTokens.d.ts +55 -0
- package/dist/lib/tickRegistry.d.ts +40 -0
- package/dist/lib/trait-binding-resolver.d.ts +57 -0
- package/dist/lib/traitRegistry.d.ts +34 -0
- package/dist/lib/verificationRegistry.d.ts +91 -0
- package/dist/lib/visualizer/browser.d.ts +48 -0
- package/dist/lib/visualizer/index.d.ts +144 -0
- package/dist/lib/wrapCallbackForEvent.d.ts +16 -0
- package/dist/locales/index.cjs +1761 -0
- package/dist/locales/index.d.ts +20 -0
- package/dist/locales/index.js +1757 -0
- package/dist/marketing/index.cjs +6966 -0
- package/dist/marketing/index.d.cts +1061 -0
- package/dist/marketing/index.d.ts +72 -0
- package/dist/marketing/index.js +6903 -0
- package/dist/providers/CurrentPagePathContext.d.ts +9 -0
- package/dist/providers/DesignThemeContext.d.ts +21 -0
- package/dist/providers/EntitySchemaContext.d.ts +81 -0
- package/dist/providers/EventBusProvider.d.ts +47 -0
- package/dist/providers/OfflineModeProvider.d.ts +79 -0
- package/dist/providers/OrbitalProvider.d.ts +110 -0
- package/dist/providers/OrbitalThemeProvider.d.ts +37 -0
- package/dist/providers/SelectionProvider.d.ts +82 -0
- package/dist/providers/ServerBridge.d.ts +102 -0
- package/dist/providers/ThemeContext.d.ts +104 -0
- package/dist/providers/TraitProvider.d.ts +53 -0
- package/dist/providers/TraitScopeProvider.d.ts +43 -0
- package/dist/providers/UISlotContext.d.ts +75 -0
- package/dist/providers/UserContext.d.ts +112 -0
- package/dist/providers/VerificationProvider.d.ts +64 -0
- package/dist/providers/index.cjs +54679 -0
- package/dist/providers/index.css +1252 -0
- package/dist/providers/index.d.ts +25 -0
- package/dist/providers/index.js +54580 -0
- package/dist/providers/navigation.d.ts +142 -0
- package/dist/renderer/index.cjs +855 -0
- package/dist/renderer/index.d.ts +28 -0
- package/dist/renderer/index.js +766 -0
- package/dist/runtime/BrowserPlayground.d.ts +34 -0
- package/dist/runtime/OrbPreview.d.ts +84 -0
- package/dist/runtime/index.cjs +54856 -0
- package/dist/runtime/index.css +1252 -0
- package/dist/runtime/index.d.ts +21 -0
- package/dist/runtime/index.js +54759 -0
- package/dist/scripts/audit-tailwind-safelist.d.ts +27 -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/tsup.config.d.ts +3 -0
- package/dist/types/event-bus-types.d.ts +64 -0
- package/dist/types/renderer-types.d.ts +146 -0
- package/dist/types/runtime-types.d.ts +21 -0
- package/dist/types/slot-types.d.ts +49 -0
- package/dist/vitest.config.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,2738 @@
|
|
|
1
|
+
import { createContext, useCallback, useState, useEffect, useMemo, useContext, useRef } from 'react';
|
|
2
|
+
import { createLogger } from '@almadar/logger';
|
|
3
|
+
import { EventBusContext, useTraitScope } from '@almadar/ui/providers';
|
|
4
|
+
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
5
|
+
|
|
6
|
+
var log = createLogger("almadar:ui:orbital-history");
|
|
7
|
+
function useOrbitalHistory(options) {
|
|
8
|
+
const { appId, authToken, userId, onHistoryChange, onRevertSuccess } = options;
|
|
9
|
+
const getHeaders = useCallback(() => {
|
|
10
|
+
const headers = {
|
|
11
|
+
"Content-Type": "application/json"
|
|
12
|
+
};
|
|
13
|
+
if (authToken) {
|
|
14
|
+
headers["Authorization"] = `Bearer ${authToken}`;
|
|
15
|
+
}
|
|
16
|
+
if (userId) {
|
|
17
|
+
headers["x-user-id"] = userId;
|
|
18
|
+
}
|
|
19
|
+
return headers;
|
|
20
|
+
}, [authToken, userId]);
|
|
21
|
+
const [timeline, setTimeline] = useState([]);
|
|
22
|
+
const [currentVersion, setCurrentVersion] = useState(1);
|
|
23
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
24
|
+
const [error, setError] = useState(null);
|
|
25
|
+
const refresh = useCallback(async () => {
|
|
26
|
+
if (!appId) return;
|
|
27
|
+
setIsLoading(true);
|
|
28
|
+
setError(null);
|
|
29
|
+
try {
|
|
30
|
+
const headers = getHeaders();
|
|
31
|
+
const [changesetsRes, snapshotsRes] = await Promise.all([
|
|
32
|
+
fetch(`/api/graphs/${appId}/history/changesets`, { headers }),
|
|
33
|
+
fetch(`/api/graphs/${appId}/history/snapshots`, { headers })
|
|
34
|
+
]);
|
|
35
|
+
if (!changesetsRes.ok) {
|
|
36
|
+
throw new Error(`Failed to fetch changesets: ${changesetsRes.status}`);
|
|
37
|
+
}
|
|
38
|
+
if (!snapshotsRes.ok) {
|
|
39
|
+
throw new Error(`Failed to fetch snapshots: ${snapshotsRes.status}`);
|
|
40
|
+
}
|
|
41
|
+
const changesetsData = await changesetsRes.json();
|
|
42
|
+
const snapshotsData = await snapshotsRes.json();
|
|
43
|
+
const changesetItems = (changesetsData.changesets || []).map((cs) => ({
|
|
44
|
+
id: cs.id,
|
|
45
|
+
type: "changeset",
|
|
46
|
+
version: cs.version,
|
|
47
|
+
timestamp: cs.timestamp,
|
|
48
|
+
description: `Version ${cs.version}`,
|
|
49
|
+
source: cs.source,
|
|
50
|
+
summary: cs.summary
|
|
51
|
+
}));
|
|
52
|
+
const snapshotItems = (snapshotsData.snapshots || []).map((snap) => ({
|
|
53
|
+
id: snap.id,
|
|
54
|
+
type: "snapshot",
|
|
55
|
+
version: snap.version,
|
|
56
|
+
timestamp: snap.timestamp,
|
|
57
|
+
description: snap.reason || `Snapshot v${snap.version}`,
|
|
58
|
+
reason: snap.reason
|
|
59
|
+
}));
|
|
60
|
+
const mergedTimeline = [...changesetItems, ...snapshotItems].sort(
|
|
61
|
+
(a, b) => b.timestamp - a.timestamp
|
|
62
|
+
);
|
|
63
|
+
setTimeline(mergedTimeline);
|
|
64
|
+
if (mergedTimeline.length > 0) {
|
|
65
|
+
setCurrentVersion(mergedTimeline[0].version);
|
|
66
|
+
}
|
|
67
|
+
} catch (err) {
|
|
68
|
+
log.error("Failed to load history", { error: err instanceof Error ? err : String(err) });
|
|
69
|
+
setError(err instanceof Error ? err.message : "Failed to load history");
|
|
70
|
+
} finally {
|
|
71
|
+
setIsLoading(false);
|
|
72
|
+
}
|
|
73
|
+
}, [appId, getHeaders]);
|
|
74
|
+
const revertToSnapshot = useCallback(async (snapshotId) => {
|
|
75
|
+
if (!appId) {
|
|
76
|
+
return { success: false, error: "No app ID provided" };
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
const response = await fetch(`/api/graphs/${appId}/history/revert/${snapshotId}`, {
|
|
80
|
+
method: "POST",
|
|
81
|
+
headers: getHeaders()
|
|
82
|
+
});
|
|
83
|
+
if (!response.ok) {
|
|
84
|
+
const errorData = await response.json().catch(() => ({}));
|
|
85
|
+
throw new Error(errorData.error || `Failed to revert: ${response.status}`);
|
|
86
|
+
}
|
|
87
|
+
const data = await response.json();
|
|
88
|
+
if (data.success && data.schema) {
|
|
89
|
+
await refresh();
|
|
90
|
+
onRevertSuccess?.(data.schema);
|
|
91
|
+
return {
|
|
92
|
+
success: true,
|
|
93
|
+
restoredSchema: data.schema
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
success: false,
|
|
98
|
+
error: data.error || "Unknown error during revert"
|
|
99
|
+
};
|
|
100
|
+
} catch (err) {
|
|
101
|
+
log.error("Failed to revert", { error: err instanceof Error ? err : String(err) });
|
|
102
|
+
return {
|
|
103
|
+
success: false,
|
|
104
|
+
error: err instanceof Error ? err.message : "Failed to revert"
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}, [appId, getHeaders, refresh, onRevertSuccess]);
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
if (appId && authToken && userId) {
|
|
110
|
+
refresh();
|
|
111
|
+
}
|
|
112
|
+
}, [appId, authToken, userId]);
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
onHistoryChange?.(timeline);
|
|
115
|
+
}, [timeline]);
|
|
116
|
+
return {
|
|
117
|
+
timeline,
|
|
118
|
+
currentVersion,
|
|
119
|
+
isLoading,
|
|
120
|
+
error,
|
|
121
|
+
revertToSnapshot,
|
|
122
|
+
refresh
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
var log2 = createLogger("almadar:ui:filesystem");
|
|
126
|
+
function useFileSystem() {
|
|
127
|
+
const [status, setStatus] = useState("idle");
|
|
128
|
+
const [error, setError] = useState(null);
|
|
129
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
130
|
+
const [files, setFiles] = useState([]);
|
|
131
|
+
const [selectedFile, setSelectedFile] = useState(null);
|
|
132
|
+
const [selectedPath, setSelectedPath] = useState(null);
|
|
133
|
+
const [previewUrl, setPreviewUrl] = useState(null);
|
|
134
|
+
const [fileContents, setFileContents] = useState(/* @__PURE__ */ new Map());
|
|
135
|
+
const boot = useCallback(async () => {
|
|
136
|
+
setStatus("booting");
|
|
137
|
+
setError(null);
|
|
138
|
+
setIsLoading(true);
|
|
139
|
+
try {
|
|
140
|
+
log2.debug("Booting WebContainer");
|
|
141
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
142
|
+
setStatus("ready");
|
|
143
|
+
} catch (err) {
|
|
144
|
+
setError(err instanceof Error ? err.message : "Failed to boot");
|
|
145
|
+
setStatus("error");
|
|
146
|
+
} finally {
|
|
147
|
+
setIsLoading(false);
|
|
148
|
+
}
|
|
149
|
+
}, []);
|
|
150
|
+
const mountFiles = useCallback(async (filesToMount) => {
|
|
151
|
+
setIsLoading(true);
|
|
152
|
+
try {
|
|
153
|
+
let filesArray;
|
|
154
|
+
if (Array.isArray(filesToMount)) {
|
|
155
|
+
filesArray = filesToMount;
|
|
156
|
+
} else {
|
|
157
|
+
filesArray = [];
|
|
158
|
+
const flattenTree = (obj, basePath = "") => {
|
|
159
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
160
|
+
const path = basePath ? `${basePath}/${key}` : key;
|
|
161
|
+
if (value && "file" in value) {
|
|
162
|
+
filesArray.push({ path, content: value.file.contents || "" });
|
|
163
|
+
} else if (value && "directory" in value) {
|
|
164
|
+
flattenTree(value.directory, path);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
flattenTree(filesToMount);
|
|
169
|
+
}
|
|
170
|
+
const newContents = /* @__PURE__ */ new Map();
|
|
171
|
+
for (const file of filesArray) {
|
|
172
|
+
newContents.set(file.path, file.content);
|
|
173
|
+
}
|
|
174
|
+
setFileContents(newContents);
|
|
175
|
+
const newTree = [];
|
|
176
|
+
for (const file of filesArray) {
|
|
177
|
+
const parts = file.path.split("/").filter(Boolean);
|
|
178
|
+
let current = newTree;
|
|
179
|
+
for (let i = 0; i < parts.length; i++) {
|
|
180
|
+
const part = parts[i];
|
|
181
|
+
const isFile = i === parts.length - 1;
|
|
182
|
+
const currentPath = "/" + parts.slice(0, i + 1).join("/");
|
|
183
|
+
let node = current.find((n) => n.name === part);
|
|
184
|
+
if (!node) {
|
|
185
|
+
node = {
|
|
186
|
+
path: currentPath,
|
|
187
|
+
name: part,
|
|
188
|
+
type: isFile ? "file" : "directory",
|
|
189
|
+
children: isFile ? void 0 : []
|
|
190
|
+
};
|
|
191
|
+
current.push(node);
|
|
192
|
+
}
|
|
193
|
+
if (!isFile && node && node.children) {
|
|
194
|
+
current = node.children;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
setFiles(newTree);
|
|
199
|
+
setStatus("running");
|
|
200
|
+
} catch (err) {
|
|
201
|
+
log2.error("Failed to mount files", { error: err instanceof Error ? err : String(err) });
|
|
202
|
+
} finally {
|
|
203
|
+
setIsLoading(false);
|
|
204
|
+
}
|
|
205
|
+
}, []);
|
|
206
|
+
const readFile = useCallback(async (path) => {
|
|
207
|
+
return fileContents.get(path) || "";
|
|
208
|
+
}, [fileContents]);
|
|
209
|
+
const writeFile = useCallback(async (path, content) => {
|
|
210
|
+
setFileContents((prev) => {
|
|
211
|
+
const next = new Map(prev);
|
|
212
|
+
next.set(path, content);
|
|
213
|
+
return next;
|
|
214
|
+
});
|
|
215
|
+
}, []);
|
|
216
|
+
const selectFile = useCallback(async (path) => {
|
|
217
|
+
const content = fileContents.get(path) || "";
|
|
218
|
+
const ext = path.split(".").pop()?.toLowerCase() || "";
|
|
219
|
+
const languageMap = {
|
|
220
|
+
ts: "typescript",
|
|
221
|
+
tsx: "typescript",
|
|
222
|
+
js: "javascript",
|
|
223
|
+
jsx: "javascript",
|
|
224
|
+
json: "json",
|
|
225
|
+
md: "markdown",
|
|
226
|
+
css: "css",
|
|
227
|
+
html: "html",
|
|
228
|
+
orb: "json"
|
|
229
|
+
};
|
|
230
|
+
setSelectedPath(path);
|
|
231
|
+
setSelectedFile({
|
|
232
|
+
path,
|
|
233
|
+
content,
|
|
234
|
+
language: languageMap[ext] || "plaintext",
|
|
235
|
+
isDirty: false
|
|
236
|
+
});
|
|
237
|
+
}, [fileContents]);
|
|
238
|
+
const updateContent = useCallback((pathOrContent, contentArg) => {
|
|
239
|
+
const path = contentArg !== void 0 ? pathOrContent : selectedPath;
|
|
240
|
+
const content = contentArg !== void 0 ? contentArg : pathOrContent;
|
|
241
|
+
if (!path) {
|
|
242
|
+
log2.warn("updateContent called without path and no file selected");
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
setFileContents((prev) => {
|
|
246
|
+
const next = new Map(prev);
|
|
247
|
+
next.set(path, content);
|
|
248
|
+
return next;
|
|
249
|
+
});
|
|
250
|
+
if (selectedPath === path) {
|
|
251
|
+
setSelectedFile((prev) => prev ? { ...prev, content, isDirty: true } : null);
|
|
252
|
+
}
|
|
253
|
+
}, [selectedPath]);
|
|
254
|
+
const updateSelectedContent = useCallback((content) => {
|
|
255
|
+
setSelectedFile((prev) => prev ? { ...prev, content, isDirty: true } : null);
|
|
256
|
+
}, []);
|
|
257
|
+
const refreshTree = useCallback(async () => {
|
|
258
|
+
log2.debug("Refreshing tree");
|
|
259
|
+
}, []);
|
|
260
|
+
const runCommand = useCallback(async (command) => {
|
|
261
|
+
log2.debug("Running command", { command });
|
|
262
|
+
return { exitCode: 0, output: "" };
|
|
263
|
+
}, []);
|
|
264
|
+
const startDevServer = useCallback(async () => {
|
|
265
|
+
log2.debug("Starting dev server");
|
|
266
|
+
setPreviewUrl("http://localhost:5173");
|
|
267
|
+
}, []);
|
|
268
|
+
return {
|
|
269
|
+
status,
|
|
270
|
+
error,
|
|
271
|
+
isLoading,
|
|
272
|
+
files,
|
|
273
|
+
selectedFile,
|
|
274
|
+
selectedPath,
|
|
275
|
+
previewUrl,
|
|
276
|
+
boot,
|
|
277
|
+
mountFiles,
|
|
278
|
+
readFile,
|
|
279
|
+
writeFile,
|
|
280
|
+
selectFile,
|
|
281
|
+
updateContent,
|
|
282
|
+
updateSelectedContent,
|
|
283
|
+
refreshTree,
|
|
284
|
+
runCommand,
|
|
285
|
+
startDevServer
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
var log3 = createLogger("almadar:ui:extensions");
|
|
289
|
+
var defaultManifest = {
|
|
290
|
+
languages: {
|
|
291
|
+
typescript: { extensions: [".ts", ".tsx"], icon: "ts", color: "#3178c6" },
|
|
292
|
+
javascript: { extensions: [".js", ".jsx"], icon: "js", color: "#f7df1e" },
|
|
293
|
+
json: { extensions: [".json", ".orb"], icon: "json", color: "#000000" },
|
|
294
|
+
css: { extensions: [".css"], icon: "css", color: "#264de4" },
|
|
295
|
+
html: { extensions: [".html"], icon: "html", color: "#e34c26" },
|
|
296
|
+
markdown: { extensions: [".md", ".mdx"], icon: "md", color: "#083fa1" }
|
|
297
|
+
},
|
|
298
|
+
extensions: []
|
|
299
|
+
};
|
|
300
|
+
function useExtensions(options) {
|
|
301
|
+
const { appId, loadOnMount = true } = options;
|
|
302
|
+
const [extensions, setExtensions] = useState([]);
|
|
303
|
+
const [manifest] = useState(defaultManifest);
|
|
304
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
305
|
+
const [error, setError] = useState(null);
|
|
306
|
+
const loadExtension = useCallback(async (extensionId) => {
|
|
307
|
+
log3.debug("Loading extension", { extensionId });
|
|
308
|
+
}, []);
|
|
309
|
+
const loadExtensions = useCallback(async () => {
|
|
310
|
+
setIsLoading(true);
|
|
311
|
+
setError(null);
|
|
312
|
+
try {
|
|
313
|
+
const defaultExtensions = [
|
|
314
|
+
{ id: "typescript", name: "TypeScript", language: "typescript", loaded: true },
|
|
315
|
+
{ id: "javascript", name: "JavaScript", language: "javascript", loaded: true },
|
|
316
|
+
{ id: "json", name: "JSON", language: "json", loaded: true },
|
|
317
|
+
{ id: "css", name: "CSS", language: "css", loaded: true },
|
|
318
|
+
{ id: "html", name: "HTML", language: "html", loaded: true },
|
|
319
|
+
{ id: "markdown", name: "Markdown", language: "markdown", loaded: true }
|
|
320
|
+
];
|
|
321
|
+
setExtensions(defaultExtensions);
|
|
322
|
+
} catch (err) {
|
|
323
|
+
setError(err instanceof Error ? err.message : "Failed to load extensions");
|
|
324
|
+
} finally {
|
|
325
|
+
setIsLoading(false);
|
|
326
|
+
}
|
|
327
|
+
}, []);
|
|
328
|
+
const getExtensionForFile = useCallback((filename) => {
|
|
329
|
+
const ext = filename.split(".").pop()?.toLowerCase();
|
|
330
|
+
if (!ext) return null;
|
|
331
|
+
const languageMap = {
|
|
332
|
+
ts: "typescript",
|
|
333
|
+
tsx: "typescript",
|
|
334
|
+
js: "javascript",
|
|
335
|
+
jsx: "javascript",
|
|
336
|
+
json: "json",
|
|
337
|
+
md: "markdown",
|
|
338
|
+
css: "css",
|
|
339
|
+
html: "html",
|
|
340
|
+
orb: "json"
|
|
341
|
+
};
|
|
342
|
+
const language = languageMap[ext];
|
|
343
|
+
if (!language) return null;
|
|
344
|
+
return extensions.find((e) => e.language === language) || null;
|
|
345
|
+
}, [extensions]);
|
|
346
|
+
useEffect(() => {
|
|
347
|
+
if (!appId || !loadOnMount) return;
|
|
348
|
+
const loadExtensions2 = async () => {
|
|
349
|
+
setIsLoading(true);
|
|
350
|
+
setError(null);
|
|
351
|
+
try {
|
|
352
|
+
const defaultExtensions = [
|
|
353
|
+
{ id: "typescript", name: "TypeScript", language: "typescript", loaded: true },
|
|
354
|
+
{ id: "javascript", name: "JavaScript", language: "javascript", loaded: true },
|
|
355
|
+
{ id: "json", name: "JSON", language: "json", loaded: true },
|
|
356
|
+
{ id: "css", name: "CSS", language: "css", loaded: true },
|
|
357
|
+
{ id: "html", name: "HTML", language: "html", loaded: true },
|
|
358
|
+
{ id: "markdown", name: "Markdown", language: "markdown", loaded: true }
|
|
359
|
+
];
|
|
360
|
+
setExtensions(defaultExtensions);
|
|
361
|
+
} catch (err) {
|
|
362
|
+
setError(err instanceof Error ? err.message : "Failed to load extensions");
|
|
363
|
+
} finally {
|
|
364
|
+
setIsLoading(false);
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
loadExtensions2();
|
|
368
|
+
}, [appId, loadOnMount]);
|
|
369
|
+
return {
|
|
370
|
+
extensions,
|
|
371
|
+
manifest,
|
|
372
|
+
isLoading,
|
|
373
|
+
error,
|
|
374
|
+
loadExtension,
|
|
375
|
+
loadExtensions,
|
|
376
|
+
getExtensionForFile
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
var log4 = createLogger("almadar:ui:file-editor");
|
|
380
|
+
function useFileEditor(options) {
|
|
381
|
+
const { extensions, fileSystem, onSchemaUpdate } = options;
|
|
382
|
+
const [openFiles, setOpenFiles] = useState([]);
|
|
383
|
+
const [activeFilePath, setActiveFilePath] = useState(null);
|
|
384
|
+
const [isSaving, setIsSaving] = useState(false);
|
|
385
|
+
const activeFile = openFiles.find((f) => f.path === activeFilePath) || null;
|
|
386
|
+
const openFile = useCallback(async (path) => {
|
|
387
|
+
const existing = openFiles.find((f) => f.path === path);
|
|
388
|
+
if (existing) {
|
|
389
|
+
setActiveFilePath(path);
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
try {
|
|
393
|
+
const content = await fileSystem.readFile(path);
|
|
394
|
+
const ext = extensions.getExtensionForFile(path);
|
|
395
|
+
const newFile = {
|
|
396
|
+
path,
|
|
397
|
+
content,
|
|
398
|
+
isDirty: false,
|
|
399
|
+
language: ext?.language
|
|
400
|
+
};
|
|
401
|
+
setOpenFiles((prev) => [...prev, newFile]);
|
|
402
|
+
setActiveFilePath(path);
|
|
403
|
+
} catch (err) {
|
|
404
|
+
log4.error("Failed to open file", { error: err instanceof Error ? err : String(err) });
|
|
405
|
+
}
|
|
406
|
+
}, [openFiles, fileSystem, extensions]);
|
|
407
|
+
const closeFile = useCallback((path) => {
|
|
408
|
+
setOpenFiles((prev) => prev.filter((f) => f.path !== path));
|
|
409
|
+
if (activeFilePath === path) {
|
|
410
|
+
const remaining = openFiles.filter((f) => f.path !== path);
|
|
411
|
+
setActiveFilePath(remaining.length > 0 ? remaining[0].path : null);
|
|
412
|
+
}
|
|
413
|
+
}, [activeFilePath, openFiles]);
|
|
414
|
+
const setActiveFile = useCallback((path) => {
|
|
415
|
+
setActiveFilePath(path);
|
|
416
|
+
}, []);
|
|
417
|
+
const updateFileContent = useCallback((path, content) => {
|
|
418
|
+
setOpenFiles(
|
|
419
|
+
(prev) => prev.map(
|
|
420
|
+
(f) => f.path === path ? { ...f, content, isDirty: true } : f
|
|
421
|
+
)
|
|
422
|
+
);
|
|
423
|
+
}, []);
|
|
424
|
+
const handleFileEdit = useCallback(async (path, content) => {
|
|
425
|
+
try {
|
|
426
|
+
await fileSystem.writeFile(path, content);
|
|
427
|
+
let action = "saved";
|
|
428
|
+
if (path.endsWith(".orb") || path.endsWith("schema.json")) {
|
|
429
|
+
try {
|
|
430
|
+
const schema = JSON.parse(content);
|
|
431
|
+
await onSchemaUpdate?.(schema);
|
|
432
|
+
action = "updated_schema";
|
|
433
|
+
} catch {
|
|
434
|
+
}
|
|
435
|
+
} else if (path.includes("/extensions/")) {
|
|
436
|
+
action = path.endsWith(".new") ? "converted_extension" : "saved_extension";
|
|
437
|
+
}
|
|
438
|
+
return { success: true, action };
|
|
439
|
+
} catch (err) {
|
|
440
|
+
return {
|
|
441
|
+
success: false,
|
|
442
|
+
error: err instanceof Error ? err.message : "Failed to save file"
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
}, [fileSystem, onSchemaUpdate]);
|
|
446
|
+
const saveFile = useCallback(async (path) => {
|
|
447
|
+
const file = openFiles.find((f) => f.path === path);
|
|
448
|
+
if (!file) return;
|
|
449
|
+
setIsSaving(true);
|
|
450
|
+
try {
|
|
451
|
+
await fileSystem.writeFile(path, file.content);
|
|
452
|
+
setOpenFiles(
|
|
453
|
+
(prev) => prev.map(
|
|
454
|
+
(f) => f.path === path ? { ...f, isDirty: false } : f
|
|
455
|
+
)
|
|
456
|
+
);
|
|
457
|
+
if (path.endsWith(".orb") || path.endsWith("schema.json")) {
|
|
458
|
+
try {
|
|
459
|
+
const schema = JSON.parse(file.content);
|
|
460
|
+
await onSchemaUpdate?.(schema);
|
|
461
|
+
} catch {
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
} catch (err) {
|
|
465
|
+
log4.error("Failed to save file", { error: err instanceof Error ? err : String(err) });
|
|
466
|
+
} finally {
|
|
467
|
+
setIsSaving(false);
|
|
468
|
+
}
|
|
469
|
+
}, [openFiles, fileSystem, onSchemaUpdate]);
|
|
470
|
+
const saveAllFiles = useCallback(async () => {
|
|
471
|
+
setIsSaving(true);
|
|
472
|
+
try {
|
|
473
|
+
const dirtyFiles = openFiles.filter((f) => f.isDirty);
|
|
474
|
+
for (const file of dirtyFiles) {
|
|
475
|
+
await saveFile(file.path);
|
|
476
|
+
}
|
|
477
|
+
} finally {
|
|
478
|
+
setIsSaving(false);
|
|
479
|
+
}
|
|
480
|
+
}, [openFiles, saveFile]);
|
|
481
|
+
return {
|
|
482
|
+
openFiles,
|
|
483
|
+
activeFile,
|
|
484
|
+
isSaving,
|
|
485
|
+
openFile,
|
|
486
|
+
closeFile,
|
|
487
|
+
setActiveFile,
|
|
488
|
+
updateFileContent,
|
|
489
|
+
handleFileEdit,
|
|
490
|
+
saveFile,
|
|
491
|
+
saveAllFiles
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
var log5 = createLogger("almadar:ui:compile");
|
|
495
|
+
function useCompile() {
|
|
496
|
+
const [isCompiling, setIsCompiling] = useState(false);
|
|
497
|
+
const [stage, setStage] = useState("idle");
|
|
498
|
+
const [lastResult, setLastResult] = useState(null);
|
|
499
|
+
const [error, setError] = useState(null);
|
|
500
|
+
const compileSchema = useCallback(async (schema) => {
|
|
501
|
+
setIsCompiling(true);
|
|
502
|
+
setStage("compiling");
|
|
503
|
+
setError(null);
|
|
504
|
+
try {
|
|
505
|
+
log5.debug("Compiling schema", { name: schema.name });
|
|
506
|
+
const result = {
|
|
507
|
+
success: true,
|
|
508
|
+
files: []
|
|
509
|
+
};
|
|
510
|
+
setLastResult(result);
|
|
511
|
+
setStage("done");
|
|
512
|
+
return result;
|
|
513
|
+
} catch (err) {
|
|
514
|
+
const errorMessage = err instanceof Error ? err.message : "Compilation failed";
|
|
515
|
+
setError(errorMessage);
|
|
516
|
+
setStage("error");
|
|
517
|
+
setLastResult({ success: false, errors: [errorMessage] });
|
|
518
|
+
return null;
|
|
519
|
+
} finally {
|
|
520
|
+
setIsCompiling(false);
|
|
521
|
+
}
|
|
522
|
+
}, []);
|
|
523
|
+
return {
|
|
524
|
+
isCompiling,
|
|
525
|
+
stage,
|
|
526
|
+
lastResult,
|
|
527
|
+
error,
|
|
528
|
+
compileSchema
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
var log6 = createLogger("almadar:ui:preview");
|
|
532
|
+
function usePreview(options) {
|
|
533
|
+
const [previewUrl, setPreviewUrl] = useState(null);
|
|
534
|
+
const [isLoading, setIsLoading] = useState(!!options?.appId);
|
|
535
|
+
const [error, setError] = useState(null);
|
|
536
|
+
const [loadError, setLoadError] = useState(null);
|
|
537
|
+
const [app, setApp] = useState(null);
|
|
538
|
+
const [isFullscreen, setIsFullscreen] = useState(false);
|
|
539
|
+
const [isExecutingEvent, setIsExecutingEvent] = useState(false);
|
|
540
|
+
const [errorToast, setErrorToast] = useState(null);
|
|
541
|
+
const [currentStateName, setCurrentStateName] = useState(null);
|
|
542
|
+
const [notificationsList, setNotificationsList] = useState([]);
|
|
543
|
+
const [isPanelOpen, setIsPanelOpen] = useState(false);
|
|
544
|
+
const notifications = useMemo(() => ({
|
|
545
|
+
notifications: notificationsList,
|
|
546
|
+
isPanelOpen,
|
|
547
|
+
closePanel: () => setIsPanelOpen(false),
|
|
548
|
+
dismissNotification: (id) => {
|
|
549
|
+
setNotificationsList((prev) => prev.filter((n) => n.id !== id));
|
|
550
|
+
},
|
|
551
|
+
markAsRead: (id) => {
|
|
552
|
+
setNotificationsList(
|
|
553
|
+
(prev) => prev.map((n) => n.id === id ? { ...n, read: true } : n)
|
|
554
|
+
);
|
|
555
|
+
},
|
|
556
|
+
clearAll: () => setNotificationsList([])
|
|
557
|
+
}), [notificationsList, isPanelOpen]);
|
|
558
|
+
useEffect(() => {
|
|
559
|
+
const appId = options?.appId;
|
|
560
|
+
if (!appId) {
|
|
561
|
+
setApp(null);
|
|
562
|
+
setIsLoading(false);
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
log6.debug("Setting up preview for app", { appId });
|
|
566
|
+
setPreviewUrl(`/api/orbitals/${appId}`);
|
|
567
|
+
setIsLoading(false);
|
|
568
|
+
}, [options?.appId]);
|
|
569
|
+
const startPreview = useCallback(async () => {
|
|
570
|
+
log6.debug("startPreview called");
|
|
571
|
+
}, []);
|
|
572
|
+
const stopPreview = useCallback(async () => {
|
|
573
|
+
setIsLoading(true);
|
|
574
|
+
try {
|
|
575
|
+
log6.debug("Stopping preview server");
|
|
576
|
+
setPreviewUrl(null);
|
|
577
|
+
setApp(null);
|
|
578
|
+
} finally {
|
|
579
|
+
setIsLoading(false);
|
|
580
|
+
}
|
|
581
|
+
}, []);
|
|
582
|
+
const refresh = useCallback(async () => {
|
|
583
|
+
if (!previewUrl) return;
|
|
584
|
+
log6.debug("Refreshing preview");
|
|
585
|
+
setPreviewUrl(`${previewUrl.split("?")[0]}?t=${Date.now()}`);
|
|
586
|
+
}, [previewUrl]);
|
|
587
|
+
const handleRefresh = useCallback(async () => {
|
|
588
|
+
log6.debug("Handle refresh");
|
|
589
|
+
await refresh();
|
|
590
|
+
}, [refresh]);
|
|
591
|
+
const handleReset = useCallback(async () => {
|
|
592
|
+
log6.debug("Resetting preview");
|
|
593
|
+
setError(null);
|
|
594
|
+
setLoadError(null);
|
|
595
|
+
setErrorToast(null);
|
|
596
|
+
setIsExecutingEvent(false);
|
|
597
|
+
setCurrentStateName(null);
|
|
598
|
+
}, []);
|
|
599
|
+
const toggleFullscreen = useCallback(() => {
|
|
600
|
+
setIsFullscreen((prev) => !prev);
|
|
601
|
+
}, []);
|
|
602
|
+
const dismissErrorToast = useCallback(() => {
|
|
603
|
+
setErrorToast(null);
|
|
604
|
+
}, []);
|
|
605
|
+
return {
|
|
606
|
+
previewUrl,
|
|
607
|
+
isLoading,
|
|
608
|
+
error,
|
|
609
|
+
loadError,
|
|
610
|
+
app,
|
|
611
|
+
isFullscreen,
|
|
612
|
+
isExecutingEvent,
|
|
613
|
+
errorToast,
|
|
614
|
+
currentStateName,
|
|
615
|
+
notifications,
|
|
616
|
+
startPreview,
|
|
617
|
+
stopPreview,
|
|
618
|
+
refresh,
|
|
619
|
+
handleRefresh,
|
|
620
|
+
handleReset,
|
|
621
|
+
toggleFullscreen,
|
|
622
|
+
setErrorToast,
|
|
623
|
+
dismissErrorToast
|
|
624
|
+
};
|
|
625
|
+
}
|
|
626
|
+
var log7 = createLogger("almadar:ui:agent-chat");
|
|
627
|
+
function useAgentChat(options) {
|
|
628
|
+
const [messages, setMessages] = useState([]);
|
|
629
|
+
const [status, setStatus] = useState("idle");
|
|
630
|
+
const [activities, setActivities] = useState([]);
|
|
631
|
+
const [todos, setTodos] = useState([]);
|
|
632
|
+
const [schemaDiffs, setSchemaDiffs] = useState([]);
|
|
633
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
634
|
+
const [error, setError] = useState(null);
|
|
635
|
+
const [threadId] = useState(null);
|
|
636
|
+
const [interrupt, setInterrupt] = useState(null);
|
|
637
|
+
const sendMessage = useCallback(async (content) => {
|
|
638
|
+
setIsLoading(true);
|
|
639
|
+
setStatus("running");
|
|
640
|
+
setError(null);
|
|
641
|
+
try {
|
|
642
|
+
const userMessage = {
|
|
643
|
+
id: Date.now().toString(),
|
|
644
|
+
role: "user",
|
|
645
|
+
content,
|
|
646
|
+
timestamp: Date.now()
|
|
647
|
+
};
|
|
648
|
+
setMessages((prev) => [...prev, userMessage]);
|
|
649
|
+
log7.debug("Sending message", { content });
|
|
650
|
+
const assistantMessage = {
|
|
651
|
+
id: (Date.now() + 1).toString(),
|
|
652
|
+
role: "assistant",
|
|
653
|
+
content: "Agent chat is not yet implemented.",
|
|
654
|
+
timestamp: Date.now()
|
|
655
|
+
};
|
|
656
|
+
setMessages((prev) => [...prev, assistantMessage]);
|
|
657
|
+
setStatus("idle");
|
|
658
|
+
options?.onComplete?.();
|
|
659
|
+
} catch (err) {
|
|
660
|
+
setError(err instanceof Error ? err.message : "Failed to send message");
|
|
661
|
+
setStatus("error");
|
|
662
|
+
} finally {
|
|
663
|
+
setIsLoading(false);
|
|
664
|
+
}
|
|
665
|
+
}, [options]);
|
|
666
|
+
const startGeneration = useCallback(async (skill, prompt, genOptions) => {
|
|
667
|
+
setStatus("running");
|
|
668
|
+
setIsLoading(true);
|
|
669
|
+
setError(null);
|
|
670
|
+
const skillName = Array.isArray(skill) ? skill[0] : skill;
|
|
671
|
+
try {
|
|
672
|
+
log7.debug("Starting generation", () => ({ skillName, prompt, genOptions: JSON.stringify(genOptions) }));
|
|
673
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
674
|
+
setStatus("complete");
|
|
675
|
+
options?.onComplete?.();
|
|
676
|
+
} catch (err) {
|
|
677
|
+
setError(err instanceof Error ? err.message : "Generation failed");
|
|
678
|
+
setStatus("error");
|
|
679
|
+
} finally {
|
|
680
|
+
setIsLoading(false);
|
|
681
|
+
}
|
|
682
|
+
}, [options]);
|
|
683
|
+
const continueConversation = useCallback(async (message) => {
|
|
684
|
+
log7.debug("Continue conversation", { message: Array.isArray(message) ? message : [message] });
|
|
685
|
+
}, []);
|
|
686
|
+
const resumeWithDecision = useCallback(async (decisions) => {
|
|
687
|
+
log7.debug("Resume with decision", () => ({ decisions: JSON.stringify(decisions), count: decisions.length }));
|
|
688
|
+
setInterrupt(null);
|
|
689
|
+
}, []);
|
|
690
|
+
const cancel = useCallback(() => {
|
|
691
|
+
setStatus("idle");
|
|
692
|
+
setIsLoading(false);
|
|
693
|
+
setInterrupt(null);
|
|
694
|
+
}, []);
|
|
695
|
+
const clearMessages = useCallback(() => {
|
|
696
|
+
setMessages([]);
|
|
697
|
+
}, []);
|
|
698
|
+
const clearHistory = useCallback(() => {
|
|
699
|
+
setMessages([]);
|
|
700
|
+
setActivities([]);
|
|
701
|
+
setTodos([]);
|
|
702
|
+
setSchemaDiffs([]);
|
|
703
|
+
setError(null);
|
|
704
|
+
}, []);
|
|
705
|
+
return {
|
|
706
|
+
messages,
|
|
707
|
+
status,
|
|
708
|
+
activities,
|
|
709
|
+
todos,
|
|
710
|
+
schemaDiffs,
|
|
711
|
+
isLoading,
|
|
712
|
+
error,
|
|
713
|
+
threadId,
|
|
714
|
+
interrupt,
|
|
715
|
+
sendMessage,
|
|
716
|
+
startGeneration,
|
|
717
|
+
continueConversation,
|
|
718
|
+
resumeWithDecision,
|
|
719
|
+
cancel,
|
|
720
|
+
clearMessages,
|
|
721
|
+
clearHistory
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
var log8 = createLogger("almadar:ui:validation");
|
|
725
|
+
function useValidation() {
|
|
726
|
+
const [result, setResult] = useState(null);
|
|
727
|
+
const [isValidating, setIsValidating] = useState(false);
|
|
728
|
+
const [error, setError] = useState(null);
|
|
729
|
+
const [stage, setStage] = useState("idle");
|
|
730
|
+
const [isFixing, setIsFixing] = useState(false);
|
|
731
|
+
const [progressMessage, setProgressMessage] = useState(null);
|
|
732
|
+
const validate = useCallback(async (appId) => {
|
|
733
|
+
setIsValidating(true);
|
|
734
|
+
setError(null);
|
|
735
|
+
setStage("validating");
|
|
736
|
+
setProgressMessage("Validating schema...");
|
|
737
|
+
try {
|
|
738
|
+
log8.debug("Validating app", { appId });
|
|
739
|
+
const validationResult = {
|
|
740
|
+
valid: true,
|
|
741
|
+
errors: [],
|
|
742
|
+
warnings: []
|
|
743
|
+
};
|
|
744
|
+
setResult(validationResult);
|
|
745
|
+
setStage("complete");
|
|
746
|
+
setProgressMessage(null);
|
|
747
|
+
return validationResult;
|
|
748
|
+
} catch (err) {
|
|
749
|
+
const errorMessage = err instanceof Error ? err.message : "Validation failed";
|
|
750
|
+
setError(errorMessage);
|
|
751
|
+
const failedResult = {
|
|
752
|
+
valid: false,
|
|
753
|
+
errors: [{ code: "VALIDATION_ERROR", message: errorMessage, severity: "error" }],
|
|
754
|
+
warnings: []
|
|
755
|
+
};
|
|
756
|
+
setResult(failedResult);
|
|
757
|
+
setStage("complete");
|
|
758
|
+
setProgressMessage(null);
|
|
759
|
+
return failedResult;
|
|
760
|
+
} finally {
|
|
761
|
+
setIsValidating(false);
|
|
762
|
+
}
|
|
763
|
+
}, []);
|
|
764
|
+
const clearResult = useCallback(() => {
|
|
765
|
+
setResult(null);
|
|
766
|
+
setError(null);
|
|
767
|
+
}, []);
|
|
768
|
+
const reset = useCallback(() => {
|
|
769
|
+
setResult(null);
|
|
770
|
+
setError(null);
|
|
771
|
+
setStage("idle");
|
|
772
|
+
setIsFixing(false);
|
|
773
|
+
setProgressMessage(null);
|
|
774
|
+
setIsValidating(false);
|
|
775
|
+
}, []);
|
|
776
|
+
return {
|
|
777
|
+
result,
|
|
778
|
+
isValidating,
|
|
779
|
+
error,
|
|
780
|
+
stage,
|
|
781
|
+
isFixing,
|
|
782
|
+
progressMessage,
|
|
783
|
+
errors: result?.errors ?? [],
|
|
784
|
+
warnings: result?.warnings ?? [],
|
|
785
|
+
isValid: result?.valid ?? false,
|
|
786
|
+
validate,
|
|
787
|
+
clearResult,
|
|
788
|
+
reset
|
|
789
|
+
};
|
|
790
|
+
}
|
|
791
|
+
var log9 = createLogger("almadar:ui:deep-agent");
|
|
792
|
+
function useDeepAgentGeneration() {
|
|
793
|
+
const [requests, setRequests] = useState([]);
|
|
794
|
+
const [currentRequest, setCurrentRequest] = useState(null);
|
|
795
|
+
const [isGenerating, setIsGenerating] = useState(false);
|
|
796
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
797
|
+
const [isComplete, setIsComplete] = useState(false);
|
|
798
|
+
const [progress, setProgress] = useState({ stage: "idle", percent: 0, message: "" });
|
|
799
|
+
const [error, setError] = useState(null);
|
|
800
|
+
const [interrupt, setInterrupt] = useState(null);
|
|
801
|
+
const generate = useCallback(async (prompt) => {
|
|
802
|
+
setIsGenerating(true);
|
|
803
|
+
setIsLoading(true);
|
|
804
|
+
setIsComplete(false);
|
|
805
|
+
setError(null);
|
|
806
|
+
setProgress({ stage: "starting", percent: 0, message: "Starting generation..." });
|
|
807
|
+
const request = {
|
|
808
|
+
id: Date.now().toString(),
|
|
809
|
+
prompt,
|
|
810
|
+
status: "running"
|
|
811
|
+
};
|
|
812
|
+
setCurrentRequest(request);
|
|
813
|
+
setRequests((prev) => [...prev, request]);
|
|
814
|
+
try {
|
|
815
|
+
log9.debug("Generating from prompt", { prompt });
|
|
816
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
817
|
+
request.status = "completed";
|
|
818
|
+
setCurrentRequest(request);
|
|
819
|
+
setIsComplete(true);
|
|
820
|
+
setProgress({ stage: "complete", percent: 100, message: "Generation complete" });
|
|
821
|
+
return null;
|
|
822
|
+
} catch (err) {
|
|
823
|
+
const errorMessage = err instanceof Error ? err.message : "Generation failed";
|
|
824
|
+
setError(errorMessage);
|
|
825
|
+
request.status = "failed";
|
|
826
|
+
request.error = errorMessage;
|
|
827
|
+
setCurrentRequest(request);
|
|
828
|
+
return null;
|
|
829
|
+
} finally {
|
|
830
|
+
setIsGenerating(false);
|
|
831
|
+
setIsLoading(false);
|
|
832
|
+
}
|
|
833
|
+
}, []);
|
|
834
|
+
const startGeneration = useCallback(async (skill, prompt, _options) => {
|
|
835
|
+
log9.debug("Starting generation with skill", { skill });
|
|
836
|
+
await generate(prompt);
|
|
837
|
+
}, [generate]);
|
|
838
|
+
const cancelGeneration = useCallback(() => {
|
|
839
|
+
if (currentRequest) {
|
|
840
|
+
currentRequest.status = "failed";
|
|
841
|
+
currentRequest.error = "Cancelled by user";
|
|
842
|
+
setCurrentRequest(null);
|
|
843
|
+
}
|
|
844
|
+
setIsGenerating(false);
|
|
845
|
+
setIsLoading(false);
|
|
846
|
+
setIsComplete(false);
|
|
847
|
+
setProgress({ stage: "idle", percent: 0, message: "" });
|
|
848
|
+
}, [currentRequest]);
|
|
849
|
+
const clearRequests = useCallback(() => {
|
|
850
|
+
setRequests([]);
|
|
851
|
+
setCurrentRequest(null);
|
|
852
|
+
setError(null);
|
|
853
|
+
setProgress({ stage: "idle", percent: 0, message: "" });
|
|
854
|
+
setIsComplete(false);
|
|
855
|
+
}, []);
|
|
856
|
+
const submitInterruptDecisions = useCallback((decisions) => {
|
|
857
|
+
log9.debug("Submitting interrupt decisions", () => ({ decisions: JSON.stringify(decisions), count: decisions.length }));
|
|
858
|
+
setInterrupt(null);
|
|
859
|
+
}, []);
|
|
860
|
+
return {
|
|
861
|
+
requests,
|
|
862
|
+
currentRequest,
|
|
863
|
+
isGenerating,
|
|
864
|
+
isLoading,
|
|
865
|
+
isComplete,
|
|
866
|
+
progress,
|
|
867
|
+
error,
|
|
868
|
+
interrupt,
|
|
869
|
+
generate,
|
|
870
|
+
startGeneration,
|
|
871
|
+
cancelGeneration,
|
|
872
|
+
clearRequests,
|
|
873
|
+
submitInterruptDecisions
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
var log10 = createLogger("almadar:eventbus");
|
|
877
|
+
var subLog = createLogger("almadar:eventbus:subscribe");
|
|
878
|
+
var scopeLog = createLogger("almadar:ui:trait-scope");
|
|
879
|
+
function getGlobalEventBus() {
|
|
880
|
+
if (typeof window !== "undefined") {
|
|
881
|
+
return window.__kflowEventBus ?? null;
|
|
882
|
+
}
|
|
883
|
+
return null;
|
|
884
|
+
}
|
|
885
|
+
var fallbackListeners = /* @__PURE__ */ new Map();
|
|
886
|
+
var fallbackAnyListeners = /* @__PURE__ */ new Set();
|
|
887
|
+
var fallbackEventBus = {
|
|
888
|
+
emit: (type, payload, source) => {
|
|
889
|
+
const event = {
|
|
890
|
+
type,
|
|
891
|
+
payload,
|
|
892
|
+
timestamp: Date.now(),
|
|
893
|
+
source
|
|
894
|
+
};
|
|
895
|
+
const handlers = fallbackListeners.get(type);
|
|
896
|
+
log10.debug("emit", { type, payloadKeys: payload ? Object.keys(payload).length : 0, listenerCount: (handlers?.size ?? 0) + fallbackAnyListeners.size });
|
|
897
|
+
if (handlers) {
|
|
898
|
+
handlers.forEach((handler) => {
|
|
899
|
+
try {
|
|
900
|
+
handler(event);
|
|
901
|
+
} catch (error) {
|
|
902
|
+
log10.error("Error in listener", { type, error: error instanceof Error ? error : String(error) });
|
|
903
|
+
}
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
fallbackAnyListeners.forEach((handler) => {
|
|
907
|
+
try {
|
|
908
|
+
handler(event);
|
|
909
|
+
} catch (error) {
|
|
910
|
+
log10.error("Error in onAny listener", { type, error: error instanceof Error ? error : String(error) });
|
|
911
|
+
}
|
|
912
|
+
});
|
|
913
|
+
},
|
|
914
|
+
on: (type, listener) => {
|
|
915
|
+
if (!fallbackListeners.has(type)) {
|
|
916
|
+
fallbackListeners.set(type, /* @__PURE__ */ new Set());
|
|
917
|
+
}
|
|
918
|
+
fallbackListeners.get(type).add(listener);
|
|
919
|
+
subLog.debug("subscribe", { type, totalListeners: fallbackListeners.get(type).size });
|
|
920
|
+
return () => {
|
|
921
|
+
const handlers = fallbackListeners.get(type);
|
|
922
|
+
if (handlers) {
|
|
923
|
+
handlers.delete(listener);
|
|
924
|
+
if (handlers.size === 0) {
|
|
925
|
+
fallbackListeners.delete(type);
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
};
|
|
929
|
+
},
|
|
930
|
+
once: (type, listener) => {
|
|
931
|
+
const wrappedListener = (event) => {
|
|
932
|
+
fallbackListeners.get(type)?.delete(wrappedListener);
|
|
933
|
+
listener(event);
|
|
934
|
+
};
|
|
935
|
+
return fallbackEventBus.on(type, wrappedListener);
|
|
936
|
+
},
|
|
937
|
+
hasListeners: (type) => {
|
|
938
|
+
const handlers = fallbackListeners.get(type);
|
|
939
|
+
return handlers !== void 0 && handlers.size > 0;
|
|
940
|
+
},
|
|
941
|
+
onAny: (listener) => {
|
|
942
|
+
fallbackAnyListeners.add(listener);
|
|
943
|
+
subLog.debug("subscribe:any", { totalAnyListeners: fallbackAnyListeners.size });
|
|
944
|
+
return () => {
|
|
945
|
+
fallbackAnyListeners.delete(listener);
|
|
946
|
+
};
|
|
947
|
+
}
|
|
948
|
+
};
|
|
949
|
+
function useEventBus() {
|
|
950
|
+
const context = useContext(EventBusContext);
|
|
951
|
+
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
952
|
+
const scope = useTraitScope();
|
|
953
|
+
return useMemo(() => {
|
|
954
|
+
if (!scope) {
|
|
955
|
+
return {
|
|
956
|
+
...baseBus,
|
|
957
|
+
emit: (type, payload, source) => {
|
|
958
|
+
if (typeof type === "string" && type.startsWith("UI:") && !type.slice(3).includes(".")) {
|
|
959
|
+
scopeLog.warn("emit:bare-key-no-scope", { type });
|
|
960
|
+
}
|
|
961
|
+
baseBus.emit(type, payload, source);
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
}
|
|
965
|
+
return {
|
|
966
|
+
...baseBus,
|
|
967
|
+
emit: (type, payload, source) => {
|
|
968
|
+
if (typeof type === "string" && type.startsWith("UI:")) {
|
|
969
|
+
const tail = type.slice(3);
|
|
970
|
+
const qualified = tail.includes(".") ? type : `UI:${scope.orbital}.${scope.trait}.${tail}`;
|
|
971
|
+
if (qualified !== type) {
|
|
972
|
+
scopeLog.info("emit:qualified", {
|
|
973
|
+
from: type,
|
|
974
|
+
to: qualified,
|
|
975
|
+
scopeOrbital: scope.orbital,
|
|
976
|
+
scopeTrait: scope.trait
|
|
977
|
+
});
|
|
978
|
+
}
|
|
979
|
+
baseBus.emit(qualified, payload, source);
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
982
|
+
baseBus.emit(type, payload, source);
|
|
983
|
+
}
|
|
984
|
+
};
|
|
985
|
+
}, [baseBus, scope]);
|
|
986
|
+
}
|
|
987
|
+
function useEventListener(event, handler) {
|
|
988
|
+
const eventBus = useEventBus();
|
|
989
|
+
const handlerRef = useRef(handler);
|
|
990
|
+
handlerRef.current = handler;
|
|
991
|
+
useEffect(() => {
|
|
992
|
+
const wrappedHandler = (evt) => {
|
|
993
|
+
handlerRef.current(evt);
|
|
994
|
+
};
|
|
995
|
+
const unsub = eventBus.on(event, wrappedHandler);
|
|
996
|
+
return () => {
|
|
997
|
+
if (typeof unsub === "function") unsub();
|
|
998
|
+
};
|
|
999
|
+
}, [event, eventBus]);
|
|
1000
|
+
}
|
|
1001
|
+
function useEmitEvent() {
|
|
1002
|
+
const eventBus = useEventBus();
|
|
1003
|
+
return useCallback(
|
|
1004
|
+
(type, payload, source) => {
|
|
1005
|
+
eventBus.emit(type, payload, source);
|
|
1006
|
+
},
|
|
1007
|
+
[eventBus]
|
|
1008
|
+
);
|
|
1009
|
+
}
|
|
1010
|
+
var log11 = createLogger("almadar:ui:ui-slots");
|
|
1011
|
+
var DEFAULT_SOURCE_KEY = "__default__";
|
|
1012
|
+
var MULTI_SOURCE_STACK_TRAIT = "__multi_source_stack__";
|
|
1013
|
+
var ALL_SLOTS = [
|
|
1014
|
+
"main",
|
|
1015
|
+
"sidebar",
|
|
1016
|
+
"modal",
|
|
1017
|
+
"drawer",
|
|
1018
|
+
"overlay",
|
|
1019
|
+
"center",
|
|
1020
|
+
"toast",
|
|
1021
|
+
"hud-top",
|
|
1022
|
+
"hud-bottom",
|
|
1023
|
+
"floating"
|
|
1024
|
+
];
|
|
1025
|
+
var DEFAULT_SLOTS = ALL_SLOTS.reduce(
|
|
1026
|
+
(acc, slot) => {
|
|
1027
|
+
acc[slot] = null;
|
|
1028
|
+
return acc;
|
|
1029
|
+
},
|
|
1030
|
+
{}
|
|
1031
|
+
);
|
|
1032
|
+
var DEFAULT_SOURCES = ALL_SLOTS.reduce(
|
|
1033
|
+
(acc, slot) => {
|
|
1034
|
+
acc[slot] = {};
|
|
1035
|
+
return acc;
|
|
1036
|
+
},
|
|
1037
|
+
{}
|
|
1038
|
+
);
|
|
1039
|
+
function aggregateSlot(sources) {
|
|
1040
|
+
if (!sources) return null;
|
|
1041
|
+
const entries = Object.entries(sources);
|
|
1042
|
+
if (entries.length === 0) return null;
|
|
1043
|
+
if (entries.length === 1) return entries[0][1];
|
|
1044
|
+
const children = entries.map(([, entry]) => ({
|
|
1045
|
+
type: entry.pattern,
|
|
1046
|
+
...entry.props
|
|
1047
|
+
}));
|
|
1048
|
+
const stackId = `slot-content-stack-${entries.map(([k]) => k).join("-")}`;
|
|
1049
|
+
return {
|
|
1050
|
+
id: stackId,
|
|
1051
|
+
pattern: "stack",
|
|
1052
|
+
props: {
|
|
1053
|
+
direction: "vertical",
|
|
1054
|
+
gap: "lg",
|
|
1055
|
+
children
|
|
1056
|
+
},
|
|
1057
|
+
priority: 0,
|
|
1058
|
+
animation: "fade",
|
|
1059
|
+
sourceTrait: MULTI_SOURCE_STACK_TRAIT
|
|
1060
|
+
};
|
|
1061
|
+
}
|
|
1062
|
+
function useUISlotManager() {
|
|
1063
|
+
const [sources, setSources] = useState(DEFAULT_SOURCES);
|
|
1064
|
+
const subscribersRef = useRef(/* @__PURE__ */ new Set());
|
|
1065
|
+
const timersRef = useRef(/* @__PURE__ */ new Map());
|
|
1066
|
+
const traitIndexRef = useRef(/* @__PURE__ */ new Map());
|
|
1067
|
+
const traitSubscribersRef = useRef(/* @__PURE__ */ new Map());
|
|
1068
|
+
const slots = useMemo(() => {
|
|
1069
|
+
const out = { ...DEFAULT_SLOTS };
|
|
1070
|
+
for (const slot of ALL_SLOTS) {
|
|
1071
|
+
out[slot] = aggregateSlot(sources[slot]);
|
|
1072
|
+
}
|
|
1073
|
+
return out;
|
|
1074
|
+
}, [sources]);
|
|
1075
|
+
useEffect(() => {
|
|
1076
|
+
return () => {
|
|
1077
|
+
timersRef.current.forEach((timer) => clearTimeout(timer));
|
|
1078
|
+
timersRef.current.clear();
|
|
1079
|
+
};
|
|
1080
|
+
}, []);
|
|
1081
|
+
const notifySubscribers = useCallback((slot, content) => {
|
|
1082
|
+
subscribersRef.current.forEach((callback) => {
|
|
1083
|
+
try {
|
|
1084
|
+
callback(slot, content);
|
|
1085
|
+
} catch (error) {
|
|
1086
|
+
log11.error("Subscriber error", { error: error instanceof Error ? error : String(error) });
|
|
1087
|
+
}
|
|
1088
|
+
});
|
|
1089
|
+
}, []);
|
|
1090
|
+
const notifyTraitSubscribers = useCallback(
|
|
1091
|
+
(traitName, content) => {
|
|
1092
|
+
const subs = traitSubscribersRef.current.get(traitName);
|
|
1093
|
+
if (!subs) return;
|
|
1094
|
+
subs.forEach((callback) => {
|
|
1095
|
+
try {
|
|
1096
|
+
callback(content);
|
|
1097
|
+
} catch (error) {
|
|
1098
|
+
log11.error("Trait subscriber error", { traitName, error: error instanceof Error ? error : String(error) });
|
|
1099
|
+
}
|
|
1100
|
+
});
|
|
1101
|
+
},
|
|
1102
|
+
[]
|
|
1103
|
+
);
|
|
1104
|
+
const indexTraitRender = useCallback(
|
|
1105
|
+
(traitName, content) => {
|
|
1106
|
+
traitIndexRef.current.set(traitName, content);
|
|
1107
|
+
},
|
|
1108
|
+
[]
|
|
1109
|
+
);
|
|
1110
|
+
const unindexTrait = useCallback((traitName) => {
|
|
1111
|
+
traitIndexRef.current.delete(traitName);
|
|
1112
|
+
}, []);
|
|
1113
|
+
const render = useCallback(
|
|
1114
|
+
(config) => {
|
|
1115
|
+
const sourceKey = config.sourceTrait ?? DEFAULT_SOURCE_KEY;
|
|
1116
|
+
const id = `slot-content-${config.target}-${sourceKey}`;
|
|
1117
|
+
const content = {
|
|
1118
|
+
id,
|
|
1119
|
+
pattern: config.pattern,
|
|
1120
|
+
props: config.props ?? {},
|
|
1121
|
+
priority: config.priority ?? 0,
|
|
1122
|
+
animation: config.animation ?? "fade",
|
|
1123
|
+
onDismiss: config.onDismiss,
|
|
1124
|
+
sourceTrait: config.sourceTrait,
|
|
1125
|
+
slot: config.target,
|
|
1126
|
+
transitionEvent: config.transitionEvent,
|
|
1127
|
+
fromState: config.fromState,
|
|
1128
|
+
entity: config.entity
|
|
1129
|
+
};
|
|
1130
|
+
if (config.autoDismissMs && config.autoDismissMs > 0) {
|
|
1131
|
+
content.autoDismissAt = Date.now() + config.autoDismissMs;
|
|
1132
|
+
const prevTimer = timersRef.current.get(id);
|
|
1133
|
+
if (prevTimer) clearTimeout(prevTimer);
|
|
1134
|
+
const timer = setTimeout(() => {
|
|
1135
|
+
setSources((prev) => {
|
|
1136
|
+
const slotSources = prev[config.target];
|
|
1137
|
+
if (slotSources && slotSources[sourceKey] === content) {
|
|
1138
|
+
content.onDismiss?.();
|
|
1139
|
+
const next = { ...slotSources };
|
|
1140
|
+
delete next[sourceKey];
|
|
1141
|
+
const updated = { ...prev, [config.target]: next };
|
|
1142
|
+
notifySubscribers(config.target, aggregateSlot(next));
|
|
1143
|
+
return updated;
|
|
1144
|
+
}
|
|
1145
|
+
return prev;
|
|
1146
|
+
});
|
|
1147
|
+
timersRef.current.delete(id);
|
|
1148
|
+
}, config.autoDismissMs);
|
|
1149
|
+
timersRef.current.set(id, timer);
|
|
1150
|
+
}
|
|
1151
|
+
setSources((prev) => {
|
|
1152
|
+
const slotSources = prev[config.target] ?? {};
|
|
1153
|
+
const existing = slotSources[sourceKey];
|
|
1154
|
+
if (existing && existing.priority > content.priority) {
|
|
1155
|
+
log11.warn("Slot already has higher priority content", {
|
|
1156
|
+
slot: config.target,
|
|
1157
|
+
sourceKey,
|
|
1158
|
+
existingPriority: existing.priority,
|
|
1159
|
+
newPriority: content.priority
|
|
1160
|
+
});
|
|
1161
|
+
return prev;
|
|
1162
|
+
}
|
|
1163
|
+
const nextSources = {
|
|
1164
|
+
...slotSources,
|
|
1165
|
+
[sourceKey]: content
|
|
1166
|
+
};
|
|
1167
|
+
const nextAll = { ...prev, [config.target]: nextSources };
|
|
1168
|
+
if (content.sourceTrait) {
|
|
1169
|
+
indexTraitRender(content.sourceTrait, content);
|
|
1170
|
+
notifyTraitSubscribers(content.sourceTrait, content);
|
|
1171
|
+
}
|
|
1172
|
+
log11.info("slot:written", {
|
|
1173
|
+
slot: config.target,
|
|
1174
|
+
sourceKey,
|
|
1175
|
+
sourceTrait: content.sourceTrait,
|
|
1176
|
+
patternType: content.pattern,
|
|
1177
|
+
priority: content.priority
|
|
1178
|
+
});
|
|
1179
|
+
notifySubscribers(config.target, aggregateSlot(nextSources));
|
|
1180
|
+
return nextAll;
|
|
1181
|
+
});
|
|
1182
|
+
return id;
|
|
1183
|
+
},
|
|
1184
|
+
[notifySubscribers, notifyTraitSubscribers, indexTraitRender]
|
|
1185
|
+
);
|
|
1186
|
+
const clear = useCallback(
|
|
1187
|
+
(slot) => {
|
|
1188
|
+
setSources((prev) => {
|
|
1189
|
+
const slotSources = prev[slot];
|
|
1190
|
+
if (!slotSources || Object.keys(slotSources).length === 0) {
|
|
1191
|
+
return prev;
|
|
1192
|
+
}
|
|
1193
|
+
for (const content of Object.values(slotSources)) {
|
|
1194
|
+
const timer = timersRef.current.get(content.id);
|
|
1195
|
+
if (timer) {
|
|
1196
|
+
clearTimeout(timer);
|
|
1197
|
+
timersRef.current.delete(content.id);
|
|
1198
|
+
}
|
|
1199
|
+
content.onDismiss?.();
|
|
1200
|
+
if (content.sourceTrait) {
|
|
1201
|
+
unindexTrait(content.sourceTrait);
|
|
1202
|
+
notifyTraitSubscribers(content.sourceTrait, null);
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
notifySubscribers(slot, null);
|
|
1206
|
+
return { ...prev, [slot]: {} };
|
|
1207
|
+
});
|
|
1208
|
+
},
|
|
1209
|
+
[notifySubscribers, notifyTraitSubscribers, unindexTrait]
|
|
1210
|
+
);
|
|
1211
|
+
const clearBySource = useCallback(
|
|
1212
|
+
(slot, sourceTrait) => {
|
|
1213
|
+
const sourceKey = sourceTrait;
|
|
1214
|
+
setSources((prev) => {
|
|
1215
|
+
const slotSources = prev[slot];
|
|
1216
|
+
if (!slotSources || !(sourceKey in slotSources)) {
|
|
1217
|
+
log11.debug("slot:clear-noop", { slot, sourceTrait, reason: !slotSources ? "no-slot" : "no-source" });
|
|
1218
|
+
return prev;
|
|
1219
|
+
}
|
|
1220
|
+
const content = slotSources[sourceKey];
|
|
1221
|
+
const timer = timersRef.current.get(content.id);
|
|
1222
|
+
if (timer) {
|
|
1223
|
+
clearTimeout(timer);
|
|
1224
|
+
timersRef.current.delete(content.id);
|
|
1225
|
+
}
|
|
1226
|
+
content.onDismiss?.();
|
|
1227
|
+
if (content.sourceTrait) {
|
|
1228
|
+
unindexTrait(content.sourceTrait);
|
|
1229
|
+
notifyTraitSubscribers(content.sourceTrait, null);
|
|
1230
|
+
}
|
|
1231
|
+
const nextSources = { ...slotSources };
|
|
1232
|
+
delete nextSources[sourceKey];
|
|
1233
|
+
log11.info("slot:cleared", { slot, sourceTrait, lastPatternType: content.pattern });
|
|
1234
|
+
notifySubscribers(slot, aggregateSlot(nextSources));
|
|
1235
|
+
return { ...prev, [slot]: nextSources };
|
|
1236
|
+
});
|
|
1237
|
+
},
|
|
1238
|
+
[notifySubscribers, notifyTraitSubscribers, unindexTrait]
|
|
1239
|
+
);
|
|
1240
|
+
const clearById = useCallback(
|
|
1241
|
+
(id) => {
|
|
1242
|
+
setSources((prev) => {
|
|
1243
|
+
for (const slot of ALL_SLOTS) {
|
|
1244
|
+
const slotSources = prev[slot];
|
|
1245
|
+
if (!slotSources) continue;
|
|
1246
|
+
const matchKey = Object.keys(slotSources).find(
|
|
1247
|
+
(k) => slotSources[k].id === id
|
|
1248
|
+
);
|
|
1249
|
+
if (!matchKey) continue;
|
|
1250
|
+
const content = slotSources[matchKey];
|
|
1251
|
+
const timer = timersRef.current.get(id);
|
|
1252
|
+
if (timer) {
|
|
1253
|
+
clearTimeout(timer);
|
|
1254
|
+
timersRef.current.delete(id);
|
|
1255
|
+
}
|
|
1256
|
+
content.onDismiss?.();
|
|
1257
|
+
if (content.sourceTrait) {
|
|
1258
|
+
unindexTrait(content.sourceTrait);
|
|
1259
|
+
notifyTraitSubscribers(content.sourceTrait, null);
|
|
1260
|
+
}
|
|
1261
|
+
const nextSources = { ...slotSources };
|
|
1262
|
+
delete nextSources[matchKey];
|
|
1263
|
+
notifySubscribers(slot, aggregateSlot(nextSources));
|
|
1264
|
+
return { ...prev, [slot]: nextSources };
|
|
1265
|
+
}
|
|
1266
|
+
return prev;
|
|
1267
|
+
});
|
|
1268
|
+
},
|
|
1269
|
+
[notifySubscribers, notifyTraitSubscribers, unindexTrait]
|
|
1270
|
+
);
|
|
1271
|
+
const clearAll = useCallback(() => {
|
|
1272
|
+
timersRef.current.forEach((timer) => clearTimeout(timer));
|
|
1273
|
+
timersRef.current.clear();
|
|
1274
|
+
setSources((prev) => {
|
|
1275
|
+
for (const slot of ALL_SLOTS) {
|
|
1276
|
+
const slotSources = prev[slot];
|
|
1277
|
+
if (!slotSources) continue;
|
|
1278
|
+
for (const content of Object.values(slotSources)) {
|
|
1279
|
+
content.onDismiss?.();
|
|
1280
|
+
if (content.sourceTrait) {
|
|
1281
|
+
notifyTraitSubscribers(content.sourceTrait, null);
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
notifySubscribers(slot, null);
|
|
1285
|
+
}
|
|
1286
|
+
return DEFAULT_SOURCES;
|
|
1287
|
+
});
|
|
1288
|
+
traitIndexRef.current.clear();
|
|
1289
|
+
}, [notifySubscribers, notifyTraitSubscribers]);
|
|
1290
|
+
const subscribe = useCallback((callback) => {
|
|
1291
|
+
subscribersRef.current.add(callback);
|
|
1292
|
+
return () => {
|
|
1293
|
+
subscribersRef.current.delete(callback);
|
|
1294
|
+
};
|
|
1295
|
+
}, []);
|
|
1296
|
+
const hasContent = useCallback(
|
|
1297
|
+
(slot) => slots[slot] !== null,
|
|
1298
|
+
[slots]
|
|
1299
|
+
);
|
|
1300
|
+
const getContent = useCallback(
|
|
1301
|
+
(slot) => slots[slot] ?? null,
|
|
1302
|
+
[slots]
|
|
1303
|
+
);
|
|
1304
|
+
const getTraitContent = useCallback(
|
|
1305
|
+
(traitName) => traitIndexRef.current.get(traitName) ?? null,
|
|
1306
|
+
[]
|
|
1307
|
+
);
|
|
1308
|
+
const subscribeTrait = useCallback(
|
|
1309
|
+
(traitName, callback) => {
|
|
1310
|
+
let set = traitSubscribersRef.current.get(traitName);
|
|
1311
|
+
if (!set) {
|
|
1312
|
+
set = /* @__PURE__ */ new Set();
|
|
1313
|
+
traitSubscribersRef.current.set(traitName, set);
|
|
1314
|
+
}
|
|
1315
|
+
set.add(callback);
|
|
1316
|
+
return () => {
|
|
1317
|
+
const s = traitSubscribersRef.current.get(traitName);
|
|
1318
|
+
if (!s) return;
|
|
1319
|
+
s.delete(callback);
|
|
1320
|
+
if (s.size === 0) {
|
|
1321
|
+
traitSubscribersRef.current.delete(traitName);
|
|
1322
|
+
}
|
|
1323
|
+
};
|
|
1324
|
+
},
|
|
1325
|
+
[]
|
|
1326
|
+
);
|
|
1327
|
+
const updateTraitContent = useCallback(
|
|
1328
|
+
(traitName, content) => {
|
|
1329
|
+
const id = `slot-content-trait-${traitName}`;
|
|
1330
|
+
const fullContent = { ...content, id, sourceTrait: traitName };
|
|
1331
|
+
indexTraitRender(traitName, fullContent);
|
|
1332
|
+
notifyTraitSubscribers(traitName, fullContent);
|
|
1333
|
+
return id;
|
|
1334
|
+
},
|
|
1335
|
+
[indexTraitRender, notifyTraitSubscribers]
|
|
1336
|
+
);
|
|
1337
|
+
return {
|
|
1338
|
+
slots,
|
|
1339
|
+
render,
|
|
1340
|
+
clear,
|
|
1341
|
+
clearBySource,
|
|
1342
|
+
clearById,
|
|
1343
|
+
clearAll,
|
|
1344
|
+
subscribe,
|
|
1345
|
+
hasContent,
|
|
1346
|
+
getContent,
|
|
1347
|
+
getTraitContent,
|
|
1348
|
+
subscribeTrait,
|
|
1349
|
+
updateTraitContent
|
|
1350
|
+
};
|
|
1351
|
+
}
|
|
1352
|
+
var UI_PREFIX = "UI:";
|
|
1353
|
+
function useUIEvents(dispatch, traitName, validEvents, eventBusInstance) {
|
|
1354
|
+
const defaultEventBus = useEventBus();
|
|
1355
|
+
const eventBus = eventBusInstance ?? defaultEventBus;
|
|
1356
|
+
const validEventsKey = validEvents.slice().sort().join(",");
|
|
1357
|
+
const stableValidEvents = useMemo(
|
|
1358
|
+
() => validEvents,
|
|
1359
|
+
[validEventsKey]
|
|
1360
|
+
// intentional — validEventsKey is the stable dep
|
|
1361
|
+
);
|
|
1362
|
+
useEffect(() => {
|
|
1363
|
+
const unsubscribes = [];
|
|
1364
|
+
for (const smEvent of stableValidEvents) {
|
|
1365
|
+
const handler = (event) => {
|
|
1366
|
+
if (event.source && event.source.dispatched) {
|
|
1367
|
+
return;
|
|
1368
|
+
}
|
|
1369
|
+
dispatch(smEvent, event.payload);
|
|
1370
|
+
};
|
|
1371
|
+
unsubscribes.push(
|
|
1372
|
+
eventBus.on(`${UI_PREFIX}${traitName}.${smEvent}`, handler)
|
|
1373
|
+
);
|
|
1374
|
+
}
|
|
1375
|
+
return () => {
|
|
1376
|
+
for (const unsub of unsubscribes) {
|
|
1377
|
+
if (typeof unsub === "function") unsub();
|
|
1378
|
+
}
|
|
1379
|
+
};
|
|
1380
|
+
}, [eventBus, dispatch, traitName, stableValidEvents]);
|
|
1381
|
+
}
|
|
1382
|
+
function useTraitListens(dispatch, listens, eventBusInstance) {
|
|
1383
|
+
const defaultEventBus = useEventBus();
|
|
1384
|
+
const eventBus = eventBusInstance ?? defaultEventBus;
|
|
1385
|
+
const stableKey = listens.map((l) => `${l.sourceKey}->${l.trigger}`).sort().join("|");
|
|
1386
|
+
const stableListens = useMemo(
|
|
1387
|
+
() => listens,
|
|
1388
|
+
[stableKey]
|
|
1389
|
+
// intentional
|
|
1390
|
+
);
|
|
1391
|
+
useEffect(() => {
|
|
1392
|
+
const unsubscribes = [];
|
|
1393
|
+
for (const spec of stableListens) {
|
|
1394
|
+
const handler = (event) => {
|
|
1395
|
+
dispatch(spec.trigger, event.payload);
|
|
1396
|
+
};
|
|
1397
|
+
unsubscribes.push(eventBus.on(`${UI_PREFIX}${spec.sourceKey}`, handler));
|
|
1398
|
+
}
|
|
1399
|
+
return () => {
|
|
1400
|
+
for (const unsub of unsubscribes) {
|
|
1401
|
+
if (typeof unsub === "function") unsub();
|
|
1402
|
+
}
|
|
1403
|
+
};
|
|
1404
|
+
}, [eventBus, dispatch, stableListens]);
|
|
1405
|
+
}
|
|
1406
|
+
var queryStores = /* @__PURE__ */ new Map();
|
|
1407
|
+
function getOrCreateStore(query) {
|
|
1408
|
+
if (!queryStores.has(query)) {
|
|
1409
|
+
queryStores.set(query, {
|
|
1410
|
+
search: "",
|
|
1411
|
+
filters: {},
|
|
1412
|
+
sortField: void 0,
|
|
1413
|
+
sortDirection: void 0,
|
|
1414
|
+
listeners: /* @__PURE__ */ new Set()
|
|
1415
|
+
});
|
|
1416
|
+
}
|
|
1417
|
+
return queryStores.get(query);
|
|
1418
|
+
}
|
|
1419
|
+
function useQuerySingleton(query) {
|
|
1420
|
+
const [, forceUpdate] = useState({});
|
|
1421
|
+
if (!query) {
|
|
1422
|
+
return null;
|
|
1423
|
+
}
|
|
1424
|
+
const store = useMemo(() => getOrCreateStore(query), [query]);
|
|
1425
|
+
useMemo(() => {
|
|
1426
|
+
const listener = () => forceUpdate({});
|
|
1427
|
+
store.listeners.add(listener);
|
|
1428
|
+
return () => {
|
|
1429
|
+
store.listeners.delete(listener);
|
|
1430
|
+
};
|
|
1431
|
+
}, [store]);
|
|
1432
|
+
const notifyListeners = useCallback(() => {
|
|
1433
|
+
store.listeners.forEach((listener) => listener());
|
|
1434
|
+
}, [store]);
|
|
1435
|
+
const setSearch = useCallback((value) => {
|
|
1436
|
+
store.search = value;
|
|
1437
|
+
notifyListeners();
|
|
1438
|
+
}, [store, notifyListeners]);
|
|
1439
|
+
const setFilter = useCallback((key, value) => {
|
|
1440
|
+
store.filters = { ...store.filters, [key]: value };
|
|
1441
|
+
notifyListeners();
|
|
1442
|
+
}, [store, notifyListeners]);
|
|
1443
|
+
const clearFilters = useCallback(() => {
|
|
1444
|
+
store.filters = {};
|
|
1445
|
+
store.search = "";
|
|
1446
|
+
notifyListeners();
|
|
1447
|
+
}, [store, notifyListeners]);
|
|
1448
|
+
const setSort = useCallback((field, direction) => {
|
|
1449
|
+
store.sortField = field;
|
|
1450
|
+
store.sortDirection = direction;
|
|
1451
|
+
notifyListeners();
|
|
1452
|
+
}, [store, notifyListeners]);
|
|
1453
|
+
return {
|
|
1454
|
+
search: store.search,
|
|
1455
|
+
setSearch,
|
|
1456
|
+
filters: store.filters,
|
|
1457
|
+
setFilter,
|
|
1458
|
+
clearFilters,
|
|
1459
|
+
sortField: store.sortField,
|
|
1460
|
+
sortDirection: store.sortDirection,
|
|
1461
|
+
setSort
|
|
1462
|
+
};
|
|
1463
|
+
}
|
|
1464
|
+
function parseQueryBinding(binding) {
|
|
1465
|
+
const cleaned = binding.startsWith("@") ? binding.slice(1) : binding;
|
|
1466
|
+
const parts = cleaned.split(".");
|
|
1467
|
+
return {
|
|
1468
|
+
query: parts[0],
|
|
1469
|
+
field: parts.length > 1 ? parts.slice(1).join(".") : void 0
|
|
1470
|
+
};
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
// locales/en.json
|
|
1474
|
+
var en_default = {
|
|
1475
|
+
$meta: {
|
|
1476
|
+
locale: "en",
|
|
1477
|
+
direction: "ltr"
|
|
1478
|
+
},
|
|
1479
|
+
"common.save": "Save",
|
|
1480
|
+
"common.cancel": "Cancel",
|
|
1481
|
+
"common.delete": "Delete",
|
|
1482
|
+
"common.close": "Close",
|
|
1483
|
+
"common.confirm": "Are you sure?",
|
|
1484
|
+
"common.create": "Create",
|
|
1485
|
+
"common.edit": "Edit",
|
|
1486
|
+
"common.view": "View",
|
|
1487
|
+
"common.add": "Add",
|
|
1488
|
+
"common.remove": "Remove",
|
|
1489
|
+
"common.search": "Search...",
|
|
1490
|
+
"common.filter": "Filter",
|
|
1491
|
+
"common.actions": "Actions",
|
|
1492
|
+
"common.yes": "Yes",
|
|
1493
|
+
"common.no": "No",
|
|
1494
|
+
"common.selected": "selected",
|
|
1495
|
+
"common.ok": "OK",
|
|
1496
|
+
"common.done": "Done",
|
|
1497
|
+
"common.apply": "Apply",
|
|
1498
|
+
"common.reset": "Reset",
|
|
1499
|
+
"common.refresh": "Refresh",
|
|
1500
|
+
"common.export": "Export",
|
|
1501
|
+
"common.import": "Import",
|
|
1502
|
+
"common.copy": "Copy",
|
|
1503
|
+
"common.settings": "Settings",
|
|
1504
|
+
"nav.previous": "Previous",
|
|
1505
|
+
"nav.next": "Next",
|
|
1506
|
+
"nav.back": "Back",
|
|
1507
|
+
"nav.home": "Home",
|
|
1508
|
+
"form.submit": "Submit",
|
|
1509
|
+
"form.saving": "Saving...",
|
|
1510
|
+
"form.required": "This field is required",
|
|
1511
|
+
"form.invalidEmail": "Enter a valid email address",
|
|
1512
|
+
"form.selectPlaceholder": "Select {{label}}...",
|
|
1513
|
+
"form.searchPlaceholder": "Search {{entity}}...",
|
|
1514
|
+
"table.empty.title": "No items found",
|
|
1515
|
+
"table.empty.description": "No items to display.",
|
|
1516
|
+
"table.search.placeholder": "Search...",
|
|
1517
|
+
"table.pagination.showing": "Showing {{start}} to {{end}} of {{total}} results",
|
|
1518
|
+
"table.pagination.page": "Page {{page}} of {{totalPages}}",
|
|
1519
|
+
"table.bulk.selected": "{{count}} selected",
|
|
1520
|
+
"table.loading": "Loading...",
|
|
1521
|
+
"status.loading": "Loading...",
|
|
1522
|
+
"status.scheduled": "Scheduled",
|
|
1523
|
+
"status.inProgress": "In Progress",
|
|
1524
|
+
"status.completed": "Completed",
|
|
1525
|
+
"status.cancelled": "Cancelled",
|
|
1526
|
+
"status.pending": "Pending",
|
|
1527
|
+
"status.active": "Active",
|
|
1528
|
+
"status.inactive": "Inactive",
|
|
1529
|
+
"status.draft": "Draft",
|
|
1530
|
+
"status.archived": "Archived",
|
|
1531
|
+
"error.generic": "Something went wrong",
|
|
1532
|
+
"error.retry": "Try again",
|
|
1533
|
+
"error.notFound": "Not found",
|
|
1534
|
+
"error.loadFailed": "Failed to load: {{message}}",
|
|
1535
|
+
"error.configMissing": "Configuration not found for: {{id}}",
|
|
1536
|
+
"common.loading": "Loading...",
|
|
1537
|
+
"common.showMore": "Show More",
|
|
1538
|
+
"common.showLess": "Show Less",
|
|
1539
|
+
"common.noResults": "No results found",
|
|
1540
|
+
"common.saveChanges": "Save Changes",
|
|
1541
|
+
"common.retry": "Retry",
|
|
1542
|
+
"common.open": "Open",
|
|
1543
|
+
"common.back": "Back",
|
|
1544
|
+
"empty.noItems": "No items",
|
|
1545
|
+
"empty.noData": "No data available",
|
|
1546
|
+
"empty.noItemsYet": "No items yet",
|
|
1547
|
+
"empty.noItemsAdded": "No items added yet",
|
|
1548
|
+
"empty.noOptionsFound": "No options found",
|
|
1549
|
+
"list.addItemPlaceholder": "Add new item...",
|
|
1550
|
+
"error.occurred": "An error occurred",
|
|
1551
|
+
"error.failedToLoad": "Failed to load data",
|
|
1552
|
+
"wizard.back": "Back",
|
|
1553
|
+
"wizard.next": "Next",
|
|
1554
|
+
"wizard.complete": "Complete",
|
|
1555
|
+
"wizard.stepOf": "Step {{current}} of {{total}}",
|
|
1556
|
+
"pagination.previous": "Previous",
|
|
1557
|
+
"pagination.next": "Next",
|
|
1558
|
+
"pagination.total": "Total:",
|
|
1559
|
+
"pagination.show": "Show:",
|
|
1560
|
+
"pagination.goTo": "Go to:",
|
|
1561
|
+
"pagination.go": "Go",
|
|
1562
|
+
"auth.signIn": "Sign in",
|
|
1563
|
+
"auth.signOut": "Sign out",
|
|
1564
|
+
"dialog.confirm": "Confirm",
|
|
1565
|
+
"dialog.cancel": "Cancel",
|
|
1566
|
+
"dialog.loading": "Loading...",
|
|
1567
|
+
"dialog.delete.title": "Delete {{item}}?",
|
|
1568
|
+
"dialog.delete.message": "This action cannot be undone.",
|
|
1569
|
+
"trait.availableActions": "Available Actions",
|
|
1570
|
+
"trait.transitions": "Transitions",
|
|
1571
|
+
"trait.availableNow": "Available now",
|
|
1572
|
+
"book.startReading": "Start Reading",
|
|
1573
|
+
"book.tableOfContents": "Table of Contents",
|
|
1574
|
+
"book.partNumber": "Part {{number}}",
|
|
1575
|
+
"book.print": "Print",
|
|
1576
|
+
"book.previousPage": "Previous page",
|
|
1577
|
+
"book.nextPage": "Next page",
|
|
1578
|
+
"quiz.showAnswer": "Show answer",
|
|
1579
|
+
"quiz.hideAnswer": "Hide answer",
|
|
1580
|
+
"aria.closeModal": "Close modal",
|
|
1581
|
+
"aria.closeToast": "Dismiss toast",
|
|
1582
|
+
"aria.closeAlert": "Dismiss alert",
|
|
1583
|
+
"aria.removeFilter": "Remove filter",
|
|
1584
|
+
"aria.closeDrawer": "Close drawer",
|
|
1585
|
+
"aria.closePanel": "Close panel",
|
|
1586
|
+
"aria.previousImage": "Previous image",
|
|
1587
|
+
"aria.nextImage": "Next image",
|
|
1588
|
+
"aria.dismiss": "Dismiss",
|
|
1589
|
+
"aria.previousSlide": "Previous slide",
|
|
1590
|
+
"aria.nextSlide": "Next slide",
|
|
1591
|
+
"aria.previousDays": "Previous days",
|
|
1592
|
+
"aria.nextDays": "Next days",
|
|
1593
|
+
"aria.decrease": "Decrease",
|
|
1594
|
+
"aria.increase": "Increase",
|
|
1595
|
+
"aria.breadcrumb": "Breadcrumb",
|
|
1596
|
+
"aria.tableOfContents": "Table of contents",
|
|
1597
|
+
"aria.docsSidebar": "Documentation sidebar",
|
|
1598
|
+
"aria.selectAllRows": "Select all rows",
|
|
1599
|
+
"aria.selectAll": "Select all",
|
|
1600
|
+
"aria.upvote": "Upvote",
|
|
1601
|
+
"aria.downvote": "Downvote",
|
|
1602
|
+
"aria.qrScanner": "QR scanner",
|
|
1603
|
+
"aria.mockScanDev": "Mock scan (dev)",
|
|
1604
|
+
"aria.openMenu": "Open menu",
|
|
1605
|
+
"aria.closeMenu": "Close menu",
|
|
1606
|
+
"aria.openSidebar": "Open sidebar",
|
|
1607
|
+
"sidebar.expand": "Expand sidebar",
|
|
1608
|
+
"sidebar.collapse": "Collapse sidebar",
|
|
1609
|
+
"sidebar.close": "Close sidebar",
|
|
1610
|
+
"loading.items": "Loading items...",
|
|
1611
|
+
"card.imageAlt": "Image",
|
|
1612
|
+
"canvas.emptyMessage": "No content",
|
|
1613
|
+
"canvas.errorTitle": "Canvas error",
|
|
1614
|
+
"book.noData": "No data",
|
|
1615
|
+
"common.notifications": "Notifications",
|
|
1616
|
+
"common.remaining": "{{count}} remaining",
|
|
1617
|
+
"error.somethingWentWrong": "Something went wrong",
|
|
1618
|
+
"error.loadingItems": "Loading items...",
|
|
1619
|
+
"error.noItemsFound": "No items found",
|
|
1620
|
+
"debug.noEntityData": "No entity data",
|
|
1621
|
+
"debug.noEntities": "No entities",
|
|
1622
|
+
"debug.noTicks": "No ticks registered",
|
|
1623
|
+
"debug.noActiveTraits": "No active traits",
|
|
1624
|
+
"debug.noGuardEvaluations": "No guard evaluations",
|
|
1625
|
+
"debug.noBridgeData": "No bridge data",
|
|
1626
|
+
"debug.status": "Status",
|
|
1627
|
+
"debug.eventsForwarded": "Events Forwarded (Client \u2192 Server)",
|
|
1628
|
+
"debug.eventsReceived": "Events Received (Server \u2192 Client)",
|
|
1629
|
+
"debug.lastHeartbeat": "Last Heartbeat",
|
|
1630
|
+
"debug.noEventsYet": "No events yet",
|
|
1631
|
+
"debug.noTransitionsRecorded": "No transitions recorded",
|
|
1632
|
+
"debug.noVerificationChecks": "No verification checks yet",
|
|
1633
|
+
"display.chartError": "Chart error",
|
|
1634
|
+
"display.codeViewerError": "Code viewer error",
|
|
1635
|
+
"display.noCode": "No code",
|
|
1636
|
+
"display.documentError": "Document error",
|
|
1637
|
+
"display.noDocument": "No document",
|
|
1638
|
+
"display.graphError": "Graph error",
|
|
1639
|
+
"display.noGraphData": "No graph data",
|
|
1640
|
+
"display.galleryError": "Gallery error",
|
|
1641
|
+
"display.noMedia": "No media",
|
|
1642
|
+
"display.meterError": "Meter error",
|
|
1643
|
+
"display.signaturePadError": "Signature pad error",
|
|
1644
|
+
"display.timelineError": "Timeline error",
|
|
1645
|
+
"display.noEvents": "No events",
|
|
1646
|
+
"template.features": "Features",
|
|
1647
|
+
"template.howItWorks": "How It Works",
|
|
1648
|
+
"template.showcase": "Showcase",
|
|
1649
|
+
"template.faq": "Frequently Asked Questions",
|
|
1650
|
+
"template.ourTeam": "Our Team",
|
|
1651
|
+
"template.caseStudies": "Case Studies",
|
|
1652
|
+
"richBlockEditor.toolbar.text": "Text",
|
|
1653
|
+
"richBlockEditor.toolbar.h1": "H1",
|
|
1654
|
+
"richBlockEditor.toolbar.h2": "H2",
|
|
1655
|
+
"richBlockEditor.toolbar.h3": "H3",
|
|
1656
|
+
"richBlockEditor.toolbar.bulletList": "Bullet list",
|
|
1657
|
+
"richBlockEditor.toolbar.numbered": "Numbered",
|
|
1658
|
+
"richBlockEditor.toolbar.quote": "Quote",
|
|
1659
|
+
"richBlockEditor.toolbar.code": "Code",
|
|
1660
|
+
"richBlockEditor.toolbar.divider": "Divider",
|
|
1661
|
+
"richBlockEditor.toolbar.image": "Image",
|
|
1662
|
+
"richBlockEditor.blockType.paragraph": "Text",
|
|
1663
|
+
"richBlockEditor.blockType.heading1": "Heading 1",
|
|
1664
|
+
"richBlockEditor.blockType.heading2": "Heading 2",
|
|
1665
|
+
"richBlockEditor.blockType.heading3": "Heading 3",
|
|
1666
|
+
"richBlockEditor.blockType.bulletList": "Bullet list",
|
|
1667
|
+
"richBlockEditor.blockType.numberedList": "Numbered list",
|
|
1668
|
+
"richBlockEditor.blockType.quote": "Quote",
|
|
1669
|
+
"richBlockEditor.blockType.code": "Code",
|
|
1670
|
+
"richBlockEditor.blockType.divider": "Divider",
|
|
1671
|
+
"richBlockEditor.blockType.image": "Image",
|
|
1672
|
+
"richBlockEditor.blockActions": "Block actions",
|
|
1673
|
+
"richBlockEditor.duplicate": "Duplicate",
|
|
1674
|
+
"richBlockEditor.turnInto": "Turn into",
|
|
1675
|
+
"richBlockEditor.placeholder.heading1": "Heading 1",
|
|
1676
|
+
"richBlockEditor.placeholder.heading2": "Heading 2",
|
|
1677
|
+
"richBlockEditor.placeholder.heading3": "Heading 3",
|
|
1678
|
+
"richBlockEditor.placeholder.quote": "Quote",
|
|
1679
|
+
"richBlockEditor.placeholder.code": "Enter code",
|
|
1680
|
+
"richBlockEditor.placeholder.paragraph": "Start writing...",
|
|
1681
|
+
"richBlockEditor.placeholder.listItem": "List item",
|
|
1682
|
+
"richBlockEditor.placeholder.caption": "Caption (optional)",
|
|
1683
|
+
"richBlockEditor.aria.heading1Block": "Heading 1 block",
|
|
1684
|
+
"richBlockEditor.aria.heading2Block": "Heading 2 block",
|
|
1685
|
+
"richBlockEditor.aria.heading3Block": "Heading 3 block",
|
|
1686
|
+
"richBlockEditor.aria.quoteBlock": "Quote block",
|
|
1687
|
+
"richBlockEditor.aria.codeBlock": "Code block",
|
|
1688
|
+
"richBlockEditor.aria.codeLanguage": "Code language",
|
|
1689
|
+
"richBlockEditor.aria.imageUrl": "Image URL",
|
|
1690
|
+
"richBlockEditor.aria.imageCaption": "Image caption",
|
|
1691
|
+
"richBlockEditor.aria.listItem": "List item",
|
|
1692
|
+
"richBlockEditor.aria.removeListItem": "Remove list item",
|
|
1693
|
+
"richBlockEditor.aria.paragraphBlock": "Paragraph block",
|
|
1694
|
+
"richBlockEditor.embeddedImage": "Embedded image",
|
|
1695
|
+
"richBlockEditor.noImageUrl": "No image URL set",
|
|
1696
|
+
"richBlockEditor.addItem": "Add item",
|
|
1697
|
+
"richBlockEditor.insertParagraphBelow": "Insert paragraph below",
|
|
1698
|
+
"richBlockEditor.editorToolbar": "Block editor toolbar",
|
|
1699
|
+
"richBlockEditor.insertEntry": "Insert {{label}}",
|
|
1700
|
+
"versionDiff.compare": "Compare",
|
|
1701
|
+
"versionDiff.to": "to",
|
|
1702
|
+
"versionDiff.beforeRevision": "Before revision",
|
|
1703
|
+
"versionDiff.afterRevision": "After revision",
|
|
1704
|
+
"versionDiff.switchToInline": "Switch to inline view",
|
|
1705
|
+
"versionDiff.switchToSideBySide": "Switch to side-by-side view",
|
|
1706
|
+
"versionDiff.revert": "Revert",
|
|
1707
|
+
"versionDiff.byAuthor": " by {{author}}",
|
|
1708
|
+
"violationAlert.actionType.measure": "Corrective Measure",
|
|
1709
|
+
"violationAlert.actionType.admin": "Administrative Action",
|
|
1710
|
+
"violationAlert.actionType.penalty": "Penalty Proceedings",
|
|
1711
|
+
"violationAlert.fallbackMessage": "Violation",
|
|
1712
|
+
"violationAlert.adminLabel": "Admin:",
|
|
1713
|
+
"violationAlert.penaltyLabel": "Penalty:",
|
|
1714
|
+
"violationAlert.goToField": "Go to field",
|
|
1715
|
+
"branchingLogic.title": "Branching logic",
|
|
1716
|
+
"branchingLogic.if": "If",
|
|
1717
|
+
"branchingLogic.goTo": "go to",
|
|
1718
|
+
"branchingLogic.rules": "Rules",
|
|
1719
|
+
"branchingLogic.logicGraph": "Logic graph",
|
|
1720
|
+
"branchingLogic.addRule": "Add rule",
|
|
1721
|
+
"branchingLogic.deleteRule": "Delete rule",
|
|
1722
|
+
"branchingLogic.endOfSurvey": "End of survey",
|
|
1723
|
+
"branchingLogic.brokenReference": "Broken reference",
|
|
1724
|
+
"branchingLogic.selectQuestion": "Select question",
|
|
1725
|
+
"branchingLogic.selectTarget": "Select target",
|
|
1726
|
+
"branchingLogic.selectValue": "Select value",
|
|
1727
|
+
"branchingLogic.addValue": "Add value",
|
|
1728
|
+
"branchingLogic.value": "Value",
|
|
1729
|
+
"branchingLogic.typeValuePressEnter": "Type value, press Enter",
|
|
1730
|
+
"branchingLogic.operatorEquals": "equals",
|
|
1731
|
+
"branchingLogic.operatorNotEquals": "does not equal",
|
|
1732
|
+
"branchingLogic.operatorContains": "contains",
|
|
1733
|
+
"branchingLogic.operatorIn": "is one of",
|
|
1734
|
+
"branchingLogic.graphAriaLabel": "Branching logic graph",
|
|
1735
|
+
"branchingLogic.ruleCountOne": "{{count}} rule",
|
|
1736
|
+
"branchingLogic.ruleCountOther": "{{count}} rules",
|
|
1737
|
+
"branchingLogic.brokenCount": "{{count}} broken",
|
|
1738
|
+
"branchingLogic.emptyNoQuestions": "Add questions before building branching rules.",
|
|
1739
|
+
"branchingLogic.emptyNoRules": "No rules yet. Add a rule to define branching logic.",
|
|
1740
|
+
"filterGroup.filters": "Filters",
|
|
1741
|
+
"filterGroup.all": "All",
|
|
1742
|
+
"filterGroup.clear": "Clear",
|
|
1743
|
+
"filterGroup.clearAll": "Clear all",
|
|
1744
|
+
"filterGroup.from": "From",
|
|
1745
|
+
"filterGroup.to": "To",
|
|
1746
|
+
"filterGroup.allOf": "All {{label}}",
|
|
1747
|
+
"filterGroup.activeCount": "{{count}} active",
|
|
1748
|
+
"debug.guardEvaluationsHint": "Guard evaluations will appear when transitions or ticks with guards execute",
|
|
1749
|
+
"debug.expression": "Expression",
|
|
1750
|
+
"debug.inputs": "Inputs",
|
|
1751
|
+
"debug.trait": "Trait",
|
|
1752
|
+
"debug.filterAll": "All",
|
|
1753
|
+
"debug.filterPassed": "Passed",
|
|
1754
|
+
"debug.filterFailed": "Failed",
|
|
1755
|
+
"debug.traitsInitHint": "Traits will appear when the state machine initializes",
|
|
1756
|
+
"debug.traitsMountHint": "Traits will appear when components using them are mounted",
|
|
1757
|
+
"debug.activeStates": "Active States",
|
|
1758
|
+
"debug.availableEvents": "Available Events",
|
|
1759
|
+
"debug.noTransitionsFromState": "No transitions from current state",
|
|
1760
|
+
"debug.guarded": "guarded",
|
|
1761
|
+
"debug.otherEvents": "Other Events (not available from current state)",
|
|
1762
|
+
"debug.recentTransitions": "Recent Transitions",
|
|
1763
|
+
"debug.transitionsCount": "{{count}} transitions",
|
|
1764
|
+
"debug.states": "States",
|
|
1765
|
+
"debug.transitions": "Transitions",
|
|
1766
|
+
"debug.guards": "Guards",
|
|
1767
|
+
"debug.debugModeHint": "Debug mode may not be enabled",
|
|
1768
|
+
"debug.entitiesSpawnHint": "Entities will appear when spawned",
|
|
1769
|
+
"debug.singleton": "Singleton",
|
|
1770
|
+
"debug.singletonsCount": "Singletons ({{count}})",
|
|
1771
|
+
"debug.runtimeCount": "Runtime ({{count}})",
|
|
1772
|
+
"debug.moreEntities": "+{{count}} more entities",
|
|
1773
|
+
"debug.persistent": "Persistent",
|
|
1774
|
+
"debug.loadedCount": "{{count}} loaded",
|
|
1775
|
+
"debug.notLoaded": "not loaded",
|
|
1776
|
+
"debug.eventsExecuteHint": "Events will appear as traits, ticks, and other systems execute",
|
|
1777
|
+
"debug.allCount": "All ({{count}})",
|
|
1778
|
+
"debug.autoScroll": "Auto-scroll",
|
|
1779
|
+
"debug.transitionsProcessHint": "Transitions will appear as the state machine processes events",
|
|
1780
|
+
"debug.transitionsRecorded": "{{count}} transitions recorded",
|
|
1781
|
+
"debug.guardLabel": "guard:",
|
|
1782
|
+
"debug.effectsCount": "{{count}} effects",
|
|
1783
|
+
"debug.bridgeInitHint": "The ServerBridge has not been initialized. Bridge health will appear once the runtime connects to the server.",
|
|
1784
|
+
"debug.never": "Never",
|
|
1785
|
+
"debug.connected": "Connected",
|
|
1786
|
+
"debug.disconnected": "Disconnected",
|
|
1787
|
+
"debug.lastError": "Last Error",
|
|
1788
|
+
"debug.totalEventsProcessed": "{{count}} total events processed",
|
|
1789
|
+
"debug.server": "server",
|
|
1790
|
+
"debug.clientEffectsCount": "{{count}} clientEffects",
|
|
1791
|
+
"debug.emitLabel": "emit:",
|
|
1792
|
+
"debug.rowsCount": "{{count}} rows",
|
|
1793
|
+
"debug.serverResponse": "server response",
|
|
1794
|
+
"debug.collapseVerificationTimeline": "Collapse verification timeline",
|
|
1795
|
+
"debug.expandVerificationTimeline": "Expand verification timeline",
|
|
1796
|
+
"debug.failCount": "{{count}} fail",
|
|
1797
|
+
"debug.ok": "OK",
|
|
1798
|
+
"debug.localCount": "{{count}} local",
|
|
1799
|
+
"debug.serverCount": "{{count}} server",
|
|
1800
|
+
"debug.waitingForTransitions": "Waiting for transitions...",
|
|
1801
|
+
"debug.tabDispatch": "Dispatch",
|
|
1802
|
+
"debug.tabVerify": "Verify",
|
|
1803
|
+
"debug.tabVerifyAlert": "Verify (!)",
|
|
1804
|
+
"debug.tabTimeline": "Timeline",
|
|
1805
|
+
"debug.tabBridge": "Bridge",
|
|
1806
|
+
"debug.tabTraits": "Traits",
|
|
1807
|
+
"debug.tabTicks": "Ticks",
|
|
1808
|
+
"debug.tabEntities": "Entities",
|
|
1809
|
+
"debug.tabEvents": "Events",
|
|
1810
|
+
"debug.tabGuards": "Guards",
|
|
1811
|
+
"debug.debugger": "Debugger",
|
|
1812
|
+
"debug.failedCount": "{{count}} failed",
|
|
1813
|
+
"debug.traitsCount": "{{count}} traits",
|
|
1814
|
+
"debug.idle": "Idle",
|
|
1815
|
+
"debug.openDebugger": "Open Debugger (`)",
|
|
1816
|
+
"debug.kflowVerifier": "KFlow Verifier",
|
|
1817
|
+
"debug.allPassing": "All passing",
|
|
1818
|
+
"debug.runtime": "Runtime",
|
|
1819
|
+
"debug.close": "Close (`)",
|
|
1820
|
+
"debug.toggleHint": "Press ` to toggle | window.__orbitalVerification for automation",
|
|
1821
|
+
"replyTree.expandReplies": "Expand replies",
|
|
1822
|
+
"replyTree.collapseReplies": "Collapse replies",
|
|
1823
|
+
"replyTree.voteOnReplyBy": "Vote on reply by {{author}}",
|
|
1824
|
+
"replyTree.replyTo": "Reply to {{author}}",
|
|
1825
|
+
"replyTree.replyToPlaceholder": "Reply to {{author}}\u2026",
|
|
1826
|
+
"replyTree.reply": "Reply",
|
|
1827
|
+
"replyTree.flagReplyBy": "Flag reply by {{author}}",
|
|
1828
|
+
"replyTree.flag": "Flag",
|
|
1829
|
+
"replyTree.send": "Send",
|
|
1830
|
+
"replyTree.continueThread": "Continue thread",
|
|
1831
|
+
"replyTree.noRepliesYet": "No replies yet.",
|
|
1832
|
+
"signaturePad.label": "Signature",
|
|
1833
|
+
"signaturePad.helperText": "Draw your signature above",
|
|
1834
|
+
"signaturePad.clear": "Clear",
|
|
1835
|
+
"signaturePad.confirm": "Confirm",
|
|
1836
|
+
"qrScanner.cameraUnavailable": "Camera unavailable",
|
|
1837
|
+
"qrScanner.paused": "Paused",
|
|
1838
|
+
"qrScanner.resumeScanning": "Resume scanning",
|
|
1839
|
+
"qrScanner.pauseScanning": "Pause scanning",
|
|
1840
|
+
"qrScanner.switchToFrontCamera": "Switch to front camera",
|
|
1841
|
+
"qrScanner.switchToRearCamera": "Switch to rear camera",
|
|
1842
|
+
"qrScanner.mockScan": "Mock Scan",
|
|
1843
|
+
"docSearch.placeholder": "Search documentation...",
|
|
1844
|
+
"stateMachine.loading": "Loading state machine\u2026",
|
|
1845
|
+
"stateMachine.noStateMachine": "No state machine to visualize",
|
|
1846
|
+
"avl.trigger": "Trigger",
|
|
1847
|
+
"avl.guard": "Guard",
|
|
1848
|
+
"avl.effects": "Effects",
|
|
1849
|
+
"avl.props": "Props",
|
|
1850
|
+
"avl.entity": "Entity",
|
|
1851
|
+
"avl.traits": "Traits",
|
|
1852
|
+
"avl.transition": "Transition",
|
|
1853
|
+
"avl.onEntity": "on {{entity}}",
|
|
1854
|
+
"avl.linkedTo": "linked to {{entity}}",
|
|
1855
|
+
"avl.pressEscToZoomOut": "Press Esc to zoom out",
|
|
1856
|
+
"avl.zoomIn": "Zoom in",
|
|
1857
|
+
"avl.zoomOut": "Zoom out",
|
|
1858
|
+
"avl.orbitalLabel": "Orbital: {{name}}",
|
|
1859
|
+
"avl.orbitalLabelHighlighted": "Orbital: {{name}} (highlighted)",
|
|
1860
|
+
"avl.noTraitData": "No trait data",
|
|
1861
|
+
"avl.computingLayout": "Computing layout...",
|
|
1862
|
+
"avl.noStateMachine": "No state machine",
|
|
1863
|
+
"avl.listensFor": "listens for {{event}}",
|
|
1864
|
+
"avl.emits": "emits {{event}}",
|
|
1865
|
+
"avl.pageLayout": "Page Layout",
|
|
1866
|
+
"avl.overlaySuffix": "(overlay)",
|
|
1867
|
+
"orbPreview.previewBadge": "Preview",
|
|
1868
|
+
"orbPreview.doubleClickToOpen": "Double-click to open",
|
|
1869
|
+
"orbPreview.dropToAddAndOpen": "Drop to add and open",
|
|
1870
|
+
"orbPreview.dispatching": "Coordinator is dispatching to this orbital",
|
|
1871
|
+
"orbPreview.noPreview": "No preview available",
|
|
1872
|
+
"orbPreview.screensCount": "{{count}} screens",
|
|
1873
|
+
"detailView.noTransitionData": "No transition data",
|
|
1874
|
+
"orbInspector.required": "req",
|
|
1875
|
+
"orbInspector.addField": "Add Field",
|
|
1876
|
+
"orbInspector.serviceMode": "Service Mode",
|
|
1877
|
+
"orbInspector.standalone": "Standalone",
|
|
1878
|
+
"orbInspector.embedded": "Embedded",
|
|
1879
|
+
"orbInspector.rendersOwnUi": "Renders its own UI",
|
|
1880
|
+
"orbInspector.headless": "Headless, wired to other behaviors",
|
|
1881
|
+
"orbInspector.addEffect": "Add Effect",
|
|
1882
|
+
"orbInspector.guardExpression": "Guard expression",
|
|
1883
|
+
"orbInspector.selectPatternForStyles": "Select a pattern to view its style tokens.",
|
|
1884
|
+
"orbInspector.tokens": "Tokens",
|
|
1885
|
+
"orbInspector.noTokenContract": "No token contract declared for this pattern.",
|
|
1886
|
+
"orbInspector.variant": "Variant",
|
|
1887
|
+
"orbInspector.size": "Size",
|
|
1888
|
+
"orbInspector.statesCount": "{{count}} states",
|
|
1889
|
+
"orbInspector.onEntity": " on {{entity}}",
|
|
1890
|
+
"orbInspector.projectThemeTokens": "Project theme tokens",
|
|
1891
|
+
"orbInspector.tokenGroup.colors": "Colors",
|
|
1892
|
+
"orbInspector.tokenGroup.radii": "Radii",
|
|
1893
|
+
"orbInspector.tokenGroup.spacing": "Spacing",
|
|
1894
|
+
"orbInspector.tokenGroup.shadows": "Shadows",
|
|
1895
|
+
"orbInspector.tab.inspector": "Inspector",
|
|
1896
|
+
"orbInspector.tab.styles": "Styles",
|
|
1897
|
+
"orbInspector.tab.code": "Code",
|
|
1898
|
+
"canvas.goBackToOverview": "Go back to overview",
|
|
1899
|
+
"canvas.overview": "Overview",
|
|
1900
|
+
"canvas.expanded": "Expanded",
|
|
1901
|
+
"canvas.modulesCount": "{{count}} modules",
|
|
1902
|
+
"canvas.screensCount": "{{count}} screens",
|
|
1903
|
+
"canvas.switchToView": "Switch to {{label}} view",
|
|
1904
|
+
"lawReference.viewFullText": "View full law text",
|
|
1905
|
+
"statCard.defaultLabel": "Stat",
|
|
1906
|
+
"statCard.vsLastPeriod": "vs last period",
|
|
1907
|
+
"mediaGallery.upload": "Upload",
|
|
1908
|
+
"mediaGallery.noMediaDescription": "No media items to display.",
|
|
1909
|
+
"pagination.jumpPlaceholder": "Page",
|
|
1910
|
+
"table.selectRow": "Select row {{id}}",
|
|
1911
|
+
"card.selectItem": "Select {{item}}",
|
|
1912
|
+
"card.itemFallback": "item",
|
|
1913
|
+
"fileTree.noFiles": "No files",
|
|
1914
|
+
"masterDetail.selectItem": "Select an item to view details",
|
|
1915
|
+
"empty.createFirst": "Create your first item to get started.",
|
|
1916
|
+
"upload.dropOrBrowse": "Drop files here or click to browse",
|
|
1917
|
+
"upload.dropFilesHere": "Drop files here",
|
|
1918
|
+
"upload.accepted": "Accepted: {{accept}}",
|
|
1919
|
+
"upload.maxSize": "Max size: {{size}}",
|
|
1920
|
+
"upload.maxFiles": "Up to {{count}} files",
|
|
1921
|
+
"upload.error.maxFiles": "Maximum {{count}} files allowed",
|
|
1922
|
+
"upload.error.invalidType": "Invalid file type: {{name}}",
|
|
1923
|
+
"upload.error.tooLarge": "File too large: {{name}} (max {{size}})",
|
|
1924
|
+
"optionConstraint.requiredOne": "Required, pick 1",
|
|
1925
|
+
"optionConstraint.optionalOne": "Optional, pick up to 1",
|
|
1926
|
+
"optionConstraint.pickExactly": "Pick exactly {{count}}",
|
|
1927
|
+
"optionConstraint.pickRange": "Pick {{min}}-{{max}}",
|
|
1928
|
+
"optionConstraint.pickAtLeast": "Pick at least {{count}}",
|
|
1929
|
+
"optionConstraint.pickUpTo": "Pick up to {{count}}",
|
|
1930
|
+
"optionConstraint.optional": "Optional",
|
|
1931
|
+
"optionConstraint.outOfStock": "Out of stock",
|
|
1932
|
+
"optionConstraint.error.pickOne": "Pick 1 option",
|
|
1933
|
+
"optionConstraint.error.pickOnlyOne": "Pick only 1 option",
|
|
1934
|
+
"optionConstraint.error.pickMore": "Pick at least {{count}} more",
|
|
1935
|
+
"optionConstraint.error.removeOptions": "Remove {{count}} options",
|
|
1936
|
+
"stateMachine.pinned": "Pinned",
|
|
1937
|
+
"stateMachine.eventCount": "{{count}} events",
|
|
1938
|
+
"stateMachine.externalEffects": "External Effects",
|
|
1939
|
+
"stateMachine.legend.initial": "Initial",
|
|
1940
|
+
"stateMachine.legend.final": "Final",
|
|
1941
|
+
"stateMachine.legend.state": "State",
|
|
1942
|
+
"stateMachine.legend.multiEvent": "Multi-event",
|
|
1943
|
+
"relationSelect.selectPlaceholder": "Select...",
|
|
1944
|
+
"battle.cancel": "Cancel",
|
|
1945
|
+
"battle.defeat": "Defeat",
|
|
1946
|
+
"battle.endTurn": "End Turn",
|
|
1947
|
+
"battle.playAgain": "Play Again",
|
|
1948
|
+
"battle.turnsPlayed": "Turns Played",
|
|
1949
|
+
"battle.victory": "Victory",
|
|
1950
|
+
"builder.allPlaced": "All placed",
|
|
1951
|
+
"builder.blueprint": "Blueprint",
|
|
1952
|
+
"builder.build": "Build",
|
|
1953
|
+
"builder.components": "Components",
|
|
1954
|
+
"builder.empty": "Empty",
|
|
1955
|
+
"builder.reset": "Reset",
|
|
1956
|
+
"builder.success": "Success",
|
|
1957
|
+
"classifier.allCorrect": "All correct!",
|
|
1958
|
+
"classifier.check": "Check",
|
|
1959
|
+
"classifier.correct": "correct",
|
|
1960
|
+
"classifier.itemsToSort": "Items to sort",
|
|
1961
|
+
"classifier.reset": "Reset",
|
|
1962
|
+
"common.error": "Error",
|
|
1963
|
+
"debugger.allFound": "All bugs found!",
|
|
1964
|
+
"debugger.bugsFound": "bugs found",
|
|
1965
|
+
"debugger.findBugs": "Find {{count}} bugs",
|
|
1966
|
+
"debugger.reset": "Reset",
|
|
1967
|
+
"debugger.submit": "Submit",
|
|
1968
|
+
"error.genericLoad": "Failed to load",
|
|
1969
|
+
"error.loadingData": "Loading data",
|
|
1970
|
+
"eventHandler.addRule": "Add Rule",
|
|
1971
|
+
"eventHandler.chainComplete": "Chain complete!",
|
|
1972
|
+
"eventHandler.clickObject": "Click objects",
|
|
1973
|
+
"eventHandler.eventLog": "Event Log",
|
|
1974
|
+
"eventHandler.heardEvent": "{{object}} heard {{event}} \u2192 {{action}}",
|
|
1975
|
+
"eventHandler.noEvents": "No events yet",
|
|
1976
|
+
"eventHandler.noListeners": "No listeners for {{event}}",
|
|
1977
|
+
"eventHandler.rules": "{{count}}/{{max}} rules",
|
|
1978
|
+
"eventHandler.simulationStarted": "Simulating: {{events}}",
|
|
1979
|
+
"eventHandler.state": "State",
|
|
1980
|
+
"eventHandler.then": "then",
|
|
1981
|
+
"eventHandler.when": "When",
|
|
1982
|
+
"game.goal": "Goal",
|
|
1983
|
+
"game.hint": "Hint",
|
|
1984
|
+
"game.play": "Play",
|
|
1985
|
+
"game.reset": "Reset",
|
|
1986
|
+
"game.runTests": "Run Tests",
|
|
1987
|
+
"negotiator.chooseAction": "Choose an action",
|
|
1988
|
+
"negotiator.failed": "Negotiation failed",
|
|
1989
|
+
"negotiator.finalScore": "Final score",
|
|
1990
|
+
"negotiator.history": "History",
|
|
1991
|
+
"negotiator.opponent": "Opponent",
|
|
1992
|
+
"negotiator.playAgain": "Play Again",
|
|
1993
|
+
"negotiator.round": "Round {{current}} of {{total}}",
|
|
1994
|
+
"negotiator.success": "Negotiation successful",
|
|
1995
|
+
"negotiator.target": "Target",
|
|
1996
|
+
"negotiator.you": "You",
|
|
1997
|
+
"platformer.level": "Level",
|
|
1998
|
+
"platformer.lost": "Game Over",
|
|
1999
|
+
"platformer.nextLevel": "Next Level",
|
|
2000
|
+
"platformer.noLives": "No lives left",
|
|
2001
|
+
"platformer.playAgain": "Play Again",
|
|
2002
|
+
"platformer.score": "Score",
|
|
2003
|
+
"platformer.won": "You won!",
|
|
2004
|
+
"puzzle.tryAgainButton": "Try Again",
|
|
2005
|
+
"roguelike.atk": "ATK",
|
|
2006
|
+
"roguelike.cleared": "Dungeon cleared! Depth reached: {{depth}}",
|
|
2007
|
+
"roguelike.defeat": "Defeated!",
|
|
2008
|
+
"roguelike.depth": "Depth",
|
|
2009
|
+
"roguelike.enemy": "Enemy",
|
|
2010
|
+
"roguelike.hp": "HP",
|
|
2011
|
+
"roguelike.phase": "Phase",
|
|
2012
|
+
"roguelike.playAgain": "Play Again",
|
|
2013
|
+
"roguelike.player": "Hero",
|
|
2014
|
+
"roguelike.victory": "Victory!",
|
|
2015
|
+
"sequencer.actions": "Actions",
|
|
2016
|
+
"sequencer.dragActions": "Drag actions here",
|
|
2017
|
+
"sequencer.levelComplete": "Level complete!",
|
|
2018
|
+
"sequencer.yourSequence": "Your sequence",
|
|
2019
|
+
"simulator.correct": "Correct",
|
|
2020
|
+
"simulator.incorrect": "Incorrect",
|
|
2021
|
+
"simulator.parameters": "Parameters",
|
|
2022
|
+
"simulator.reset": "Reset",
|
|
2023
|
+
"simulator.simulate": "Simulate",
|
|
2024
|
+
"simulator.target": "Target",
|
|
2025
|
+
"stateArchitect.addTransition": "Add transition from {{state}}",
|
|
2026
|
+
"stateArchitect.addTransitionPrompt": "Click target state",
|
|
2027
|
+
"stateArchitect.allPassed": "All tests passed!",
|
|
2028
|
+
"stateArchitect.clickTarget": "Click a target state (current: {{state}})",
|
|
2029
|
+
"stateArchitect.gotState": "Got state: {{state}}",
|
|
2030
|
+
"stateArchitect.graph": "Graph",
|
|
2031
|
+
"stateArchitect.hideJson": "Hide JSON",
|
|
2032
|
+
"stateArchitect.showJson": "Show JSON",
|
|
2033
|
+
"stateArchitect.testResults": "Test Results",
|
|
2034
|
+
"stateArchitect.transitions": "{{count}} transitions",
|
|
2035
|
+
"stateArchitect.variables": "Variables: {{name}}",
|
|
2036
|
+
"stateArchitect.viewCode": "View Code",
|
|
2037
|
+
"td.defeat": "Defeat",
|
|
2038
|
+
"td.gold": "Gold",
|
|
2039
|
+
"td.lives": "Lives",
|
|
2040
|
+
"td.livesReachedZero": "Your base was overrun",
|
|
2041
|
+
"td.placeTower": "Place tower",
|
|
2042
|
+
"td.playAgain": "Play Again",
|
|
2043
|
+
"td.startWave": "Start Wave",
|
|
2044
|
+
"td.survivedAllWaves": "Survived all waves!",
|
|
2045
|
+
"td.victory": "Victory!",
|
|
2046
|
+
"td.wave": "Wave",
|
|
2047
|
+
"td.waveInProgress": "Wave in progress\u2026"
|
|
2048
|
+
};
|
|
2049
|
+
|
|
2050
|
+
// hooks/useTranslate.ts
|
|
2051
|
+
var { $meta: _meta, ...coreMessages } = en_default;
|
|
2052
|
+
var coreLocale = coreMessages;
|
|
2053
|
+
var I18nContext = createContext({
|
|
2054
|
+
locale: "en",
|
|
2055
|
+
direction: "ltr",
|
|
2056
|
+
t: (key, params) => {
|
|
2057
|
+
let msg = coreLocale[key] ?? key;
|
|
2058
|
+
if (params) {
|
|
2059
|
+
for (const [k, v] of Object.entries(params)) {
|
|
2060
|
+
msg = msg.split(`{{${k}}}`).join(String(v));
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
return msg;
|
|
2064
|
+
}
|
|
2065
|
+
});
|
|
2066
|
+
I18nContext.displayName = "I18nContext";
|
|
2067
|
+
var I18nProvider = I18nContext.Provider;
|
|
2068
|
+
function useTranslate() {
|
|
2069
|
+
return useContext(I18nContext);
|
|
2070
|
+
}
|
|
2071
|
+
function createTranslate(messages) {
|
|
2072
|
+
return (key, params) => {
|
|
2073
|
+
let msg = messages[key] ?? coreLocale[key] ?? key;
|
|
2074
|
+
if (params) {
|
|
2075
|
+
for (const [k, v] of Object.entries(params)) {
|
|
2076
|
+
msg = msg.split(`{{${k}}}`).join(String(v));
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
return msg;
|
|
2080
|
+
};
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
// hooks/useAuthContext.ts
|
|
2084
|
+
function useAuthContext() {
|
|
2085
|
+
return {
|
|
2086
|
+
user: null,
|
|
2087
|
+
loading: false,
|
|
2088
|
+
signIn: void 0,
|
|
2089
|
+
signOut: void 0
|
|
2090
|
+
};
|
|
2091
|
+
}
|
|
2092
|
+
function useSwipeGesture(callbacks, options = {}) {
|
|
2093
|
+
const { threshold = 50, velocityThreshold = 0.3, preventDefault = false } = options;
|
|
2094
|
+
const startX = useRef(0);
|
|
2095
|
+
const startY = useRef(0);
|
|
2096
|
+
const startTime = useRef(0);
|
|
2097
|
+
const currentX = useRef(0);
|
|
2098
|
+
const tracking = useRef(false);
|
|
2099
|
+
const offsetXRef = useRef(0);
|
|
2100
|
+
const isSwipingRef = useRef(false);
|
|
2101
|
+
const onPointerDown = useCallback((e) => {
|
|
2102
|
+
startX.current = e.clientX;
|
|
2103
|
+
startY.current = e.clientY;
|
|
2104
|
+
currentX.current = e.clientX;
|
|
2105
|
+
startTime.current = Date.now();
|
|
2106
|
+
tracking.current = true;
|
|
2107
|
+
isSwipingRef.current = false;
|
|
2108
|
+
offsetXRef.current = 0;
|
|
2109
|
+
e.target.setPointerCapture?.(e.pointerId);
|
|
2110
|
+
}, []);
|
|
2111
|
+
const onPointerMove = useCallback((e) => {
|
|
2112
|
+
if (!tracking.current) return;
|
|
2113
|
+
if (preventDefault) e.preventDefault();
|
|
2114
|
+
currentX.current = e.clientX;
|
|
2115
|
+
const dx = e.clientX - startX.current;
|
|
2116
|
+
const dy = e.clientY - startY.current;
|
|
2117
|
+
if (Math.abs(dx) > 10 && Math.abs(dx) > Math.abs(dy)) {
|
|
2118
|
+
isSwipingRef.current = true;
|
|
2119
|
+
offsetXRef.current = dx;
|
|
2120
|
+
}
|
|
2121
|
+
}, [preventDefault]);
|
|
2122
|
+
const onPointerUp = useCallback((e) => {
|
|
2123
|
+
if (!tracking.current) return;
|
|
2124
|
+
tracking.current = false;
|
|
2125
|
+
const dx = e.clientX - startX.current;
|
|
2126
|
+
const dy = e.clientY - startY.current;
|
|
2127
|
+
const elapsed = Date.now() - startTime.current;
|
|
2128
|
+
const velocity = Math.abs(dx) / Math.max(elapsed, 1);
|
|
2129
|
+
offsetXRef.current = 0;
|
|
2130
|
+
isSwipingRef.current = false;
|
|
2131
|
+
if (Math.abs(dx) < threshold && velocity < velocityThreshold) return;
|
|
2132
|
+
if (Math.abs(dx) > Math.abs(dy)) {
|
|
2133
|
+
if (dx < -threshold) callbacks.onSwipeLeft?.();
|
|
2134
|
+
else if (dx > threshold) callbacks.onSwipeRight?.();
|
|
2135
|
+
} else {
|
|
2136
|
+
if (dy < -threshold) callbacks.onSwipeUp?.();
|
|
2137
|
+
else if (dy > threshold) callbacks.onSwipeDown?.();
|
|
2138
|
+
}
|
|
2139
|
+
}, [threshold, velocityThreshold, callbacks]);
|
|
2140
|
+
const onPointerCancel = useCallback(() => {
|
|
2141
|
+
tracking.current = false;
|
|
2142
|
+
offsetXRef.current = 0;
|
|
2143
|
+
isSwipingRef.current = false;
|
|
2144
|
+
}, []);
|
|
2145
|
+
return {
|
|
2146
|
+
onPointerDown,
|
|
2147
|
+
onPointerMove,
|
|
2148
|
+
onPointerUp,
|
|
2149
|
+
onPointerCancel,
|
|
2150
|
+
offsetX: offsetXRef.current,
|
|
2151
|
+
isSwiping: isSwipingRef.current
|
|
2152
|
+
};
|
|
2153
|
+
}
|
|
2154
|
+
function useLongPress(onLongPress, options = {}) {
|
|
2155
|
+
const { duration = 500, moveThreshold = 10 } = options;
|
|
2156
|
+
const timerRef = useRef(null);
|
|
2157
|
+
const startPos = useRef({ x: 0, y: 0 });
|
|
2158
|
+
const isPressedRef = useRef(false);
|
|
2159
|
+
const firedRef = useRef(false);
|
|
2160
|
+
const cancel = useCallback(() => {
|
|
2161
|
+
if (timerRef.current) {
|
|
2162
|
+
clearTimeout(timerRef.current);
|
|
2163
|
+
timerRef.current = null;
|
|
2164
|
+
}
|
|
2165
|
+
isPressedRef.current = false;
|
|
2166
|
+
}, []);
|
|
2167
|
+
const onPointerDown = useCallback((e) => {
|
|
2168
|
+
firedRef.current = false;
|
|
2169
|
+
startPos.current = { x: e.clientX, y: e.clientY };
|
|
2170
|
+
isPressedRef.current = true;
|
|
2171
|
+
timerRef.current = setTimeout(() => {
|
|
2172
|
+
firedRef.current = true;
|
|
2173
|
+
isPressedRef.current = false;
|
|
2174
|
+
onLongPress();
|
|
2175
|
+
}, duration);
|
|
2176
|
+
}, [duration, onLongPress]);
|
|
2177
|
+
const onPointerMove = useCallback((e) => {
|
|
2178
|
+
if (!isPressedRef.current) return;
|
|
2179
|
+
const dx = e.clientX - startPos.current.x;
|
|
2180
|
+
const dy = e.clientY - startPos.current.y;
|
|
2181
|
+
if (Math.sqrt(dx * dx + dy * dy) > moveThreshold) {
|
|
2182
|
+
cancel();
|
|
2183
|
+
}
|
|
2184
|
+
}, [moveThreshold, cancel]);
|
|
2185
|
+
const onPointerUp = useCallback(() => {
|
|
2186
|
+
cancel();
|
|
2187
|
+
}, [cancel]);
|
|
2188
|
+
const onPointerCancel = useCallback(() => {
|
|
2189
|
+
cancel();
|
|
2190
|
+
}, [cancel]);
|
|
2191
|
+
return {
|
|
2192
|
+
onPointerDown,
|
|
2193
|
+
onPointerMove,
|
|
2194
|
+
onPointerUp,
|
|
2195
|
+
onPointerCancel,
|
|
2196
|
+
isPressed: isPressedRef.current
|
|
2197
|
+
};
|
|
2198
|
+
}
|
|
2199
|
+
function useDragReorder(initialItems, onReorder) {
|
|
2200
|
+
const [items, setItems] = useState(initialItems);
|
|
2201
|
+
const [dragIndex, setDragIndex] = useState(-1);
|
|
2202
|
+
const [dragOverIndex, setDragOverIndex] = useState(-1);
|
|
2203
|
+
const itemsRef = useRef(initialItems);
|
|
2204
|
+
if (initialItems !== itemsRef.current) {
|
|
2205
|
+
itemsRef.current = initialItems;
|
|
2206
|
+
setItems(initialItems);
|
|
2207
|
+
}
|
|
2208
|
+
const isDragging = dragIndex >= 0;
|
|
2209
|
+
const handleDragStart = useCallback((index) => (e) => {
|
|
2210
|
+
e.preventDefault();
|
|
2211
|
+
setDragIndex(index);
|
|
2212
|
+
setDragOverIndex(index);
|
|
2213
|
+
e.target.setPointerCapture?.(e.pointerId);
|
|
2214
|
+
}, []);
|
|
2215
|
+
const handleDragMove = useCallback((index) => (e) => {
|
|
2216
|
+
if (dragIndex < 0) return;
|
|
2217
|
+
const target = document.elementFromPoint(e.clientX, e.clientY);
|
|
2218
|
+
if (!target) return;
|
|
2219
|
+
let el = target;
|
|
2220
|
+
while (el && !el.dataset.dragIndex) {
|
|
2221
|
+
el = el.parentElement;
|
|
2222
|
+
}
|
|
2223
|
+
if (el?.dataset.dragIndex) {
|
|
2224
|
+
const overIndex = parseInt(el.dataset.dragIndex, 10);
|
|
2225
|
+
if (!isNaN(overIndex) && overIndex !== dragOverIndex) {
|
|
2226
|
+
setDragOverIndex(overIndex);
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
}, [dragIndex, dragOverIndex]);
|
|
2230
|
+
const handleDragEnd = useCallback(() => {
|
|
2231
|
+
if (dragIndex >= 0 && dragOverIndex >= 0 && dragIndex !== dragOverIndex) {
|
|
2232
|
+
const newItems = [...items];
|
|
2233
|
+
const [movedItem] = newItems.splice(dragIndex, 1);
|
|
2234
|
+
newItems.splice(dragOverIndex, 0, movedItem);
|
|
2235
|
+
setItems(newItems);
|
|
2236
|
+
onReorder(dragIndex, dragOverIndex, items[dragIndex]);
|
|
2237
|
+
}
|
|
2238
|
+
setDragIndex(-1);
|
|
2239
|
+
setDragOverIndex(-1);
|
|
2240
|
+
}, [dragIndex, dragOverIndex, items, onReorder]);
|
|
2241
|
+
const getDragHandleProps = useCallback((index) => ({
|
|
2242
|
+
onPointerDown: handleDragStart(index),
|
|
2243
|
+
style: { cursor: "grab", touchAction: "none" },
|
|
2244
|
+
"aria-grabbed": dragIndex === index,
|
|
2245
|
+
role: "button"
|
|
2246
|
+
}), [handleDragStart, dragIndex]);
|
|
2247
|
+
const getItemProps = useCallback((index) => ({
|
|
2248
|
+
onPointerMove: handleDragMove(index),
|
|
2249
|
+
onPointerUp: handleDragEnd,
|
|
2250
|
+
"aria-dropeffect": "move",
|
|
2251
|
+
"data-drag-index": String(index),
|
|
2252
|
+
style: {
|
|
2253
|
+
opacity: dragIndex === index ? 0.5 : 1,
|
|
2254
|
+
transition: isDragging ? "transform 150ms ease" : void 0,
|
|
2255
|
+
transform: isDragging && dragOverIndex >= 0 ? index === dragIndex ? "scale(1.02)" : index > dragIndex && index <= dragOverIndex ? "translateY(-100%)" : index < dragIndex && index >= dragOverIndex ? "translateY(100%)" : void 0 : void 0
|
|
2256
|
+
}
|
|
2257
|
+
}), [handleDragMove, handleDragEnd, dragIndex, dragOverIndex, isDragging]);
|
|
2258
|
+
return {
|
|
2259
|
+
items,
|
|
2260
|
+
dragIndex,
|
|
2261
|
+
dragOverIndex,
|
|
2262
|
+
isDragging,
|
|
2263
|
+
getDragHandleProps,
|
|
2264
|
+
getItemProps
|
|
2265
|
+
};
|
|
2266
|
+
}
|
|
2267
|
+
function useInfiniteScroll(onLoadMore, options = {}) {
|
|
2268
|
+
const { rootMargin = "200px", hasMore = true, isLoading = false } = options;
|
|
2269
|
+
const observerRef = useRef(null);
|
|
2270
|
+
const callbackRef = useRef(onLoadMore);
|
|
2271
|
+
callbackRef.current = onLoadMore;
|
|
2272
|
+
const hasMoreRef = useRef(hasMore);
|
|
2273
|
+
hasMoreRef.current = hasMore;
|
|
2274
|
+
const isLoadingRef = useRef(isLoading);
|
|
2275
|
+
isLoadingRef.current = isLoading;
|
|
2276
|
+
useEffect(() => {
|
|
2277
|
+
return () => {
|
|
2278
|
+
observerRef.current?.disconnect();
|
|
2279
|
+
};
|
|
2280
|
+
}, []);
|
|
2281
|
+
const sentinelRef = useCallback((node) => {
|
|
2282
|
+
observerRef.current?.disconnect();
|
|
2283
|
+
if (!node) return;
|
|
2284
|
+
observerRef.current = new IntersectionObserver(
|
|
2285
|
+
(entries) => {
|
|
2286
|
+
const entry = entries[0];
|
|
2287
|
+
if (entry.isIntersecting && hasMoreRef.current && !isLoadingRef.current) {
|
|
2288
|
+
callbackRef.current();
|
|
2289
|
+
}
|
|
2290
|
+
},
|
|
2291
|
+
{ rootMargin }
|
|
2292
|
+
);
|
|
2293
|
+
observerRef.current.observe(node);
|
|
2294
|
+
}, [rootMargin]);
|
|
2295
|
+
return { sentinelRef };
|
|
2296
|
+
}
|
|
2297
|
+
function usePullToRefresh(onRefresh, options = {}) {
|
|
2298
|
+
const { threshold = 60, maxPull = 120 } = options;
|
|
2299
|
+
const [pullDistance, setPullDistance] = useState(0);
|
|
2300
|
+
const [isPulling, setIsPulling] = useState(false);
|
|
2301
|
+
const [isRefreshing, setIsRefreshing] = useState(false);
|
|
2302
|
+
const startY = useRef(0);
|
|
2303
|
+
const scrollTopRef = useRef(0);
|
|
2304
|
+
const onTouchStart = useCallback((e) => {
|
|
2305
|
+
const container = e.currentTarget;
|
|
2306
|
+
scrollTopRef.current = container.scrollTop;
|
|
2307
|
+
if (scrollTopRef.current <= 0) {
|
|
2308
|
+
startY.current = e.touches[0].clientY;
|
|
2309
|
+
setIsPulling(true);
|
|
2310
|
+
}
|
|
2311
|
+
}, []);
|
|
2312
|
+
const onTouchMove = useCallback((e) => {
|
|
2313
|
+
if (!isPulling || isRefreshing) return;
|
|
2314
|
+
const container = e.currentTarget;
|
|
2315
|
+
if (container.scrollTop > 0) {
|
|
2316
|
+
setPullDistance(0);
|
|
2317
|
+
return;
|
|
2318
|
+
}
|
|
2319
|
+
const dy = e.touches[0].clientY - startY.current;
|
|
2320
|
+
if (dy > 0) {
|
|
2321
|
+
const distance = Math.min(dy * 0.5, maxPull);
|
|
2322
|
+
setPullDistance(distance);
|
|
2323
|
+
}
|
|
2324
|
+
}, [isPulling, isRefreshing, maxPull]);
|
|
2325
|
+
const onTouchEnd = useCallback(() => {
|
|
2326
|
+
if (!isPulling) return;
|
|
2327
|
+
setIsPulling(false);
|
|
2328
|
+
if (pullDistance >= threshold && !isRefreshing) {
|
|
2329
|
+
setIsRefreshing(true);
|
|
2330
|
+
setPullDistance(threshold);
|
|
2331
|
+
onRefresh();
|
|
2332
|
+
} else {
|
|
2333
|
+
setPullDistance(0);
|
|
2334
|
+
}
|
|
2335
|
+
}, [isPulling, pullDistance, threshold, isRefreshing, onRefresh]);
|
|
2336
|
+
const endRefresh = useCallback(() => {
|
|
2337
|
+
setIsRefreshing(false);
|
|
2338
|
+
setPullDistance(0);
|
|
2339
|
+
}, []);
|
|
2340
|
+
const containerProps = {
|
|
2341
|
+
onTouchStart,
|
|
2342
|
+
onTouchMove,
|
|
2343
|
+
onTouchEnd,
|
|
2344
|
+
style: {
|
|
2345
|
+
transform: pullDistance > 0 ? `translateY(${pullDistance}px)` : void 0,
|
|
2346
|
+
transition: isPulling ? "none" : "transform 300ms ease-out"
|
|
2347
|
+
}
|
|
2348
|
+
};
|
|
2349
|
+
return {
|
|
2350
|
+
pullDistance,
|
|
2351
|
+
isPulling,
|
|
2352
|
+
isRefreshing,
|
|
2353
|
+
containerProps,
|
|
2354
|
+
endRefresh
|
|
2355
|
+
};
|
|
2356
|
+
}
|
|
2357
|
+
function localPoint(canvas, clientX, clientY) {
|
|
2358
|
+
if (!canvas) return { x: clientX, y: clientY };
|
|
2359
|
+
const rect = canvas.getBoundingClientRect();
|
|
2360
|
+
return { x: clientX - rect.left, y: clientY - rect.top };
|
|
2361
|
+
}
|
|
2362
|
+
function useCanvasGestures(options) {
|
|
2363
|
+
const {
|
|
2364
|
+
canvasRef,
|
|
2365
|
+
enabled = true,
|
|
2366
|
+
wheelStep = 1.1,
|
|
2367
|
+
onPointerDown,
|
|
2368
|
+
onPointerMove,
|
|
2369
|
+
onPointerUp,
|
|
2370
|
+
onZoom,
|
|
2371
|
+
onPanDelta,
|
|
2372
|
+
onMultiTouchStart
|
|
2373
|
+
} = options;
|
|
2374
|
+
const pointers = useRef(/* @__PURE__ */ new Map());
|
|
2375
|
+
const pinch = useRef(null);
|
|
2376
|
+
const computePinch = useCallback(() => {
|
|
2377
|
+
const pts = [...pointers.current.values()];
|
|
2378
|
+
const dx = pts[1].x - pts[0].x;
|
|
2379
|
+
const dy = pts[1].y - pts[0].y;
|
|
2380
|
+
return {
|
|
2381
|
+
distance: Math.hypot(dx, dy) || 1,
|
|
2382
|
+
centroid: { x: (pts[0].x + pts[1].x) / 2, y: (pts[0].y + pts[1].y) / 2 }
|
|
2383
|
+
};
|
|
2384
|
+
}, []);
|
|
2385
|
+
const handlePointerDown = useCallback(
|
|
2386
|
+
(e) => {
|
|
2387
|
+
if (!enabled) return;
|
|
2388
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
2389
|
+
pointers.current.set(e.pointerId, localPoint(canvasRef.current, e.clientX, e.clientY));
|
|
2390
|
+
if (pointers.current.size === 2) {
|
|
2391
|
+
onMultiTouchStart?.();
|
|
2392
|
+
pinch.current = computePinch();
|
|
2393
|
+
} else if (pointers.current.size === 1) {
|
|
2394
|
+
onPointerDown?.(e);
|
|
2395
|
+
}
|
|
2396
|
+
},
|
|
2397
|
+
[enabled, canvasRef, onMultiTouchStart, computePinch, onPointerDown]
|
|
2398
|
+
);
|
|
2399
|
+
const handlePointerMove = useCallback(
|
|
2400
|
+
(e) => {
|
|
2401
|
+
if (!enabled) return;
|
|
2402
|
+
if (pointers.current.has(e.pointerId)) {
|
|
2403
|
+
pointers.current.set(e.pointerId, localPoint(canvasRef.current, e.clientX, e.clientY));
|
|
2404
|
+
}
|
|
2405
|
+
if (pointers.current.size >= 2 && pinch.current) {
|
|
2406
|
+
const next = computePinch();
|
|
2407
|
+
const prev = pinch.current;
|
|
2408
|
+
if (next.distance !== prev.distance) {
|
|
2409
|
+
onZoom?.(next.distance / prev.distance, next.centroid.x, next.centroid.y);
|
|
2410
|
+
}
|
|
2411
|
+
onPanDelta?.(next.centroid.x - prev.centroid.x, next.centroid.y - prev.centroid.y);
|
|
2412
|
+
pinch.current = next;
|
|
2413
|
+
return;
|
|
2414
|
+
}
|
|
2415
|
+
onPointerMove?.(e);
|
|
2416
|
+
},
|
|
2417
|
+
[enabled, canvasRef, computePinch, onZoom, onPanDelta, onPointerMove]
|
|
2418
|
+
);
|
|
2419
|
+
const endPointer = useCallback(
|
|
2420
|
+
(e, fireUp) => {
|
|
2421
|
+
const wasMulti = pointers.current.size >= 2;
|
|
2422
|
+
pointers.current.delete(e.pointerId);
|
|
2423
|
+
if (pointers.current.size < 2) pinch.current = null;
|
|
2424
|
+
if (wasMulti && pointers.current.size === 1) return;
|
|
2425
|
+
if (pointers.current.size === 0 && fireUp) onPointerUp?.(e);
|
|
2426
|
+
},
|
|
2427
|
+
[onPointerUp]
|
|
2428
|
+
);
|
|
2429
|
+
const handlePointerUp = useCallback(
|
|
2430
|
+
(e) => {
|
|
2431
|
+
if (!enabled) return;
|
|
2432
|
+
endPointer(e, true);
|
|
2433
|
+
},
|
|
2434
|
+
[enabled, endPointer]
|
|
2435
|
+
);
|
|
2436
|
+
const handlePointerCancel = useCallback(
|
|
2437
|
+
(e) => {
|
|
2438
|
+
if (!enabled) return;
|
|
2439
|
+
endPointer(e, false);
|
|
2440
|
+
},
|
|
2441
|
+
[enabled, endPointer]
|
|
2442
|
+
);
|
|
2443
|
+
const handleWheel = useCallback(
|
|
2444
|
+
(e) => {
|
|
2445
|
+
if (!enabled) return;
|
|
2446
|
+
e.preventDefault();
|
|
2447
|
+
const { x, y } = localPoint(canvasRef.current, e.clientX, e.clientY);
|
|
2448
|
+
onZoom?.(e.deltaY < 0 ? wheelStep : 1 / wheelStep, x, y);
|
|
2449
|
+
},
|
|
2450
|
+
[enabled, canvasRef, wheelStep, onZoom]
|
|
2451
|
+
);
|
|
2452
|
+
return {
|
|
2453
|
+
onPointerDown: handlePointerDown,
|
|
2454
|
+
onPointerMove: handlePointerMove,
|
|
2455
|
+
onPointerUp: handlePointerUp,
|
|
2456
|
+
onPointerCancel: handlePointerCancel,
|
|
2457
|
+
onWheel: handleWheel
|
|
2458
|
+
};
|
|
2459
|
+
}
|
|
2460
|
+
function useTapReveal(options = {}) {
|
|
2461
|
+
const { onReveal, onDismiss, refs, enabled = true } = options;
|
|
2462
|
+
const [revealed, setRevealed] = useState(false);
|
|
2463
|
+
const onRevealRef = useRef(onReveal);
|
|
2464
|
+
const onDismissRef = useRef(onDismiss);
|
|
2465
|
+
onRevealRef.current = onReveal;
|
|
2466
|
+
onDismissRef.current = onDismiss;
|
|
2467
|
+
const reveal = useCallback(() => {
|
|
2468
|
+
setRevealed((wasRevealed) => {
|
|
2469
|
+
if (!wasRevealed) onRevealRef.current?.();
|
|
2470
|
+
return true;
|
|
2471
|
+
});
|
|
2472
|
+
}, []);
|
|
2473
|
+
const dismiss = useCallback(() => {
|
|
2474
|
+
setRevealed((wasRevealed) => {
|
|
2475
|
+
if (wasRevealed) onDismissRef.current?.();
|
|
2476
|
+
return false;
|
|
2477
|
+
});
|
|
2478
|
+
}, []);
|
|
2479
|
+
const onPointerDown = useCallback(
|
|
2480
|
+
(e) => {
|
|
2481
|
+
if (!enabled || e.pointerType === "mouse") return;
|
|
2482
|
+
if (revealed) dismiss();
|
|
2483
|
+
else reveal();
|
|
2484
|
+
},
|
|
2485
|
+
[enabled, revealed, reveal, dismiss]
|
|
2486
|
+
);
|
|
2487
|
+
useEffect(() => {
|
|
2488
|
+
if (!revealed || typeof document === "undefined") return;
|
|
2489
|
+
const onDocDown = (ev) => {
|
|
2490
|
+
const target = ev.target;
|
|
2491
|
+
if (!(target instanceof Node)) return;
|
|
2492
|
+
const inside = (refs ?? []).some((r) => r.current?.contains(target));
|
|
2493
|
+
if (!inside) dismiss();
|
|
2494
|
+
};
|
|
2495
|
+
const id = setTimeout(() => document.addEventListener("pointerdown", onDocDown), 0);
|
|
2496
|
+
return () => {
|
|
2497
|
+
clearTimeout(id);
|
|
2498
|
+
document.removeEventListener("pointerdown", onDocDown);
|
|
2499
|
+
};
|
|
2500
|
+
}, [revealed, refs, dismiss]);
|
|
2501
|
+
return { revealed, triggerProps: { onPointerDown }, reveal, dismiss };
|
|
2502
|
+
}
|
|
2503
|
+
var ALMADAR_DND_MIME = "application/x-almadar-dnd";
|
|
2504
|
+
function useDraggable({ payload, disabled = false }) {
|
|
2505
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
2506
|
+
const eventBus = useEventBus();
|
|
2507
|
+
const handleDragStart = useCallback(
|
|
2508
|
+
(e) => {
|
|
2509
|
+
if (disabled) {
|
|
2510
|
+
e.preventDefault();
|
|
2511
|
+
return;
|
|
2512
|
+
}
|
|
2513
|
+
e.dataTransfer.setData(ALMADAR_DND_MIME, JSON.stringify(payload));
|
|
2514
|
+
e.dataTransfer.effectAllowed = "copy";
|
|
2515
|
+
setIsDragging(true);
|
|
2516
|
+
eventBus.emit("UI:DRAG_START", { kind: payload.kind, data: payload.data });
|
|
2517
|
+
},
|
|
2518
|
+
[disabled, payload, eventBus]
|
|
2519
|
+
);
|
|
2520
|
+
const handleDragEnd = useCallback(
|
|
2521
|
+
(e) => {
|
|
2522
|
+
setIsDragging(false);
|
|
2523
|
+
eventBus.emit("UI:DRAG_END", { kind: payload.kind, data: payload.data });
|
|
2524
|
+
},
|
|
2525
|
+
[payload, eventBus]
|
|
2526
|
+
);
|
|
2527
|
+
const dragProps = useMemo(
|
|
2528
|
+
() => ({
|
|
2529
|
+
draggable: !disabled,
|
|
2530
|
+
onDragStart: handleDragStart,
|
|
2531
|
+
onDragEnd: handleDragEnd,
|
|
2532
|
+
"aria-grabbed": isDragging
|
|
2533
|
+
}),
|
|
2534
|
+
[disabled, handleDragStart, handleDragEnd, isDragging]
|
|
2535
|
+
);
|
|
2536
|
+
return { dragProps, isDragging };
|
|
2537
|
+
}
|
|
2538
|
+
function parsePayload(e) {
|
|
2539
|
+
try {
|
|
2540
|
+
const raw = e.dataTransfer.getData(ALMADAR_DND_MIME);
|
|
2541
|
+
if (!raw) return null;
|
|
2542
|
+
const parsed = JSON.parse(raw);
|
|
2543
|
+
if (typeof parsed.kind !== "string" || !parsed.data) return null;
|
|
2544
|
+
return parsed;
|
|
2545
|
+
} catch {
|
|
2546
|
+
return null;
|
|
2547
|
+
}
|
|
2548
|
+
}
|
|
2549
|
+
function hasAlmadarPayload(e) {
|
|
2550
|
+
return e.dataTransfer.types.includes(ALMADAR_DND_MIME);
|
|
2551
|
+
}
|
|
2552
|
+
function useDropZone({ accepts, onDrop, disabled = false }) {
|
|
2553
|
+
const [isOver, setIsOver] = useState(false);
|
|
2554
|
+
const eventBus = useEventBus();
|
|
2555
|
+
const handleDragOver = useCallback(
|
|
2556
|
+
(e) => {
|
|
2557
|
+
if (disabled) return;
|
|
2558
|
+
if (!hasAlmadarPayload(e)) return;
|
|
2559
|
+
e.preventDefault();
|
|
2560
|
+
e.dataTransfer.dropEffect = "copy";
|
|
2561
|
+
setIsOver(true);
|
|
2562
|
+
},
|
|
2563
|
+
[disabled]
|
|
2564
|
+
);
|
|
2565
|
+
const handleDragLeave = useCallback(
|
|
2566
|
+
(e) => {
|
|
2567
|
+
setIsOver(false);
|
|
2568
|
+
},
|
|
2569
|
+
[]
|
|
2570
|
+
);
|
|
2571
|
+
const handleDrop = useCallback(
|
|
2572
|
+
(e) => {
|
|
2573
|
+
e.preventDefault();
|
|
2574
|
+
setIsOver(false);
|
|
2575
|
+
if (disabled) return;
|
|
2576
|
+
const payload = parsePayload(e);
|
|
2577
|
+
if (!payload) return;
|
|
2578
|
+
if (!accepts.includes(payload.kind)) return;
|
|
2579
|
+
const position = { x: e.clientX, y: e.clientY };
|
|
2580
|
+
onDrop(payload, position);
|
|
2581
|
+
eventBus.emit("UI:DROP", { kind: payload.kind, data: payload.data, ...position });
|
|
2582
|
+
},
|
|
2583
|
+
[disabled, accepts, onDrop, eventBus]
|
|
2584
|
+
);
|
|
2585
|
+
const dropProps = useMemo(
|
|
2586
|
+
() => ({
|
|
2587
|
+
onDragOver: handleDragOver,
|
|
2588
|
+
onDragLeave: handleDragLeave,
|
|
2589
|
+
onDrop: handleDrop
|
|
2590
|
+
}),
|
|
2591
|
+
[handleDragOver, handleDragLeave, handleDrop]
|
|
2592
|
+
);
|
|
2593
|
+
return { dropProps, isOver };
|
|
2594
|
+
}
|
|
2595
|
+
function useRenderInterpolation(options = {}) {
|
|
2596
|
+
const tickIntervalMs = options.tickIntervalMs ?? 1e3 / 30;
|
|
2597
|
+
const prevRef = useRef(null);
|
|
2598
|
+
const currRef = useRef(null);
|
|
2599
|
+
const rafRef = useRef(null);
|
|
2600
|
+
const onSnapshot = useCallback((entities) => {
|
|
2601
|
+
prevRef.current = currRef.current;
|
|
2602
|
+
currRef.current = { entities, arrivedAt: performance.now() };
|
|
2603
|
+
}, []);
|
|
2604
|
+
const getInterpolated = useCallback((now) => {
|
|
2605
|
+
const out = /* @__PURE__ */ new Map();
|
|
2606
|
+
const curr = currRef.current;
|
|
2607
|
+
if (!curr) return out;
|
|
2608
|
+
const prev = prevRef.current;
|
|
2609
|
+
if (!prev) {
|
|
2610
|
+
for (const e of curr.entities) out.set(e.id, { x: e.x, y: e.y });
|
|
2611
|
+
return out;
|
|
2612
|
+
}
|
|
2613
|
+
const rawAlpha = (now - curr.arrivedAt) / tickIntervalMs;
|
|
2614
|
+
const alpha = rawAlpha < 0 ? 0 : rawAlpha > 1 ? 1 : rawAlpha;
|
|
2615
|
+
const prevMap = /* @__PURE__ */ new Map();
|
|
2616
|
+
for (const e of prev.entities) prevMap.set(e.id, e);
|
|
2617
|
+
for (const c of curr.entities) {
|
|
2618
|
+
const p = prevMap.get(c.id);
|
|
2619
|
+
if (!p) {
|
|
2620
|
+
out.set(c.id, { x: c.x, y: c.y });
|
|
2621
|
+
} else {
|
|
2622
|
+
out.set(c.id, {
|
|
2623
|
+
x: p.x + (c.x - p.x) * alpha,
|
|
2624
|
+
y: p.y + (c.y - p.y) * alpha
|
|
2625
|
+
});
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2628
|
+
return out;
|
|
2629
|
+
}, [tickIntervalMs]);
|
|
2630
|
+
const startLoop = useCallback(
|
|
2631
|
+
(draw) => {
|
|
2632
|
+
let active = true;
|
|
2633
|
+
const loop = () => {
|
|
2634
|
+
if (!active) return;
|
|
2635
|
+
try {
|
|
2636
|
+
draw(getInterpolated(performance.now()));
|
|
2637
|
+
} catch {
|
|
2638
|
+
}
|
|
2639
|
+
rafRef.current = requestAnimationFrame(loop);
|
|
2640
|
+
};
|
|
2641
|
+
rafRef.current = requestAnimationFrame(loop);
|
|
2642
|
+
return () => {
|
|
2643
|
+
active = false;
|
|
2644
|
+
if (rafRef.current !== null) {
|
|
2645
|
+
cancelAnimationFrame(rafRef.current);
|
|
2646
|
+
rafRef.current = null;
|
|
2647
|
+
}
|
|
2648
|
+
};
|
|
2649
|
+
},
|
|
2650
|
+
[getInterpolated]
|
|
2651
|
+
);
|
|
2652
|
+
useEffect(() => {
|
|
2653
|
+
return () => {
|
|
2654
|
+
if (rafRef.current !== null) {
|
|
2655
|
+
cancelAnimationFrame(rafRef.current);
|
|
2656
|
+
rafRef.current = null;
|
|
2657
|
+
}
|
|
2658
|
+
};
|
|
2659
|
+
}, []);
|
|
2660
|
+
return { onSnapshot, getInterpolated, startLoop };
|
|
2661
|
+
}
|
|
2662
|
+
var API_BASE = typeof process !== "undefined" && process.env?.VITE_API_URL ? process.env.VITE_API_URL : "http://localhost:3000";
|
|
2663
|
+
function getUserId() {
|
|
2664
|
+
return localStorage.getItem("userId") || "anonymous";
|
|
2665
|
+
}
|
|
2666
|
+
async function fetchWithAuth(endpoint, options) {
|
|
2667
|
+
const userId = getUserId();
|
|
2668
|
+
const response = await fetch(`${API_BASE}${endpoint}`, {
|
|
2669
|
+
...options,
|
|
2670
|
+
headers: {
|
|
2671
|
+
"Content-Type": "application/json",
|
|
2672
|
+
"x-user-id": userId,
|
|
2673
|
+
...options?.headers
|
|
2674
|
+
}
|
|
2675
|
+
});
|
|
2676
|
+
if (!response.ok) {
|
|
2677
|
+
const error = await response.json().catch(() => ({ error: response.statusText }));
|
|
2678
|
+
throw new Error(error.error || error.message || "Request failed");
|
|
2679
|
+
}
|
|
2680
|
+
return response.json();
|
|
2681
|
+
}
|
|
2682
|
+
function useGitHubStatus() {
|
|
2683
|
+
return useQuery({
|
|
2684
|
+
queryKey: ["github", "status"],
|
|
2685
|
+
queryFn: () => fetchWithAuth("/api/github/status"),
|
|
2686
|
+
staleTime: 6e4,
|
|
2687
|
+
// 1 minute
|
|
2688
|
+
retry: false
|
|
2689
|
+
});
|
|
2690
|
+
}
|
|
2691
|
+
function useConnectGitHub() {
|
|
2692
|
+
const connectGitHub = useCallback(() => {
|
|
2693
|
+
const userId = getUserId();
|
|
2694
|
+
const state = btoa(JSON.stringify({ userId, returnUrl: window.location.href }));
|
|
2695
|
+
window.location.href = `${API_BASE}/api/github/oauth/authorize?state=${state}`;
|
|
2696
|
+
}, []);
|
|
2697
|
+
return { connectGitHub };
|
|
2698
|
+
}
|
|
2699
|
+
function useDisconnectGitHub() {
|
|
2700
|
+
const queryClient = useQueryClient();
|
|
2701
|
+
return useMutation({
|
|
2702
|
+
mutationFn: () => fetchWithAuth("/api/github/disconnect", { method: "POST" }),
|
|
2703
|
+
onSuccess: () => {
|
|
2704
|
+
queryClient.invalidateQueries({ queryKey: ["github", "status"] });
|
|
2705
|
+
queryClient.removeQueries({ queryKey: ["github", "repos"] });
|
|
2706
|
+
}
|
|
2707
|
+
});
|
|
2708
|
+
}
|
|
2709
|
+
function useGitHubRepos(page = 1, perPage = 30) {
|
|
2710
|
+
return useQuery({
|
|
2711
|
+
queryKey: ["github", "repos", page, perPage],
|
|
2712
|
+
queryFn: () => fetchWithAuth(`/api/github/repos?page=${page}&per_page=${perPage}`),
|
|
2713
|
+
enabled: true,
|
|
2714
|
+
// Only fetch if user is connected
|
|
2715
|
+
staleTime: 3e5
|
|
2716
|
+
// 5 minutes
|
|
2717
|
+
});
|
|
2718
|
+
}
|
|
2719
|
+
function useGitHubRepo(owner, repo, enabled = true) {
|
|
2720
|
+
return useQuery({
|
|
2721
|
+
queryKey: ["github", "repo", owner, repo],
|
|
2722
|
+
queryFn: () => fetchWithAuth(`/api/github/repos/${owner}/${repo}`),
|
|
2723
|
+
enabled: enabled && !!owner && !!repo,
|
|
2724
|
+
staleTime: 3e5
|
|
2725
|
+
// 5 minutes
|
|
2726
|
+
});
|
|
2727
|
+
}
|
|
2728
|
+
function useGitHubBranches(owner, repo, enabled = true) {
|
|
2729
|
+
return useQuery({
|
|
2730
|
+
queryKey: ["github", "branches", owner, repo],
|
|
2731
|
+
queryFn: () => fetchWithAuth(`/api/github/repos/${owner}/${repo}/branches`),
|
|
2732
|
+
enabled: enabled && !!owner && !!repo,
|
|
2733
|
+
staleTime: 6e4
|
|
2734
|
+
// 1 minute
|
|
2735
|
+
});
|
|
2736
|
+
}
|
|
2737
|
+
|
|
2738
|
+
export { ALMADAR_DND_MIME, DEFAULT_SLOTS, I18nProvider, createTranslate, parseQueryBinding, useAgentChat, useAuthContext, useCanvasGestures, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useEmitEvent, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useInfiniteScroll, useLongPress, useOrbitalHistory, usePreview, usePullToRefresh, useQuerySingleton, useRenderInterpolation, useSwipeGesture, useTapReveal, useTraitListens, useTranslate, useUIEvents, useUISlotManager, useValidation };
|