@elizaos/app-core 2.0.0-alpha.74 → 2.0.0-alpha.76
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/App.d.ts.map +1 -0
- package/{dist/App.js → App.js} +3 -3
- package/{dist/components → components}/AdvancedPageView.d.ts.map +1 -1
- package/{dist/components → components}/AdvancedPageView.js +0 -10
- package/{dist/components → components}/CharacterView.d.ts.map +1 -1
- package/components/CharacterView.js +685 -0
- package/{dist/components → components}/ChatComposer.d.ts.map +1 -1
- package/{dist/components → components}/ChatComposer.js +4 -4
- package/{dist/components → components}/ChatView.d.ts.map +1 -1
- package/{dist/components → components}/ChatView.js +15 -0
- package/{dist/components → components}/CompanionView.js +1 -1
- package/{dist/components → components}/ConfigPageView.js +1 -1
- package/{dist/components → components}/ElizaCloudDashboard.js +1 -1
- package/{dist/components → components}/FlaminaGuide.js +1 -1
- package/{dist/components → components}/OnboardingWizard.d.ts.map +1 -1
- package/{dist/components → components}/OnboardingWizard.js +3 -2
- package/{dist/components → components}/PluginsView.d.ts.map +1 -1
- package/{dist/components → components}/PluginsView.js +1 -5
- package/{dist/components → components}/avatar/VrmEngine.d.ts +13 -0
- package/{dist/components → components}/avatar/VrmEngine.d.ts.map +1 -1
- package/{dist/components → components}/avatar/VrmEngine.js +66 -0
- package/{dist/components → components}/avatar/VrmViewer.d.ts +15 -0
- package/{dist/components → components}/avatar/VrmViewer.d.ts.map +1 -1
- package/{dist/components → components}/avatar/VrmViewer.js +56 -1
- package/{src/components/index.ts → components/index.d.ts} +1 -1
- package/{dist/components → components}/index.d.ts.map +1 -1
- package/{dist/components → components}/index.js +0 -1
- package/{dist/components → components}/onboarding/ConnectionStep.d.ts.map +1 -1
- package/{dist/components → components}/onboarding/ConnectionStep.js +12 -7
- package/{dist/components → components}/permissions/StreamingPermissions.d.ts.map +1 -1
- package/{dist/components → components}/permissions/StreamingPermissions.js +1 -1
- package/{dist/components → components}/ui-switch.js +4 -4
- package/{dist/i18n → i18n}/locales/en.json +45 -1
- package/{src/i18n → i18n}/locales/es.json +41 -0
- package/{dist/i18n → i18n}/locales/ko.json +41 -0
- package/{dist/i18n → i18n}/locales/pt.json +41 -0
- package/{dist/i18n → i18n}/locales/zh-CN.json +41 -0
- package/package.json +143 -53
- package/{dist/state → state}/AppContext.d.ts.map +1 -1
- package/{dist/state → state}/AppContext.js +38 -16
- package/{dist/styles → styles}/anime.css +1 -4
- package/{dist/styles → styles}/onboarding-game.css +125 -9
- package/.turbo/turbo-build.log +0 -2
- package/.turbo/turbo-lint$colon$check.log +0 -2
- package/.turbo/turbo-typecheck.log +0 -1
- package/dist/App.d.ts.map +0 -1
- package/dist/components/CharacterView.js +0 -719
- package/dist/components/MiladyBar.d.ts +0 -2
- package/dist/components/MiladyBar.d.ts.map +0 -1
- package/dist/components/MiladyBar.js +0 -50
- package/dist/components/MiladyBarSettings.d.ts +0 -2
- package/dist/components/MiladyBarSettings.d.ts.map +0 -1
- package/dist/components/MiladyBarSettings.js +0 -513
- package/dist/components/SecurityPageView.d.ts +0 -2
- package/dist/components/SecurityPageView.d.ts.map +0 -1
- package/dist/components/SecurityPageView.js +0 -81
- package/dist/components/index.d.ts +0 -97
- package/dist/components/milady-bar/CloudCreditsChip.d.ts +0 -2
- package/dist/components/milady-bar/CloudCreditsChip.d.ts.map +0 -1
- package/dist/components/milady-bar/CloudCreditsChip.js +0 -25
- package/dist/components/milady-bar/ProviderDropdown.d.ts +0 -13
- package/dist/components/milady-bar/ProviderDropdown.d.ts.map +0 -1
- package/dist/components/milady-bar/ProviderDropdown.js +0 -68
- package/dist/components/milady-bar/WalletSummary.d.ts +0 -2
- package/dist/components/milady-bar/WalletSummary.d.ts.map +0 -1
- package/dist/components/milady-bar/WalletSummary.js +0 -37
- package/dist/components/milady-bar/index.d.ts +0 -4
- package/dist/components/milady-bar/index.d.ts.map +0 -1
- package/dist/components/milady-bar/index.js +0 -3
- package/dist/hooks/useMiladyBar.d.ts +0 -2
- package/dist/hooks/useMiladyBar.d.ts.map +0 -1
- package/dist/hooks/useMiladyBar.js +0 -472
- package/dist/i18n/locales/es.json +0 -1195
- package/dist/package.json +0 -180
- package/src/App.tsx +0 -504
- package/src/actions/character.test.ts +0 -139
- package/src/actions/character.ts +0 -334
- package/src/actions/chat-helpers.ts +0 -100
- package/src/actions/cloud.ts +0 -59
- package/src/actions/index.ts +0 -12
- package/src/actions/lifecycle.ts +0 -175
- package/src/actions/onboarding.ts +0 -38
- package/src/actions/triggers.ts +0 -190
- package/src/ambient.d.ts +0 -33
- package/src/api/client.ts +0 -5659
- package/src/api/index.ts +0 -1
- package/src/autonomy/index.ts +0 -477
- package/src/bridge/capacitor-bridge.ts +0 -295
- package/src/bridge/electrobun-rpc.ts +0 -78
- package/src/bridge/electrobun-runtime.ts +0 -28
- package/src/bridge/index.ts +0 -5
- package/src/bridge/native-plugins.ts +0 -138
- package/src/bridge/plugin-bridge.ts +0 -352
- package/src/bridge/storage-bridge.ts +0 -162
- package/src/chat/index.ts +0 -250
- package/src/coding/index.ts +0 -43
- package/src/components/AdvancedPageView.tsx +0 -382
- package/src/components/AgentActivityBox.tsx +0 -49
- package/src/components/ApiKeyConfig.tsx +0 -222
- package/src/components/AppsPageView.tsx +0 -52
- package/src/components/AppsView.tsx +0 -293
- package/src/components/AvatarLoader.tsx +0 -104
- package/src/components/AvatarSelector.tsx +0 -223
- package/src/components/BscTradePanel.tsx +0 -549
- package/src/components/BugReportModal.tsx +0 -499
- package/src/components/CharacterRoster.tsx +0 -143
- package/src/components/CharacterView.tsx +0 -1575
- package/src/components/ChatAvatar.test.ts +0 -97
- package/src/components/ChatAvatar.tsx +0 -147
- package/src/components/ChatComposer.tsx +0 -330
- package/src/components/ChatMessage.tsx +0 -448
- package/src/components/ChatModalView.test.tsx +0 -118
- package/src/components/ChatModalView.tsx +0 -125
- package/src/components/ChatView.tsx +0 -992
- package/src/components/CloudOnboarding.tsx +0 -81
- package/src/components/CloudSourceControls.tsx +0 -85
- package/src/components/CodingAgentSettingsSection.tsx +0 -537
- package/src/components/CommandPalette.tsx +0 -284
- package/src/components/CompanionSceneHost.tsx +0 -517
- package/src/components/CompanionShell.tsx +0 -31
- package/src/components/CompanionView.tsx +0 -110
- package/src/components/ConfigPageView.tsx +0 -763
- package/src/components/ConfigSaveFooter.tsx +0 -41
- package/src/components/ConfirmModal.tsx +0 -379
- package/src/components/ConnectionFailedBanner.tsx +0 -91
- package/src/components/ConnectorsPageView.tsx +0 -13
- package/src/components/ConversationsSidebar.tsx +0 -279
- package/src/components/CustomActionEditor.tsx +0 -1127
- package/src/components/CustomActionsPanel.tsx +0 -288
- package/src/components/CustomActionsView.tsx +0 -325
- package/src/components/DatabasePageView.tsx +0 -55
- package/src/components/DatabaseView.tsx +0 -814
- package/src/components/ElizaCloudDashboard.tsx +0 -1696
- package/src/components/EmotePicker.tsx +0 -529
- package/src/components/ErrorBoundary.tsx +0 -76
- package/src/components/FineTuningView.tsx +0 -1080
- package/src/components/FlaminaGuide.test.tsx +0 -61
- package/src/components/FlaminaGuide.tsx +0 -212
- package/src/components/GameView.tsx +0 -551
- package/src/components/GameViewOverlay.tsx +0 -133
- package/src/components/GlobalEmoteOverlay.tsx +0 -152
- package/src/components/Header.test.tsx +0 -413
- package/src/components/Header.tsx +0 -400
- package/src/components/HeartbeatsView.tsx +0 -1003
- package/src/components/InventoryView.tsx +0 -393
- package/src/components/KnowledgeView.tsx +0 -1128
- package/src/components/LanguageDropdown.tsx +0 -192
- package/src/components/LifoMonitorPanel.tsx +0 -196
- package/src/components/LifoSandboxView.tsx +0 -499
- package/src/components/LoadingScreen.tsx +0 -112
- package/src/components/LogsPageView.tsx +0 -17
- package/src/components/LogsView.tsx +0 -239
- package/src/components/MediaGalleryView.tsx +0 -431
- package/src/components/MediaSettingsSection.tsx +0 -893
- package/src/components/MessageContent.tsx +0 -815
- package/src/components/MiladyBar.tsx +0 -103
- package/src/components/MiladyBarSettings.tsx +0 -872
- package/src/components/OnboardingWizard.test.tsx +0 -104
- package/src/components/OnboardingWizard.tsx +0 -249
- package/src/components/PairingView.tsx +0 -109
- package/src/components/PermissionsSection.tsx +0 -1184
- package/src/components/PluginsPageView.tsx +0 -9
- package/src/components/PluginsView.tsx +0 -3129
- package/src/components/ProviderSwitcher.tsx +0 -903
- package/src/components/RestartBanner.tsx +0 -76
- package/src/components/RuntimeView.tsx +0 -460
- package/src/components/SaveCommandModal.tsx +0 -211
- package/src/components/SecretsView.tsx +0 -569
- package/src/components/SecurityPageView.tsx +0 -242
- package/src/components/SettingsView.tsx +0 -825
- package/src/components/ShellOverlays.tsx +0 -41
- package/src/components/ShortcutsOverlay.tsx +0 -155
- package/src/components/SkillsView.tsx +0 -1435
- package/src/components/StartupFailureView.tsx +0 -63
- package/src/components/StreamView.tsx +0 -481
- package/src/components/StripeEmbeddedCheckout.tsx +0 -155
- package/src/components/SubscriptionStatus.tsx +0 -640
- package/src/components/SystemWarningBanner.tsx +0 -71
- package/src/components/ThemeToggle.tsx +0 -103
- package/src/components/TrajectoriesView.tsx +0 -526
- package/src/components/TrajectoryDetailView.tsx +0 -426
- package/src/components/TriggersView.tsx +0 -1
- package/src/components/VectorBrowserView.tsx +0 -1633
- package/src/components/VoiceConfigView.tsx +0 -674
- package/src/components/VrmStage.test.ts +0 -176
- package/src/components/VrmStage.tsx +0 -309
- package/src/components/WhatsAppQrOverlay.tsx +0 -230
- package/src/components/__tests__/chainConfig.test.ts +0 -220
- package/src/components/apps/AppDetailPane.tsx +0 -242
- package/src/components/apps/AppsCatalogGrid.tsx +0 -137
- package/src/components/apps/extensions/registry.ts +0 -13
- package/src/components/apps/extensions/types.ts +0 -9
- package/src/components/apps/helpers.ts +0 -43
- package/src/components/avatar/VrmAnimationLoader.test.ts +0 -164
- package/src/components/avatar/VrmAnimationLoader.ts +0 -151
- package/src/components/avatar/VrmBlinkController.ts +0 -118
- package/src/components/avatar/VrmCameraManager.ts +0 -407
- package/src/components/avatar/VrmEngine.ts +0 -2767
- package/src/components/avatar/VrmFootShadow.ts +0 -96
- package/src/components/avatar/VrmViewer.tsx +0 -421
- package/src/components/avatar/__tests__/VrmCameraManager.test.ts +0 -168
- package/src/components/avatar/__tests__/VrmEngine.test.ts +0 -1574
- package/src/components/avatar/mixamoVRMRigMap.ts +0 -62
- package/src/components/avatar/retargetMixamoFbxToVrm.ts +0 -144
- package/src/components/avatar/retargetMixamoGltfToVrm.ts +0 -119
- package/src/components/chainConfig.ts +0 -400
- package/src/components/companion/CompanionHeader.tsx +0 -50
- package/src/components/companion/CompanionSceneHost.tsx +0 -5
- package/src/components/companion/VrmStage.tsx +0 -2
- package/src/components/companion/__tests__/walletUtils.test.ts +0 -742
- package/src/components/companion/index.ts +0 -18
- package/src/components/companion/walletUtils.ts +0 -290
- package/src/components/companion-shell-styles.test.ts +0 -142
- package/src/components/companion-shell-styles.ts +0 -270
- package/src/components/confirm-delete-control.tsx +0 -69
- package/src/components/conversations/ConversationListItem.tsx +0 -185
- package/src/components/conversations/conversation-utils.ts +0 -151
- package/src/components/format.ts +0 -131
- package/src/components/inventory/CopyableAddress.tsx +0 -41
- package/src/components/inventory/InventoryToolbar.tsx +0 -142
- package/src/components/inventory/NftGrid.tsx +0 -99
- package/src/components/inventory/TokenLogo.tsx +0 -71
- package/src/components/inventory/TokensTable.tsx +0 -216
- package/src/components/inventory/constants.ts +0 -170
- package/src/components/inventory/index.ts +0 -29
- package/src/components/inventory/media-url.test.ts +0 -38
- package/src/components/inventory/media-url.ts +0 -36
- package/src/components/inventory/useInventoryData.ts +0 -460
- package/src/components/knowledge-upload-image.ts +0 -215
- package/src/components/labels.ts +0 -46
- package/src/components/milady-bar/CloudCreditsChip.tsx +0 -61
- package/src/components/milady-bar/ProviderDropdown.tsx +0 -166
- package/src/components/milady-bar/WalletSummary.tsx +0 -61
- package/src/components/milady-bar/index.ts +0 -3
- package/src/components/onboarding/ActivateStep.tsx +0 -34
- package/src/components/onboarding/ConnectionStep.tsx +0 -1590
- package/src/components/onboarding/IdentityStep.tsx +0 -251
- package/src/components/onboarding/OnboardingPanel.tsx +0 -39
- package/src/components/onboarding/OnboardingStepNav.tsx +0 -41
- package/src/components/onboarding/PermissionsStep.tsx +0 -20
- package/src/components/onboarding/RpcStep.tsx +0 -402
- package/src/components/permissions/PermissionIcon.tsx +0 -25
- package/src/components/permissions/StreamingPermissions.tsx +0 -413
- package/src/components/plugins/showcase-data.ts +0 -481
- package/src/components/shared/ShellHeaderControls.tsx +0 -198
- package/src/components/shared-companion-scene-context.ts +0 -15
- package/src/components/skeletons.tsx +0 -88
- package/src/components/stream/ActivityFeed.tsx +0 -113
- package/src/components/stream/AvatarPip.tsx +0 -10
- package/src/components/stream/ChatContent.tsx +0 -126
- package/src/components/stream/ChatTicker.tsx +0 -55
- package/src/components/stream/IdleContent.tsx +0 -73
- package/src/components/stream/StatusBar.tsx +0 -463
- package/src/components/stream/StreamSettings.tsx +0 -506
- package/src/components/stream/StreamTerminal.tsx +0 -94
- package/src/components/stream/StreamVoiceConfig.tsx +0 -160
- package/src/components/stream/helpers.ts +0 -134
- package/src/components/stream/overlays/OverlayLayer.tsx +0 -75
- package/src/components/stream/overlays/built-in/ActionTickerWidget.tsx +0 -64
- package/src/components/stream/overlays/built-in/AlertPopupWidget.tsx +0 -87
- package/src/components/stream/overlays/built-in/BrandingWidget.tsx +0 -51
- package/src/components/stream/overlays/built-in/CustomHtmlWidget.tsx +0 -105
- package/src/components/stream/overlays/built-in/PeonGlassWidget.tsx +0 -265
- package/src/components/stream/overlays/built-in/PeonHudWidget.tsx +0 -247
- package/src/components/stream/overlays/built-in/PeonSakuraWidget.tsx +0 -278
- package/src/components/stream/overlays/built-in/ThoughtBubbleWidget.tsx +0 -77
- package/src/components/stream/overlays/built-in/ViewerCountWidget.tsx +0 -46
- package/src/components/stream/overlays/built-in/index.ts +0 -13
- package/src/components/stream/overlays/registry.ts +0 -22
- package/src/components/stream/overlays/types.ts +0 -90
- package/src/components/stream/overlays/useOverlayLayout.ts +0 -218
- package/src/components/trajectory-format.ts +0 -50
- package/src/components/ui-badges.tsx +0 -109
- package/src/components/ui-switch.tsx +0 -57
- package/src/components/vector-browser-three.ts +0 -29
- package/src/config/branding.ts +0 -67
- package/src/config/config-catalog.ts +0 -1092
- package/src/config/config-field.tsx +0 -1924
- package/src/config/config-renderer.tsx +0 -734
- package/src/config/index.ts +0 -12
- package/src/config/ui-renderer.tsx +0 -1751
- package/src/config/ui-spec.ts +0 -256
- package/src/events/index.ts +0 -96
- package/src/hooks/index.ts +0 -14
- package/src/hooks/useBugReport.tsx +0 -43
- package/src/hooks/useCanvasWindow.ts +0 -372
- package/src/hooks/useChatAvatarVoice.ts +0 -111
- package/src/hooks/useClickOutside.ts +0 -31
- package/src/hooks/useContextMenu.ts +0 -127
- package/src/hooks/useKeyboardShortcuts.ts +0 -86
- package/src/hooks/useLifoSync.ts +0 -143
- package/src/hooks/useMemoryMonitor.ts +0 -334
- package/src/hooks/useMiladyBar.ts +0 -594
- package/src/hooks/useRenderGuard.ts +0 -43
- package/src/hooks/useRetakeCapture.ts +0 -68
- package/src/hooks/useStreamPopoutNavigation.ts +0 -27
- package/src/hooks/useTimeout.ts +0 -37
- package/src/hooks/useVoiceChat.ts +0 -1442
- package/src/hooks/useWhatsAppPairing.ts +0 -123
- package/src/i18n/index.ts +0 -76
- package/src/i18n/locales/en.json +0 -1195
- package/src/i18n/locales/ko.json +0 -1195
- package/src/i18n/locales/pt.json +0 -1195
- package/src/i18n/locales/zh-CN.json +0 -1195
- package/src/i18n/messages.ts +0 -21
- package/src/index.ts +0 -6
- package/src/navigation/index.ts +0 -286
- package/src/navigation.test.ts +0 -189
- package/src/onboarding-config.test.ts +0 -104
- package/src/onboarding-config.ts +0 -122
- package/src/platform/browser-launch.test.ts +0 -94
- package/src/platform/browser-launch.ts +0 -149
- package/src/platform/index.ts +0 -58
- package/src/platform/init.ts +0 -238
- package/src/platform/lifo.ts +0 -225
- package/src/providers/index.ts +0 -108
- package/src/shell-params.test.ts +0 -48
- package/src/shell-params.ts +0 -36
- package/src/state/AppContext.tsx +0 -6415
- package/src/state/index.ts +0 -6
- package/src/state/internal.ts +0 -91
- package/src/state/onboarding-resume.test.ts +0 -135
- package/src/state/onboarding-resume.ts +0 -263
- package/src/state/parsers.test.ts +0 -124
- package/src/state/parsers.ts +0 -309
- package/src/state/persistence.ts +0 -379
- package/src/state/shell-routing.ts +0 -39
- package/src/state/types.ts +0 -724
- package/src/state/ui-preferences.ts +0 -3
- package/src/state/useApp.ts +0 -23
- package/src/state/vrm.ts +0 -108
- package/src/styles/anime.css +0 -6324
- package/src/styles/base.css +0 -213
- package/src/styles/onboarding-game.css +0 -976
- package/src/styles/styles.css +0 -2087
- package/src/styles/xterm.css +0 -241
- package/src/types/index.ts +0 -715
- package/src/types/react-test-renderer.d.ts +0 -45
- package/src/utils/asset-url.ts +0 -110
- package/src/utils/assistant-text.ts +0 -172
- package/src/utils/clipboard.ts +0 -41
- package/src/utils/desktop-dialogs.ts +0 -80
- package/src/utils/eliza-globals.ts +0 -44
- package/src/utils/index.ts +0 -7
- package/src/utils/number-parsing.ts +0 -125
- package/src/utils/openExternalUrl.ts +0 -20
- package/src/utils/spoken-text.ts +0 -65
- package/src/utils/streaming-text.ts +0 -120
- package/src/voice/index.ts +0 -1
- package/src/voice/types.ts +0 -197
- package/src/wallet-rpc.ts +0 -176
- package/test/app/AppContext.pty-sessions.test.tsx +0 -143
- package/test/app/MessageContent.test.tsx +0 -366
- package/test/app/PermissionsOnboarding.test.tsx +0 -358
- package/test/app/PermissionsSection.test.tsx +0 -575
- package/test/app/advanced-trajectory-fine-tuning.e2e.test.ts +0 -396
- package/test/app/agent-activity-box.test.tsx +0 -132
- package/test/app/agent-transfer-lock.test.ts +0 -279
- package/test/app/api-client-electrobun-fallback.test.ts +0 -139
- package/test/app/api-client-electron-fallback.test.ts +0 -139
- package/test/app/api-client-timeout.test.ts +0 -75
- package/test/app/api-client-ws.test.ts +0 -98
- package/test/app/api-client.ws-max-reconnect.test.ts +0 -139
- package/test/app/api-client.ws-reconnect.test.ts +0 -157
- package/test/app/app-context-autonomy-events.test.ts +0 -559
- package/test/app/apps-page-view.test.ts +0 -114
- package/test/app/apps-view.test.ts +0 -768
- package/test/app/autonomous-workflows.e2e.test.ts +0 -765
- package/test/app/autonomy-events.test.ts +0 -150
- package/test/app/avatar-selector.test.tsx +0 -52
- package/test/app/bsc-trade-panel.test.tsx +0 -134
- package/test/app/bug-report-modal.test.tsx +0 -353
- package/test/app/character-action-bar-visibility.test.ts +0 -70
- package/test/app/character-customization.e2e.test.ts +0 -1384
- package/test/app/character-save-journey.test.ts +0 -1245
- package/test/app/chat-advanced-features.e2e.test.ts +0 -706
- package/test/app/chat-composer.test.tsx +0 -181
- package/test/app/chat-journey.test.ts +0 -1075
- package/test/app/chat-language-header.test.ts +0 -64
- package/test/app/chat-message.test.tsx +0 -222
- package/test/app/chat-modal-view.test.tsx +0 -191
- package/test/app/chat-routine-filter.test.ts +0 -96
- package/test/app/chat-send-lock.test.ts +0 -1465
- package/test/app/chat-stream-api-client.test.tsx +0 -390
- package/test/app/chat-view-game-modal.test.tsx +0 -661
- package/test/app/chat-view.test.tsx +0 -877
- package/test/app/cloud-api.e2e.test.ts +0 -258
- package/test/app/cloud-login-flow.e2e.test.ts +0 -494
- package/test/app/cloud-login-lock.test.ts +0 -416
- package/test/app/command-palette.test.tsx +0 -184
- package/test/app/command-registry.test.ts +0 -75
- package/test/app/companion-greeting-wave.test.tsx +0 -431
- package/test/app/companion-scene-host.test.tsx +0 -85
- package/test/app/companion-stale-conversation.test.tsx +0 -447
- package/test/app/companion-view.test.tsx +0 -690
- package/test/app/confirm-delete-control.test.ts +0 -79
- package/test/app/confirm-modal.test.tsx +0 -219
- package/test/app/connection-mode-persistence.test.ts +0 -411
- package/test/app/connectors-ui.e2e.test.ts +0 -508
- package/test/app/conversations-sidebar-game-modal.test.tsx +0 -265
- package/test/app/conversations-sidebar.test.tsx +0 -185
- package/test/app/custom-actions-smoke.test.ts +0 -387
- package/test/app/custom-avatar-api-client.test.ts +0 -207
- package/test/app/desktop-utils.test.ts +0 -145
- package/test/app/electrobun-rpc-bridge.test.ts +0 -83
- package/test/app/events.test.ts +0 -88
- package/test/app/export-import-flows.e2e.test.ts +0 -700
- package/test/app/fine-tuning-view.test.ts +0 -471
- package/test/app/game-view-auth-session.test.tsx +0 -187
- package/test/app/game-view.test.ts +0 -444
- package/test/app/global-emote-overlay.test.tsx +0 -106
- package/test/app/header-status.test.tsx +0 -149
- package/test/app/i18n.test.ts +0 -152
- package/test/app/inventory-bsc-view.test.ts +0 -940
- package/test/app/knowledge-ui.e2e.test.ts +0 -762
- package/test/app/knowledge-upload-helpers.test.ts +0 -124
- package/test/app/lifecycle-lock.test.ts +0 -267
- package/test/app/lifo-popout-utils.test.ts +0 -208
- package/test/app/lifo-safe-endpoint.test.ts +0 -34
- package/test/app/loading-screen.test.tsx +0 -45
- package/test/app/memory-monitor.test.ts +0 -331
- package/test/app/milady-bar-regression.test.tsx +0 -519
- package/test/app/milady-bar-settings.test.tsx +0 -1056
- package/test/app/milady-bar.test.tsx +0 -583
- package/test/app/navigation.test.tsx +0 -22
- package/test/app/onboarding-e2e-journey.test.ts +0 -1391
- package/test/app/onboarding-finish-lock.test.ts +0 -676
- package/test/app/onboarding-language.test.tsx +0 -160
- package/test/app/onboarding-steps.test.tsx +0 -376
- package/test/app/open-external-url.test.ts +0 -65
- package/test/app/pages-navigation-smoke.e2e.test.ts +0 -646
- package/test/app/pairing-lock.test.ts +0 -260
- package/test/app/pairing-view.test.tsx +0 -74
- package/test/app/permissions-section.test.ts +0 -432
- package/test/app/plugin-bridge.test.ts +0 -109
- package/test/app/plugins-ui.e2e.test.ts +0 -605
- package/test/app/plugins-view-game-modal.test.tsx +0 -686
- package/test/app/plugins-view-toggle-restart.test.ts +0 -129
- package/test/app/provider-dropdown-default.test.tsx +0 -300
- package/test/app/restart-banner.test.tsx +0 -205
- package/test/app/retake-capture.test.ts +0 -84
- package/test/app/sandbox-api-client.test.ts +0 -108
- package/test/app/save-command-modal.test.tsx +0 -109
- package/test/app/secrets-view.test.tsx +0 -92
- package/test/app/settings-control-styles.test.tsx +0 -142
- package/test/app/settings-reset.e2e.test.ts +0 -726
- package/test/app/settings-sections.e2e.test.ts +0 -614
- package/test/app/shared-format.test.ts +0 -44
- package/test/app/shared-switch.test.ts +0 -69
- package/test/app/shell-mode-switching.e2e.test.ts +0 -841
- package/test/app/shell-mode-tab-memory.test.tsx +0 -58
- package/test/app/shell-overlays.test.tsx +0 -50
- package/test/app/shortcuts-overlay.test.tsx +0 -111
- package/test/app/sse-interruption.test.ts +0 -122
- package/test/app/startup-asset-missing.e2e.test.ts +0 -126
- package/test/app/startup-backend-missing.e2e.test.ts +0 -126
- package/test/app/startup-chat.e2e.test.ts +0 -323
- package/test/app/startup-conversation-restore.test.tsx +0 -381
- package/test/app/startup-failure-view.test.tsx +0 -103
- package/test/app/startup-onboarding.e2e.test.ts +0 -712
- package/test/app/startup-timeout.test.tsx +0 -80
- package/test/app/startup-token-401.e2e.test.ts +0 -103
- package/test/app/stream-helpers.test.ts +0 -46
- package/test/app/stream-popout-navigation.test.tsx +0 -41
- package/test/app/stream-status-bar.test.tsx +0 -89
- package/test/app/theme-toggle.test.tsx +0 -40
- package/test/app/training-api-client.test.ts +0 -128
- package/test/app/trajectories-view.test.tsx +0 -220
- package/test/app/triggers-api-client.test.ts +0 -77
- package/test/app/triggers-navigation.test.ts +0 -113
- package/test/app/triggers-view.e2e.test.ts +0 -675
- package/test/app/update-channel-lock.test.ts +0 -259
- package/test/app/vector-browser.async-cleanup.test.tsx +0 -367
- package/test/app/vector-browser.e2e.test.ts +0 -653
- package/test/app/vrm-stage.test.tsx +0 -351
- package/test/app/vrm-viewer.test.tsx +0 -298
- package/test/app/wallet-api-save-lock.test.ts +0 -299
- package/test/app/wallet-hooks.test.ts +0 -405
- package/test/app/wallet-ui-flows.e2e.test.ts +0 -556
- package/test/avatar/asset-url.test.ts +0 -90
- package/test/avatar/avatar-selector.test.ts +0 -173
- package/test/avatar/mixamo-vrm-rig-map.test.ts +0 -111
- package/test/avatar/voice-chat-streaming-text.test.ts +0 -96
- package/test/avatar/voice-chat.test.ts +0 -391
- package/test/browser-extension/README.md +0 -138
- package/test/browser-extension/test-harness.ts +0 -499
- package/test/capacitor-plugins.e2e.test.ts +0 -168
- package/test/test-types.ts +0 -5
- package/test/ui/command-palette-commands.test.ts +0 -57
- package/test/ui/ui-renderer.test.ts +0 -39
- package/test/utils/assistant-text.test.ts +0 -68
- package/test/utils/eliza-globals.test.ts +0 -59
- package/test/utils/package-exports.test.ts +0 -70
- package/test/utils/streaming-text.test.ts +0 -89
- package/tsconfig.build.json +0 -19
- package/tsconfig.json +0 -20
- package/tsconfig.typecheck.json +0 -12
- /package/{dist/App.d.ts → App.d.ts} +0 -0
- /package/{dist/actions → actions}/character.d.ts +0 -0
- /package/{dist/actions → actions}/character.d.ts.map +0 -0
- /package/{dist/actions → actions}/character.js +0 -0
- /package/{dist/actions → actions}/chat-helpers.d.ts +0 -0
- /package/{dist/actions → actions}/chat-helpers.d.ts.map +0 -0
- /package/{dist/actions → actions}/chat-helpers.js +0 -0
- /package/{dist/actions → actions}/cloud.d.ts +0 -0
- /package/{dist/actions → actions}/cloud.d.ts.map +0 -0
- /package/{dist/actions → actions}/cloud.js +0 -0
- /package/{dist/actions → actions}/index.d.ts +0 -0
- /package/{dist/actions → actions}/index.d.ts.map +0 -0
- /package/{dist/actions → actions}/index.js +0 -0
- /package/{dist/actions → actions}/lifecycle.d.ts +0 -0
- /package/{dist/actions → actions}/lifecycle.d.ts.map +0 -0
- /package/{dist/actions → actions}/lifecycle.js +0 -0
- /package/{dist/actions → actions}/onboarding.d.ts +0 -0
- /package/{dist/actions → actions}/onboarding.d.ts.map +0 -0
- /package/{dist/actions → actions}/onboarding.js +0 -0
- /package/{dist/actions → actions}/triggers.d.ts +0 -0
- /package/{dist/actions → actions}/triggers.d.ts.map +0 -0
- /package/{dist/actions → actions}/triggers.js +0 -0
- /package/{dist/api → api}/client.d.ts +0 -0
- /package/{dist/api → api}/client.d.ts.map +0 -0
- /package/{dist/api → api}/client.js +0 -0
- /package/{dist/api → api}/index.d.ts +0 -0
- /package/{dist/api → api}/index.d.ts.map +0 -0
- /package/{dist/api → api}/index.js +0 -0
- /package/{dist/autonomy → autonomy}/index.d.ts +0 -0
- /package/{dist/autonomy → autonomy}/index.d.ts.map +0 -0
- /package/{dist/autonomy → autonomy}/index.js +0 -0
- /package/{dist/bridge → bridge}/capacitor-bridge.d.ts +0 -0
- /package/{dist/bridge → bridge}/capacitor-bridge.d.ts.map +0 -0
- /package/{dist/bridge → bridge}/capacitor-bridge.js +0 -0
- /package/{dist/bridge → bridge}/electrobun-rpc.d.ts +0 -0
- /package/{dist/bridge → bridge}/electrobun-rpc.d.ts.map +0 -0
- /package/{dist/bridge → bridge}/electrobun-rpc.js +0 -0
- /package/{dist/bridge → bridge}/electrobun-runtime.d.ts +0 -0
- /package/{dist/bridge → bridge}/electrobun-runtime.d.ts.map +0 -0
- /package/{dist/bridge → bridge}/electrobun-runtime.js +0 -0
- /package/{dist/bridge → bridge}/index.d.ts +0 -0
- /package/{dist/bridge → bridge}/index.d.ts.map +0 -0
- /package/{dist/bridge → bridge}/index.js +0 -0
- /package/{dist/bridge → bridge}/native-plugins.d.ts +0 -0
- /package/{dist/bridge → bridge}/native-plugins.d.ts.map +0 -0
- /package/{dist/bridge → bridge}/native-plugins.js +0 -0
- /package/{dist/bridge → bridge}/plugin-bridge.d.ts +0 -0
- /package/{dist/bridge → bridge}/plugin-bridge.d.ts.map +0 -0
- /package/{dist/bridge → bridge}/plugin-bridge.js +0 -0
- /package/{dist/bridge → bridge}/storage-bridge.d.ts +0 -0
- /package/{dist/bridge → bridge}/storage-bridge.d.ts.map +0 -0
- /package/{dist/bridge → bridge}/storage-bridge.js +0 -0
- /package/{dist/chat → chat}/index.d.ts +0 -0
- /package/{dist/chat → chat}/index.d.ts.map +0 -0
- /package/{dist/chat → chat}/index.js +0 -0
- /package/{dist/coding → coding}/index.d.ts +0 -0
- /package/{dist/coding → coding}/index.d.ts.map +0 -0
- /package/{dist/coding → coding}/index.js +0 -0
- /package/{dist/components → components}/AdvancedPageView.d.ts +0 -0
- /package/{dist/components → components}/AgentActivityBox.d.ts +0 -0
- /package/{dist/components → components}/AgentActivityBox.d.ts.map +0 -0
- /package/{dist/components → components}/AgentActivityBox.js +0 -0
- /package/{dist/components → components}/ApiKeyConfig.d.ts +0 -0
- /package/{dist/components → components}/ApiKeyConfig.d.ts.map +0 -0
- /package/{dist/components → components}/ApiKeyConfig.js +0 -0
- /package/{dist/components → components}/AppsPageView.d.ts +0 -0
- /package/{dist/components → components}/AppsPageView.d.ts.map +0 -0
- /package/{dist/components → components}/AppsPageView.js +0 -0
- /package/{dist/components → components}/AppsView.d.ts +0 -0
- /package/{dist/components → components}/AppsView.d.ts.map +0 -0
- /package/{dist/components → components}/AppsView.js +0 -0
- /package/{dist/components → components}/AvatarLoader.d.ts +0 -0
- /package/{dist/components → components}/AvatarLoader.d.ts.map +0 -0
- /package/{dist/components → components}/AvatarLoader.js +0 -0
- /package/{dist/components → components}/AvatarSelector.d.ts +0 -0
- /package/{dist/components → components}/AvatarSelector.d.ts.map +0 -0
- /package/{dist/components → components}/AvatarSelector.js +0 -0
- /package/{dist/components → components}/BscTradePanel.d.ts +0 -0
- /package/{dist/components → components}/BscTradePanel.d.ts.map +0 -0
- /package/{dist/components → components}/BscTradePanel.js +0 -0
- /package/{dist/components → components}/BugReportModal.d.ts +0 -0
- /package/{dist/components → components}/BugReportModal.d.ts.map +0 -0
- /package/{dist/components → components}/BugReportModal.js +0 -0
- /package/{dist/components → components}/CharacterRoster.d.ts +0 -0
- /package/{dist/components → components}/CharacterRoster.d.ts.map +0 -0
- /package/{dist/components → components}/CharacterRoster.js +0 -0
- /package/{dist/components → components}/CharacterView.d.ts +0 -0
- /package/{dist/components → components}/ChatAvatar.d.ts +0 -0
- /package/{dist/components → components}/ChatAvatar.d.ts.map +0 -0
- /package/{dist/components → components}/ChatAvatar.js +0 -0
- /package/{dist/components → components}/ChatComposer.d.ts +0 -0
- /package/{dist/components → components}/ChatMessage.d.ts +0 -0
- /package/{dist/components → components}/ChatMessage.d.ts.map +0 -0
- /package/{dist/components → components}/ChatMessage.js +0 -0
- /package/{dist/components → components}/ChatModalView.d.ts +0 -0
- /package/{dist/components → components}/ChatModalView.d.ts.map +0 -0
- /package/{dist/components → components}/ChatModalView.js +0 -0
- /package/{dist/components → components}/ChatView.d.ts +0 -0
- /package/{dist/components → components}/CloudOnboarding.d.ts +0 -0
- /package/{dist/components → components}/CloudOnboarding.d.ts.map +0 -0
- /package/{dist/components → components}/CloudOnboarding.js +0 -0
- /package/{dist/components → components}/CloudSourceControls.d.ts +0 -0
- /package/{dist/components → components}/CloudSourceControls.d.ts.map +0 -0
- /package/{dist/components → components}/CloudSourceControls.js +0 -0
- /package/{dist/components → components}/CodingAgentSettingsSection.d.ts +0 -0
- /package/{dist/components → components}/CodingAgentSettingsSection.d.ts.map +0 -0
- /package/{dist/components → components}/CodingAgentSettingsSection.js +0 -0
- /package/{dist/components → components}/CommandPalette.d.ts +0 -0
- /package/{dist/components → components}/CommandPalette.d.ts.map +0 -0
- /package/{dist/components → components}/CommandPalette.js +0 -0
- /package/{dist/components → components}/CompanionSceneHost.d.ts +0 -0
- /package/{dist/components → components}/CompanionSceneHost.d.ts.map +0 -0
- /package/{dist/components → components}/CompanionSceneHost.js +0 -0
- /package/{dist/components → components}/CompanionShell.d.ts +0 -0
- /package/{dist/components → components}/CompanionShell.d.ts.map +0 -0
- /package/{dist/components → components}/CompanionShell.js +0 -0
- /package/{dist/components → components}/CompanionView.d.ts +0 -0
- /package/{dist/components → components}/CompanionView.d.ts.map +0 -0
- /package/{dist/components → components}/ConfigPageView.d.ts +0 -0
- /package/{dist/components → components}/ConfigPageView.d.ts.map +0 -0
- /package/{dist/components → components}/ConfigSaveFooter.d.ts +0 -0
- /package/{dist/components → components}/ConfigSaveFooter.d.ts.map +0 -0
- /package/{dist/components → components}/ConfigSaveFooter.js +0 -0
- /package/{dist/components → components}/ConfirmModal.d.ts +0 -0
- /package/{dist/components → components}/ConfirmModal.d.ts.map +0 -0
- /package/{dist/components → components}/ConfirmModal.js +0 -0
- /package/{dist/components → components}/ConnectionFailedBanner.d.ts +0 -0
- /package/{dist/components → components}/ConnectionFailedBanner.d.ts.map +0 -0
- /package/{dist/components → components}/ConnectionFailedBanner.js +0 -0
- /package/{dist/components → components}/ConnectorsPageView.d.ts +0 -0
- /package/{dist/components → components}/ConnectorsPageView.d.ts.map +0 -0
- /package/{dist/components → components}/ConnectorsPageView.js +0 -0
- /package/{dist/components → components}/ConversationsSidebar.d.ts +0 -0
- /package/{dist/components → components}/ConversationsSidebar.d.ts.map +0 -0
- /package/{dist/components → components}/ConversationsSidebar.js +0 -0
- /package/{dist/components → components}/CustomActionEditor.d.ts +0 -0
- /package/{dist/components → components}/CustomActionEditor.d.ts.map +0 -0
- /package/{dist/components → components}/CustomActionEditor.js +0 -0
- /package/{dist/components → components}/CustomActionsPanel.d.ts +0 -0
- /package/{dist/components → components}/CustomActionsPanel.d.ts.map +0 -0
- /package/{dist/components → components}/CustomActionsPanel.js +0 -0
- /package/{dist/components → components}/CustomActionsView.d.ts +0 -0
- /package/{dist/components → components}/CustomActionsView.d.ts.map +0 -0
- /package/{dist/components → components}/CustomActionsView.js +0 -0
- /package/{dist/components → components}/DatabasePageView.d.ts +0 -0
- /package/{dist/components → components}/DatabasePageView.d.ts.map +0 -0
- /package/{dist/components → components}/DatabasePageView.js +0 -0
- /package/{dist/components → components}/DatabaseView.d.ts +0 -0
- /package/{dist/components → components}/DatabaseView.d.ts.map +0 -0
- /package/{dist/components → components}/DatabaseView.js +0 -0
- /package/{dist/components → components}/ElizaCloudDashboard.d.ts +0 -0
- /package/{dist/components → components}/ElizaCloudDashboard.d.ts.map +0 -0
- /package/{dist/components → components}/EmotePicker.d.ts +0 -0
- /package/{dist/components → components}/EmotePicker.d.ts.map +0 -0
- /package/{dist/components → components}/EmotePicker.js +0 -0
- /package/{dist/components → components}/ErrorBoundary.d.ts +0 -0
- /package/{dist/components → components}/ErrorBoundary.d.ts.map +0 -0
- /package/{dist/components → components}/ErrorBoundary.js +0 -0
- /package/{dist/components → components}/FineTuningView.d.ts +0 -0
- /package/{dist/components → components}/FineTuningView.d.ts.map +0 -0
- /package/{dist/components → components}/FineTuningView.js +0 -0
- /package/{dist/components → components}/FlaminaGuide.d.ts +0 -0
- /package/{dist/components → components}/FlaminaGuide.d.ts.map +0 -0
- /package/{dist/components → components}/GameView.d.ts +0 -0
- /package/{dist/components → components}/GameView.d.ts.map +0 -0
- /package/{dist/components → components}/GameView.js +0 -0
- /package/{dist/components → components}/GameViewOverlay.d.ts +0 -0
- /package/{dist/components → components}/GameViewOverlay.d.ts.map +0 -0
- /package/{dist/components → components}/GameViewOverlay.js +0 -0
- /package/{dist/components → components}/GlobalEmoteOverlay.d.ts +0 -0
- /package/{dist/components → components}/GlobalEmoteOverlay.d.ts.map +0 -0
- /package/{dist/components → components}/GlobalEmoteOverlay.js +0 -0
- /package/{dist/components → components}/Header.d.ts +0 -0
- /package/{dist/components → components}/Header.d.ts.map +0 -0
- /package/{dist/components → components}/Header.js +0 -0
- /package/{dist/components → components}/HeartbeatsView.d.ts +0 -0
- /package/{dist/components → components}/HeartbeatsView.d.ts.map +0 -0
- /package/{dist/components → components}/HeartbeatsView.js +0 -0
- /package/{dist/components → components}/InventoryView.d.ts +0 -0
- /package/{dist/components → components}/InventoryView.d.ts.map +0 -0
- /package/{dist/components → components}/InventoryView.js +0 -0
- /package/{dist/components → components}/KnowledgeView.d.ts +0 -0
- /package/{dist/components → components}/KnowledgeView.d.ts.map +0 -0
- /package/{dist/components → components}/KnowledgeView.js +0 -0
- /package/{dist/components → components}/LanguageDropdown.d.ts +0 -0
- /package/{dist/components → components}/LanguageDropdown.d.ts.map +0 -0
- /package/{dist/components → components}/LanguageDropdown.js +0 -0
- /package/{dist/components → components}/LifoMonitorPanel.d.ts +0 -0
- /package/{dist/components → components}/LifoMonitorPanel.d.ts.map +0 -0
- /package/{dist/components → components}/LifoMonitorPanel.js +0 -0
- /package/{dist/components → components}/LifoSandboxView.d.ts +0 -0
- /package/{dist/components → components}/LifoSandboxView.d.ts.map +0 -0
- /package/{dist/components → components}/LifoSandboxView.js +0 -0
- /package/{dist/components → components}/LoadingScreen.d.ts +0 -0
- /package/{dist/components → components}/LoadingScreen.d.ts.map +0 -0
- /package/{dist/components → components}/LoadingScreen.js +0 -0
- /package/{dist/components → components}/LogsPageView.d.ts +0 -0
- /package/{dist/components → components}/LogsPageView.d.ts.map +0 -0
- /package/{dist/components → components}/LogsPageView.js +0 -0
- /package/{dist/components → components}/LogsView.d.ts +0 -0
- /package/{dist/components → components}/LogsView.d.ts.map +0 -0
- /package/{dist/components → components}/LogsView.js +0 -0
- /package/{dist/components → components}/MediaGalleryView.d.ts +0 -0
- /package/{dist/components → components}/MediaGalleryView.d.ts.map +0 -0
- /package/{dist/components → components}/MediaGalleryView.js +0 -0
- /package/{dist/components → components}/MediaSettingsSection.d.ts +0 -0
- /package/{dist/components → components}/MediaSettingsSection.d.ts.map +0 -0
- /package/{dist/components → components}/MediaSettingsSection.js +0 -0
- /package/{dist/components → components}/MessageContent.d.ts +0 -0
- /package/{dist/components → components}/MessageContent.d.ts.map +0 -0
- /package/{dist/components → components}/MessageContent.js +0 -0
- /package/{dist/components → components}/OnboardingWizard.d.ts +0 -0
- /package/{dist/components → components}/PairingView.d.ts +0 -0
- /package/{dist/components → components}/PairingView.d.ts.map +0 -0
- /package/{dist/components → components}/PairingView.js +0 -0
- /package/{dist/components → components}/PermissionsSection.d.ts +0 -0
- /package/{dist/components → components}/PermissionsSection.d.ts.map +0 -0
- /package/{dist/components → components}/PermissionsSection.js +0 -0
- /package/{dist/components → components}/PluginsPageView.d.ts +0 -0
- /package/{dist/components → components}/PluginsPageView.d.ts.map +0 -0
- /package/{dist/components → components}/PluginsPageView.js +0 -0
- /package/{dist/components → components}/PluginsView.d.ts +0 -0
- /package/{dist/components → components}/ProviderSwitcher.d.ts +0 -0
- /package/{dist/components → components}/ProviderSwitcher.d.ts.map +0 -0
- /package/{dist/components → components}/ProviderSwitcher.js +0 -0
- /package/{dist/components → components}/RestartBanner.d.ts +0 -0
- /package/{dist/components → components}/RestartBanner.d.ts.map +0 -0
- /package/{dist/components → components}/RestartBanner.js +0 -0
- /package/{dist/components → components}/RuntimeView.d.ts +0 -0
- /package/{dist/components → components}/RuntimeView.d.ts.map +0 -0
- /package/{dist/components → components}/RuntimeView.js +0 -0
- /package/{dist/components → components}/SaveCommandModal.d.ts +0 -0
- /package/{dist/components → components}/SaveCommandModal.d.ts.map +0 -0
- /package/{dist/components → components}/SaveCommandModal.js +0 -0
- /package/{dist/components → components}/SecretsView.d.ts +0 -0
- /package/{dist/components → components}/SecretsView.d.ts.map +0 -0
- /package/{dist/components → components}/SecretsView.js +0 -0
- /package/{dist/components → components}/SettingsView.d.ts +0 -0
- /package/{dist/components → components}/SettingsView.d.ts.map +0 -0
- /package/{dist/components → components}/SettingsView.js +0 -0
- /package/{dist/components → components}/ShellOverlays.d.ts +0 -0
- /package/{dist/components → components}/ShellOverlays.d.ts.map +0 -0
- /package/{dist/components → components}/ShellOverlays.js +0 -0
- /package/{dist/components → components}/ShortcutsOverlay.d.ts +0 -0
- /package/{dist/components → components}/ShortcutsOverlay.d.ts.map +0 -0
- /package/{dist/components → components}/ShortcutsOverlay.js +0 -0
- /package/{dist/components → components}/SkillsView.d.ts +0 -0
- /package/{dist/components → components}/SkillsView.d.ts.map +0 -0
- /package/{dist/components → components}/SkillsView.js +0 -0
- /package/{dist/components → components}/StartupFailureView.d.ts +0 -0
- /package/{dist/components → components}/StartupFailureView.d.ts.map +0 -0
- /package/{dist/components → components}/StartupFailureView.js +0 -0
- /package/{dist/components → components}/StreamView.d.ts +0 -0
- /package/{dist/components → components}/StreamView.d.ts.map +0 -0
- /package/{dist/components → components}/StreamView.js +0 -0
- /package/{dist/components → components}/StripeEmbeddedCheckout.d.ts +0 -0
- /package/{dist/components → components}/StripeEmbeddedCheckout.d.ts.map +0 -0
- /package/{dist/components → components}/StripeEmbeddedCheckout.js +0 -0
- /package/{dist/components → components}/SubscriptionStatus.d.ts +0 -0
- /package/{dist/components → components}/SubscriptionStatus.d.ts.map +0 -0
- /package/{dist/components → components}/SubscriptionStatus.js +0 -0
- /package/{dist/components → components}/SystemWarningBanner.d.ts +0 -0
- /package/{dist/components → components}/SystemWarningBanner.d.ts.map +0 -0
- /package/{dist/components → components}/SystemWarningBanner.js +0 -0
- /package/{dist/components → components}/ThemeToggle.d.ts +0 -0
- /package/{dist/components → components}/ThemeToggle.d.ts.map +0 -0
- /package/{dist/components → components}/ThemeToggle.js +0 -0
- /package/{dist/components → components}/TrajectoriesView.d.ts +0 -0
- /package/{dist/components → components}/TrajectoriesView.d.ts.map +0 -0
- /package/{dist/components → components}/TrajectoriesView.js +0 -0
- /package/{dist/components → components}/TrajectoryDetailView.d.ts +0 -0
- /package/{dist/components → components}/TrajectoryDetailView.d.ts.map +0 -0
- /package/{dist/components → components}/TrajectoryDetailView.js +0 -0
- /package/{dist/components → components}/TriggersView.d.ts +0 -0
- /package/{dist/components → components}/TriggersView.d.ts.map +0 -0
- /package/{dist/components → components}/TriggersView.js +0 -0
- /package/{dist/components → components}/VectorBrowserView.d.ts +0 -0
- /package/{dist/components → components}/VectorBrowserView.d.ts.map +0 -0
- /package/{dist/components → components}/VectorBrowserView.js +0 -0
- /package/{dist/components → components}/VoiceConfigView.d.ts +0 -0
- /package/{dist/components → components}/VoiceConfigView.d.ts.map +0 -0
- /package/{dist/components → components}/VoiceConfigView.js +0 -0
- /package/{dist/components → components}/VrmStage.d.ts +0 -0
- /package/{dist/components → components}/VrmStage.d.ts.map +0 -0
- /package/{dist/components → components}/VrmStage.js +0 -0
- /package/{dist/components → components}/WhatsAppQrOverlay.d.ts +0 -0
- /package/{dist/components → components}/WhatsAppQrOverlay.d.ts.map +0 -0
- /package/{dist/components → components}/WhatsAppQrOverlay.js +0 -0
- /package/{dist/components → components}/apps/AppDetailPane.d.ts +0 -0
- /package/{dist/components → components}/apps/AppDetailPane.d.ts.map +0 -0
- /package/{dist/components → components}/apps/AppDetailPane.js +0 -0
- /package/{dist/components → components}/apps/AppsCatalogGrid.d.ts +0 -0
- /package/{dist/components → components}/apps/AppsCatalogGrid.d.ts.map +0 -0
- /package/{dist/components → components}/apps/AppsCatalogGrid.js +0 -0
- /package/{dist/components → components}/apps/extensions/registry.d.ts +0 -0
- /package/{dist/components → components}/apps/extensions/registry.d.ts.map +0 -0
- /package/{dist/components → components}/apps/extensions/registry.js +0 -0
- /package/{dist/components → components}/apps/extensions/types.d.ts +0 -0
- /package/{dist/components → components}/apps/extensions/types.d.ts.map +0 -0
- /package/{dist/components → components}/apps/extensions/types.js +0 -0
- /package/{dist/components → components}/apps/helpers.d.ts +0 -0
- /package/{dist/components → components}/apps/helpers.d.ts.map +0 -0
- /package/{dist/components → components}/apps/helpers.js +0 -0
- /package/{dist/components → components}/avatar/VrmAnimationLoader.d.ts +0 -0
- /package/{dist/components → components}/avatar/VrmAnimationLoader.d.ts.map +0 -0
- /package/{dist/components → components}/avatar/VrmAnimationLoader.js +0 -0
- /package/{dist/components → components}/avatar/VrmBlinkController.d.ts +0 -0
- /package/{dist/components → components}/avatar/VrmBlinkController.d.ts.map +0 -0
- /package/{dist/components → components}/avatar/VrmBlinkController.js +0 -0
- /package/{dist/components → components}/avatar/VrmCameraManager.d.ts +0 -0
- /package/{dist/components → components}/avatar/VrmCameraManager.d.ts.map +0 -0
- /package/{dist/components → components}/avatar/VrmCameraManager.js +0 -0
- /package/{dist/components → components}/avatar/VrmFootShadow.d.ts +0 -0
- /package/{dist/components → components}/avatar/VrmFootShadow.d.ts.map +0 -0
- /package/{dist/components → components}/avatar/VrmFootShadow.js +0 -0
- /package/{dist/components → components}/avatar/mixamoVRMRigMap.d.ts +0 -0
- /package/{dist/components → components}/avatar/mixamoVRMRigMap.d.ts.map +0 -0
- /package/{dist/components → components}/avatar/mixamoVRMRigMap.js +0 -0
- /package/{dist/components → components}/avatar/retargetMixamoFbxToVrm.d.ts +0 -0
- /package/{dist/components → components}/avatar/retargetMixamoFbxToVrm.d.ts.map +0 -0
- /package/{dist/components → components}/avatar/retargetMixamoFbxToVrm.js +0 -0
- /package/{dist/components → components}/avatar/retargetMixamoGltfToVrm.d.ts +0 -0
- /package/{dist/components → components}/avatar/retargetMixamoGltfToVrm.d.ts.map +0 -0
- /package/{dist/components → components}/avatar/retargetMixamoGltfToVrm.js +0 -0
- /package/{dist/components → components}/chainConfig.d.ts +0 -0
- /package/{dist/components → components}/chainConfig.d.ts.map +0 -0
- /package/{dist/components → components}/chainConfig.js +0 -0
- /package/{dist/components → components}/companion/CompanionHeader.d.ts +0 -0
- /package/{dist/components → components}/companion/CompanionHeader.d.ts.map +0 -0
- /package/{dist/components → components}/companion/CompanionHeader.js +0 -0
- /package/{dist/components → components}/companion/CompanionSceneHost.d.ts +0 -0
- /package/{dist/components → components}/companion/CompanionSceneHost.d.ts.map +0 -0
- /package/{dist/components → components}/companion/CompanionSceneHost.js +0 -0
- /package/{dist/components → components}/companion/VrmStage.d.ts +0 -0
- /package/{dist/components → components}/companion/VrmStage.d.ts.map +0 -0
- /package/{dist/components → components}/companion/VrmStage.js +0 -0
- /package/{dist/components → components}/companion/index.d.ts +0 -0
- /package/{dist/components → components}/companion/index.d.ts.map +0 -0
- /package/{dist/components → components}/companion/index.js +0 -0
- /package/{dist/components → components}/companion/walletUtils.d.ts +0 -0
- /package/{dist/components → components}/companion/walletUtils.d.ts.map +0 -0
- /package/{dist/components → components}/companion/walletUtils.js +0 -0
- /package/{dist/components → components}/companion-shell-styles.d.ts +0 -0
- /package/{dist/components → components}/companion-shell-styles.d.ts.map +0 -0
- /package/{dist/components → components}/companion-shell-styles.js +0 -0
- /package/{dist/components → components}/confirm-delete-control.d.ts +0 -0
- /package/{dist/components → components}/confirm-delete-control.d.ts.map +0 -0
- /package/{dist/components → components}/confirm-delete-control.js +0 -0
- /package/{dist/components → components}/conversations/ConversationListItem.d.ts +0 -0
- /package/{dist/components → components}/conversations/ConversationListItem.d.ts.map +0 -0
- /package/{dist/components → components}/conversations/ConversationListItem.js +0 -0
- /package/{dist/components → components}/conversations/conversation-utils.d.ts +0 -0
- /package/{dist/components → components}/conversations/conversation-utils.d.ts.map +0 -0
- /package/{dist/components → components}/conversations/conversation-utils.js +0 -0
- /package/{dist/components → components}/format.d.ts +0 -0
- /package/{dist/components → components}/format.d.ts.map +0 -0
- /package/{dist/components → components}/format.js +0 -0
- /package/{dist/components → components}/inventory/CopyableAddress.d.ts +0 -0
- /package/{dist/components → components}/inventory/CopyableAddress.d.ts.map +0 -0
- /package/{dist/components → components}/inventory/CopyableAddress.js +0 -0
- /package/{dist/components → components}/inventory/InventoryToolbar.d.ts +0 -0
- /package/{dist/components → components}/inventory/InventoryToolbar.d.ts.map +0 -0
- /package/{dist/components → components}/inventory/InventoryToolbar.js +0 -0
- /package/{dist/components → components}/inventory/NftGrid.d.ts +0 -0
- /package/{dist/components → components}/inventory/NftGrid.d.ts.map +0 -0
- /package/{dist/components → components}/inventory/NftGrid.js +0 -0
- /package/{dist/components → components}/inventory/TokenLogo.d.ts +0 -0
- /package/{dist/components → components}/inventory/TokenLogo.d.ts.map +0 -0
- /package/{dist/components → components}/inventory/TokenLogo.js +0 -0
- /package/{dist/components → components}/inventory/TokensTable.d.ts +0 -0
- /package/{dist/components → components}/inventory/TokensTable.d.ts.map +0 -0
- /package/{dist/components → components}/inventory/TokensTable.js +0 -0
- /package/{dist/components → components}/inventory/constants.d.ts +0 -0
- /package/{dist/components → components}/inventory/constants.d.ts.map +0 -0
- /package/{dist/components → components}/inventory/constants.js +0 -0
- /package/{dist/components → components}/inventory/index.d.ts +0 -0
- /package/{dist/components → components}/inventory/index.d.ts.map +0 -0
- /package/{dist/components → components}/inventory/index.js +0 -0
- /package/{dist/components → components}/inventory/media-url.d.ts +0 -0
- /package/{dist/components → components}/inventory/media-url.d.ts.map +0 -0
- /package/{dist/components → components}/inventory/media-url.js +0 -0
- /package/{dist/components → components}/inventory/useInventoryData.d.ts +0 -0
- /package/{dist/components → components}/inventory/useInventoryData.d.ts.map +0 -0
- /package/{dist/components → components}/inventory/useInventoryData.js +0 -0
- /package/{dist/components → components}/knowledge-upload-image.d.ts +0 -0
- /package/{dist/components → components}/knowledge-upload-image.d.ts.map +0 -0
- /package/{dist/components → components}/knowledge-upload-image.js +0 -0
- /package/{dist/components → components}/labels.d.ts +0 -0
- /package/{dist/components → components}/labels.d.ts.map +0 -0
- /package/{dist/components → components}/labels.js +0 -0
- /package/{dist/components → components}/onboarding/ActivateStep.d.ts +0 -0
- /package/{dist/components → components}/onboarding/ActivateStep.d.ts.map +0 -0
- /package/{dist/components → components}/onboarding/ActivateStep.js +0 -0
- /package/{dist/components → components}/onboarding/ConnectionStep.d.ts +0 -0
- /package/{dist/components → components}/onboarding/IdentityStep.d.ts +0 -0
- /package/{dist/components → components}/onboarding/IdentityStep.d.ts.map +0 -0
- /package/{dist/components → components}/onboarding/IdentityStep.js +0 -0
- /package/{dist/components → components}/onboarding/OnboardingPanel.d.ts +0 -0
- /package/{dist/components → components}/onboarding/OnboardingPanel.d.ts.map +0 -0
- /package/{dist/components → components}/onboarding/OnboardingPanel.js +0 -0
- /package/{dist/components → components}/onboarding/OnboardingStepNav.d.ts +0 -0
- /package/{dist/components → components}/onboarding/OnboardingStepNav.d.ts.map +0 -0
- /package/{dist/components → components}/onboarding/OnboardingStepNav.js +0 -0
- /package/{dist/components → components}/onboarding/PermissionsStep.d.ts +0 -0
- /package/{dist/components → components}/onboarding/PermissionsStep.d.ts.map +0 -0
- /package/{dist/components → components}/onboarding/PermissionsStep.js +0 -0
- /package/{dist/components → components}/onboarding/RpcStep.d.ts +0 -0
- /package/{dist/components → components}/onboarding/RpcStep.d.ts.map +0 -0
- /package/{dist/components → components}/onboarding/RpcStep.js +0 -0
- /package/{dist/components → components}/permissions/PermissionIcon.d.ts +0 -0
- /package/{dist/components → components}/permissions/PermissionIcon.d.ts.map +0 -0
- /package/{dist/components → components}/permissions/PermissionIcon.js +0 -0
- /package/{dist/components → components}/permissions/StreamingPermissions.d.ts +0 -0
- /package/{dist/components → components}/plugins/showcase-data.d.ts +0 -0
- /package/{dist/components → components}/plugins/showcase-data.d.ts.map +0 -0
- /package/{dist/components → components}/plugins/showcase-data.js +0 -0
- /package/{dist/components → components}/shared/ShellHeaderControls.d.ts +0 -0
- /package/{dist/components → components}/shared/ShellHeaderControls.d.ts.map +0 -0
- /package/{dist/components → components}/shared/ShellHeaderControls.js +0 -0
- /package/{dist/components → components}/shared-companion-scene-context.d.ts +0 -0
- /package/{dist/components → components}/shared-companion-scene-context.d.ts.map +0 -0
- /package/{dist/components → components}/shared-companion-scene-context.js +0 -0
- /package/{dist/components → components}/skeletons.d.ts +0 -0
- /package/{dist/components → components}/skeletons.d.ts.map +0 -0
- /package/{dist/components → components}/skeletons.js +0 -0
- /package/{dist/components → components}/stream/ActivityFeed.d.ts +0 -0
- /package/{dist/components → components}/stream/ActivityFeed.d.ts.map +0 -0
- /package/{dist/components → components}/stream/ActivityFeed.js +0 -0
- /package/{dist/components → components}/stream/AvatarPip.d.ts +0 -0
- /package/{dist/components → components}/stream/AvatarPip.d.ts.map +0 -0
- /package/{dist/components → components}/stream/AvatarPip.js +0 -0
- /package/{dist/components → components}/stream/ChatContent.d.ts +0 -0
- /package/{dist/components → components}/stream/ChatContent.d.ts.map +0 -0
- /package/{dist/components → components}/stream/ChatContent.js +0 -0
- /package/{dist/components → components}/stream/ChatTicker.d.ts +0 -0
- /package/{dist/components → components}/stream/ChatTicker.d.ts.map +0 -0
- /package/{dist/components → components}/stream/ChatTicker.js +0 -0
- /package/{dist/components → components}/stream/IdleContent.d.ts +0 -0
- /package/{dist/components → components}/stream/IdleContent.d.ts.map +0 -0
- /package/{dist/components → components}/stream/IdleContent.js +0 -0
- /package/{dist/components → components}/stream/StatusBar.d.ts +0 -0
- /package/{dist/components → components}/stream/StatusBar.d.ts.map +0 -0
- /package/{dist/components → components}/stream/StatusBar.js +0 -0
- /package/{dist/components → components}/stream/StreamSettings.d.ts +0 -0
- /package/{dist/components → components}/stream/StreamSettings.d.ts.map +0 -0
- /package/{dist/components → components}/stream/StreamSettings.js +0 -0
- /package/{dist/components → components}/stream/StreamTerminal.d.ts +0 -0
- /package/{dist/components → components}/stream/StreamTerminal.d.ts.map +0 -0
- /package/{dist/components → components}/stream/StreamTerminal.js +0 -0
- /package/{dist/components → components}/stream/StreamVoiceConfig.d.ts +0 -0
- /package/{dist/components → components}/stream/StreamVoiceConfig.d.ts.map +0 -0
- /package/{dist/components → components}/stream/StreamVoiceConfig.js +0 -0
- /package/{dist/components → components}/stream/helpers.d.ts +0 -0
- /package/{dist/components → components}/stream/helpers.d.ts.map +0 -0
- /package/{dist/components → components}/stream/helpers.js +0 -0
- /package/{dist/components → components}/stream/overlays/OverlayLayer.d.ts +0 -0
- /package/{dist/components → components}/stream/overlays/OverlayLayer.d.ts.map +0 -0
- /package/{dist/components → components}/stream/overlays/OverlayLayer.js +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/ActionTickerWidget.d.ts +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/ActionTickerWidget.d.ts.map +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/ActionTickerWidget.js +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/AlertPopupWidget.d.ts +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/AlertPopupWidget.d.ts.map +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/AlertPopupWidget.js +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/BrandingWidget.d.ts +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/BrandingWidget.d.ts.map +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/BrandingWidget.js +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/CustomHtmlWidget.d.ts +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/CustomHtmlWidget.d.ts.map +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/CustomHtmlWidget.js +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/PeonGlassWidget.d.ts +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/PeonGlassWidget.d.ts.map +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/PeonGlassWidget.js +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/PeonHudWidget.d.ts +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/PeonHudWidget.d.ts.map +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/PeonHudWidget.js +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/PeonSakuraWidget.d.ts +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/PeonSakuraWidget.d.ts.map +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/PeonSakuraWidget.js +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/ThoughtBubbleWidget.d.ts +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/ThoughtBubbleWidget.d.ts.map +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/ThoughtBubbleWidget.js +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/ViewerCountWidget.d.ts +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/ViewerCountWidget.d.ts.map +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/ViewerCountWidget.js +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/index.d.ts +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/index.d.ts.map +0 -0
- /package/{dist/components → components}/stream/overlays/built-in/index.js +0 -0
- /package/{dist/components → components}/stream/overlays/registry.d.ts +0 -0
- /package/{dist/components → components}/stream/overlays/registry.d.ts.map +0 -0
- /package/{dist/components → components}/stream/overlays/registry.js +0 -0
- /package/{dist/components → components}/stream/overlays/types.d.ts +0 -0
- /package/{dist/components → components}/stream/overlays/types.d.ts.map +0 -0
- /package/{dist/components → components}/stream/overlays/types.js +0 -0
- /package/{dist/components → components}/stream/overlays/useOverlayLayout.d.ts +0 -0
- /package/{dist/components → components}/stream/overlays/useOverlayLayout.d.ts.map +0 -0
- /package/{dist/components → components}/stream/overlays/useOverlayLayout.js +0 -0
- /package/{dist/components → components}/trajectory-format.d.ts +0 -0
- /package/{dist/components → components}/trajectory-format.d.ts.map +0 -0
- /package/{dist/components → components}/trajectory-format.js +0 -0
- /package/{dist/components → components}/ui-badges.d.ts +0 -0
- /package/{dist/components → components}/ui-badges.d.ts.map +0 -0
- /package/{dist/components → components}/ui-badges.js +0 -0
- /package/{dist/components → components}/ui-switch.d.ts +0 -0
- /package/{dist/components → components}/ui-switch.d.ts.map +0 -0
- /package/{dist/components → components}/vector-browser-three.d.ts +0 -0
- /package/{dist/components → components}/vector-browser-three.d.ts.map +0 -0
- /package/{dist/components → components}/vector-browser-three.js +0 -0
- /package/{dist/config → config}/branding.d.ts +0 -0
- /package/{dist/config → config}/branding.d.ts.map +0 -0
- /package/{dist/config → config}/branding.js +0 -0
- /package/{dist/config → config}/config-catalog.d.ts +0 -0
- /package/{dist/config → config}/config-catalog.d.ts.map +0 -0
- /package/{dist/config → config}/config-catalog.js +0 -0
- /package/{dist/config → config}/config-field.d.ts +0 -0
- /package/{dist/config → config}/config-field.d.ts.map +0 -0
- /package/{dist/config → config}/config-field.js +0 -0
- /package/{dist/config → config}/config-renderer.d.ts +0 -0
- /package/{dist/config → config}/config-renderer.d.ts.map +0 -0
- /package/{dist/config → config}/config-renderer.js +0 -0
- /package/{dist/config → config}/index.d.ts +0 -0
- /package/{dist/config → config}/index.d.ts.map +0 -0
- /package/{dist/config → config}/index.js +0 -0
- /package/{dist/config → config}/ui-renderer.d.ts +0 -0
- /package/{dist/config → config}/ui-renderer.d.ts.map +0 -0
- /package/{dist/config → config}/ui-renderer.js +0 -0
- /package/{dist/config → config}/ui-spec.d.ts +0 -0
- /package/{dist/config → config}/ui-spec.d.ts.map +0 -0
- /package/{dist/config → config}/ui-spec.js +0 -0
- /package/{dist/events → events}/index.d.ts +0 -0
- /package/{dist/events → events}/index.d.ts.map +0 -0
- /package/{dist/events → events}/index.js +0 -0
- /package/{dist/hooks → hooks}/index.d.ts +0 -0
- /package/{dist/hooks → hooks}/index.d.ts.map +0 -0
- /package/{dist/hooks → hooks}/index.js +0 -0
- /package/{dist/hooks → hooks}/useBugReport.d.ts +0 -0
- /package/{dist/hooks → hooks}/useBugReport.d.ts.map +0 -0
- /package/{dist/hooks → hooks}/useBugReport.js +0 -0
- /package/{dist/hooks → hooks}/useCanvasWindow.d.ts +0 -0
- /package/{dist/hooks → hooks}/useCanvasWindow.d.ts.map +0 -0
- /package/{dist/hooks → hooks}/useCanvasWindow.js +0 -0
- /package/{dist/hooks → hooks}/useChatAvatarVoice.d.ts +0 -0
- /package/{dist/hooks → hooks}/useChatAvatarVoice.d.ts.map +0 -0
- /package/{dist/hooks → hooks}/useChatAvatarVoice.js +0 -0
- /package/{dist/hooks → hooks}/useClickOutside.d.ts +0 -0
- /package/{dist/hooks → hooks}/useClickOutside.d.ts.map +0 -0
- /package/{dist/hooks → hooks}/useClickOutside.js +0 -0
- /package/{dist/hooks → hooks}/useContextMenu.d.ts +0 -0
- /package/{dist/hooks → hooks}/useContextMenu.d.ts.map +0 -0
- /package/{dist/hooks → hooks}/useContextMenu.js +0 -0
- /package/{dist/hooks → hooks}/useKeyboardShortcuts.d.ts +0 -0
- /package/{dist/hooks → hooks}/useKeyboardShortcuts.d.ts.map +0 -0
- /package/{dist/hooks → hooks}/useKeyboardShortcuts.js +0 -0
- /package/{dist/hooks → hooks}/useLifoSync.d.ts +0 -0
- /package/{dist/hooks → hooks}/useLifoSync.d.ts.map +0 -0
- /package/{dist/hooks → hooks}/useLifoSync.js +0 -0
- /package/{dist/hooks → hooks}/useMemoryMonitor.d.ts +0 -0
- /package/{dist/hooks → hooks}/useMemoryMonitor.d.ts.map +0 -0
- /package/{dist/hooks → hooks}/useMemoryMonitor.js +0 -0
- /package/{dist/hooks → hooks}/useRenderGuard.d.ts +0 -0
- /package/{dist/hooks → hooks}/useRenderGuard.d.ts.map +0 -0
- /package/{dist/hooks → hooks}/useRenderGuard.js +0 -0
- /package/{dist/hooks → hooks}/useRetakeCapture.d.ts +0 -0
- /package/{dist/hooks → hooks}/useRetakeCapture.d.ts.map +0 -0
- /package/{dist/hooks → hooks}/useRetakeCapture.js +0 -0
- /package/{dist/hooks → hooks}/useStreamPopoutNavigation.d.ts +0 -0
- /package/{dist/hooks → hooks}/useStreamPopoutNavigation.d.ts.map +0 -0
- /package/{dist/hooks → hooks}/useStreamPopoutNavigation.js +0 -0
- /package/{dist/hooks → hooks}/useTimeout.d.ts +0 -0
- /package/{dist/hooks → hooks}/useTimeout.d.ts.map +0 -0
- /package/{dist/hooks → hooks}/useTimeout.js +0 -0
- /package/{dist/hooks → hooks}/useVoiceChat.d.ts +0 -0
- /package/{dist/hooks → hooks}/useVoiceChat.d.ts.map +0 -0
- /package/{dist/hooks → hooks}/useVoiceChat.js +0 -0
- /package/{dist/hooks → hooks}/useWhatsAppPairing.d.ts +0 -0
- /package/{dist/hooks → hooks}/useWhatsAppPairing.d.ts.map +0 -0
- /package/{dist/hooks → hooks}/useWhatsAppPairing.js +0 -0
- /package/{dist/i18n → i18n}/index.d.ts +0 -0
- /package/{dist/i18n → i18n}/index.d.ts.map +0 -0
- /package/{dist/i18n → i18n}/index.js +0 -0
- /package/{dist/i18n → i18n}/messages.d.ts +0 -0
- /package/{dist/i18n → i18n}/messages.d.ts.map +0 -0
- /package/{dist/i18n → i18n}/messages.js +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/index.d.ts.map → index.d.ts.map} +0 -0
- /package/{dist/index.js → index.js} +0 -0
- /package/{dist/navigation → navigation}/index.d.ts +0 -0
- /package/{dist/navigation → navigation}/index.d.ts.map +0 -0
- /package/{dist/navigation → navigation}/index.js +0 -0
- /package/{dist/onboarding-config.d.ts → onboarding-config.d.ts} +0 -0
- /package/{dist/onboarding-config.d.ts.map → onboarding-config.d.ts.map} +0 -0
- /package/{dist/onboarding-config.js → onboarding-config.js} +0 -0
- /package/{dist/platform → platform}/browser-launch.d.ts +0 -0
- /package/{dist/platform → platform}/browser-launch.d.ts.map +0 -0
- /package/{dist/platform → platform}/browser-launch.js +0 -0
- /package/{dist/platform → platform}/index.d.ts +0 -0
- /package/{dist/platform → platform}/index.d.ts.map +0 -0
- /package/{dist/platform → platform}/index.js +0 -0
- /package/{dist/platform → platform}/init.d.ts +0 -0
- /package/{dist/platform → platform}/init.d.ts.map +0 -0
- /package/{dist/platform → platform}/init.js +0 -0
- /package/{dist/platform → platform}/lifo.d.ts +0 -0
- /package/{dist/platform → platform}/lifo.d.ts.map +0 -0
- /package/{dist/platform → platform}/lifo.js +0 -0
- /package/{dist/providers → providers}/index.d.ts +0 -0
- /package/{dist/providers → providers}/index.d.ts.map +0 -0
- /package/{dist/providers → providers}/index.js +0 -0
- /package/{dist/shell-params.d.ts → shell-params.d.ts} +0 -0
- /package/{dist/shell-params.d.ts.map → shell-params.d.ts.map} +0 -0
- /package/{dist/shell-params.js → shell-params.js} +0 -0
- /package/{dist/state → state}/AppContext.d.ts +0 -0
- /package/{dist/state → state}/index.d.ts +0 -0
- /package/{dist/state → state}/index.d.ts.map +0 -0
- /package/{dist/state → state}/index.js +0 -0
- /package/{dist/state → state}/internal.d.ts +0 -0
- /package/{dist/state → state}/internal.d.ts.map +0 -0
- /package/{dist/state → state}/internal.js +0 -0
- /package/{dist/state → state}/onboarding-resume.d.ts +0 -0
- /package/{dist/state → state}/onboarding-resume.d.ts.map +0 -0
- /package/{dist/state → state}/onboarding-resume.js +0 -0
- /package/{dist/state → state}/parsers.d.ts +0 -0
- /package/{dist/state → state}/parsers.d.ts.map +0 -0
- /package/{dist/state → state}/parsers.js +0 -0
- /package/{dist/state → state}/persistence.d.ts +0 -0
- /package/{dist/state → state}/persistence.d.ts.map +0 -0
- /package/{dist/state → state}/persistence.js +0 -0
- /package/{dist/state → state}/shell-routing.d.ts +0 -0
- /package/{dist/state → state}/shell-routing.d.ts.map +0 -0
- /package/{dist/state → state}/shell-routing.js +0 -0
- /package/{dist/state → state}/types.d.ts +0 -0
- /package/{dist/state → state}/types.d.ts.map +0 -0
- /package/{dist/state → state}/types.js +0 -0
- /package/{dist/state → state}/ui-preferences.d.ts +0 -0
- /package/{dist/state → state}/ui-preferences.d.ts.map +0 -0
- /package/{dist/state → state}/ui-preferences.js +0 -0
- /package/{dist/state → state}/useApp.d.ts +0 -0
- /package/{dist/state → state}/useApp.d.ts.map +0 -0
- /package/{dist/state → state}/useApp.js +0 -0
- /package/{dist/state → state}/vrm.d.ts +0 -0
- /package/{dist/state → state}/vrm.d.ts.map +0 -0
- /package/{dist/state → state}/vrm.js +0 -0
- /package/{dist/styles → styles}/base.css +0 -0
- /package/{dist/styles → styles}/styles.css +0 -0
- /package/{dist/styles → styles}/xterm.css +0 -0
- /package/{dist/types → types}/index.d.ts +0 -0
- /package/{dist/types → types}/index.d.ts.map +0 -0
- /package/{dist/types → types}/index.js +0 -0
- /package/{dist/utils → utils}/asset-url.d.ts +0 -0
- /package/{dist/utils → utils}/asset-url.d.ts.map +0 -0
- /package/{dist/utils → utils}/asset-url.js +0 -0
- /package/{dist/utils → utils}/assistant-text.d.ts +0 -0
- /package/{dist/utils → utils}/assistant-text.d.ts.map +0 -0
- /package/{dist/utils → utils}/assistant-text.js +0 -0
- /package/{dist/utils → utils}/clipboard.d.ts +0 -0
- /package/{dist/utils → utils}/clipboard.d.ts.map +0 -0
- /package/{dist/utils → utils}/clipboard.js +0 -0
- /package/{dist/utils → utils}/desktop-dialogs.d.ts +0 -0
- /package/{dist/utils → utils}/desktop-dialogs.d.ts.map +0 -0
- /package/{dist/utils → utils}/desktop-dialogs.js +0 -0
- /package/{dist/utils → utils}/eliza-globals.d.ts +0 -0
- /package/{dist/utils → utils}/eliza-globals.d.ts.map +0 -0
- /package/{dist/utils → utils}/eliza-globals.js +0 -0
- /package/{dist/utils → utils}/index.d.ts +0 -0
- /package/{dist/utils → utils}/index.d.ts.map +0 -0
- /package/{dist/utils → utils}/index.js +0 -0
- /package/{dist/utils → utils}/number-parsing.d.ts +0 -0
- /package/{dist/utils → utils}/number-parsing.d.ts.map +0 -0
- /package/{dist/utils → utils}/number-parsing.js +0 -0
- /package/{dist/utils → utils}/openExternalUrl.d.ts +0 -0
- /package/{dist/utils → utils}/openExternalUrl.d.ts.map +0 -0
- /package/{dist/utils → utils}/openExternalUrl.js +0 -0
- /package/{dist/utils → utils}/spoken-text.d.ts +0 -0
- /package/{dist/utils → utils}/spoken-text.d.ts.map +0 -0
- /package/{dist/utils → utils}/spoken-text.js +0 -0
- /package/{dist/utils → utils}/streaming-text.d.ts +0 -0
- /package/{dist/utils → utils}/streaming-text.d.ts.map +0 -0
- /package/{dist/utils → utils}/streaming-text.js +0 -0
- /package/{dist/voice → voice}/index.d.ts +0 -0
- /package/{dist/voice → voice}/index.d.ts.map +0 -0
- /package/{dist/voice → voice}/index.js +0 -0
- /package/{dist/voice → voice}/types.d.ts +0 -0
- /package/{dist/voice → voice}/types.d.ts.map +0 -0
- /package/{dist/voice → voice}/types.js +0 -0
- /package/{dist/wallet-rpc.d.ts → wallet-rpc.d.ts} +0 -0
- /package/{dist/wallet-rpc.d.ts.map → wallet-rpc.d.ts.map} +0 -0
- /package/{dist/wallet-rpc.js → wallet-rpc.js} +0 -0
|
@@ -1,1751 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ui-renderer.tsx — General-purpose json-render declarative UI renderer.
|
|
3
|
-
*
|
|
4
|
-
* Renders a UiSpec tree into React components. Supports:
|
|
5
|
-
* - 35+ component types (layout, typography, form, data, feedback, nav, viz, interaction)
|
|
6
|
-
* - State binding via statePath
|
|
7
|
-
* - Dynamic values via $path references
|
|
8
|
-
* - Conditional props via $cond expressions
|
|
9
|
-
* - List rendering via repeat config
|
|
10
|
-
* - Event bindings via on.press / on.change
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import React, {
|
|
14
|
-
createContext,
|
|
15
|
-
useCallback,
|
|
16
|
-
useContext,
|
|
17
|
-
useMemo,
|
|
18
|
-
useState,
|
|
19
|
-
} from "react";
|
|
20
|
-
import { useApp } from "../state";
|
|
21
|
-
import { confirmDesktopAction, resolveAppAssetUrl } from "../utils";
|
|
22
|
-
import { getByPath, setByPath } from "./config-catalog";
|
|
23
|
-
import type {
|
|
24
|
-
AuthState,
|
|
25
|
-
CondExpr,
|
|
26
|
-
UiAction,
|
|
27
|
-
UiElement,
|
|
28
|
-
UiRenderContext,
|
|
29
|
-
UiSpec,
|
|
30
|
-
ValidationCheck,
|
|
31
|
-
VisibilityCondition,
|
|
32
|
-
} from "./ui-spec";
|
|
33
|
-
|
|
34
|
-
const UiContext = createContext<UiRenderContext | null>(null);
|
|
35
|
-
|
|
36
|
-
const BLOCKED_LINK_PROTOCOLS = new Set([
|
|
37
|
-
"javascript",
|
|
38
|
-
"data",
|
|
39
|
-
"vbscript",
|
|
40
|
-
"file",
|
|
41
|
-
]);
|
|
42
|
-
|
|
43
|
-
function useUiCtx(): UiRenderContext {
|
|
44
|
-
const ctx = useContext(UiContext);
|
|
45
|
-
if (!ctx) throw new Error("UiRenderer context missing");
|
|
46
|
-
return ctx;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// ── Dynamic value resolution ────────────────────────────────────────
|
|
50
|
-
|
|
51
|
-
function resolveProp(value: unknown, ctx: UiRenderContext): unknown {
|
|
52
|
-
if (value == null) return value;
|
|
53
|
-
|
|
54
|
-
// $data.path string prefix (simpler syntax for AI)
|
|
55
|
-
if (typeof value === "string" && value.startsWith("$data.")) {
|
|
56
|
-
const path = value.slice(6); // strip "$data."
|
|
57
|
-
if (path.startsWith("$item/") && ctx.repeatItem) {
|
|
58
|
-
return ctx.repeatItem[path.slice(6)];
|
|
59
|
-
}
|
|
60
|
-
return getByPath(ctx.state, path);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// $path reference
|
|
64
|
-
if (
|
|
65
|
-
typeof value === "object" &&
|
|
66
|
-
"$path" in (value as Record<string, unknown>)
|
|
67
|
-
) {
|
|
68
|
-
const path = (value as { $path: string }).$path;
|
|
69
|
-
if (path.startsWith("$item/") && ctx.repeatItem) {
|
|
70
|
-
return ctx.repeatItem[path.slice(6)];
|
|
71
|
-
}
|
|
72
|
-
return getByPath(ctx.state, path);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
// $cond expression
|
|
76
|
-
if (
|
|
77
|
-
typeof value === "object" &&
|
|
78
|
-
"$cond" in (value as Record<string, unknown>)
|
|
79
|
-
) {
|
|
80
|
-
const expr = value as CondExpr;
|
|
81
|
-
const cond = expr.$cond;
|
|
82
|
-
let result = false;
|
|
83
|
-
|
|
84
|
-
if (cond.eq) {
|
|
85
|
-
const [a, b] = cond.eq.map((v) => resolveProp(v, ctx));
|
|
86
|
-
result = a === b;
|
|
87
|
-
} else if (cond.neq) {
|
|
88
|
-
const [a, b] = cond.neq.map((v) => resolveProp(v, ctx));
|
|
89
|
-
result = a !== b;
|
|
90
|
-
} else if (cond.gt) {
|
|
91
|
-
const [a, b] = cond.gt.map((v) => resolveProp(v, ctx));
|
|
92
|
-
result = Number(a) > Number(b);
|
|
93
|
-
} else if (cond.lt) {
|
|
94
|
-
const [a, b] = cond.lt.map((v) => resolveProp(v, ctx));
|
|
95
|
-
result = Number(a) < Number(b);
|
|
96
|
-
} else if (cond.truthy) {
|
|
97
|
-
result = !!resolveProp(cond.truthy, ctx);
|
|
98
|
-
} else if (cond.falsy) {
|
|
99
|
-
result = !resolveProp(cond.falsy, ctx);
|
|
100
|
-
} else if (cond.path) {
|
|
101
|
-
result = !!getByPath(ctx.state, cond.path);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return result ? resolveProp(expr.$then, ctx) : resolveProp(expr.$else, ctx);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Object with path references
|
|
108
|
-
if (
|
|
109
|
-
typeof value === "object" &&
|
|
110
|
-
value !== null &&
|
|
111
|
-
"path" in (value as Record<string, unknown>)
|
|
112
|
-
) {
|
|
113
|
-
const p = (value as { path: string }).path;
|
|
114
|
-
if (p.startsWith("$item/") && ctx.repeatItem) {
|
|
115
|
-
return ctx.repeatItem[p.slice(6)];
|
|
116
|
-
}
|
|
117
|
-
return getByPath(ctx.state, p);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return value;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function resolveProps(
|
|
124
|
-
props: Record<string, unknown>,
|
|
125
|
-
ctx: UiRenderContext,
|
|
126
|
-
): Record<string, unknown> {
|
|
127
|
-
const resolved: Record<string, unknown> = {};
|
|
128
|
-
for (const [k, v] of Object.entries(props)) {
|
|
129
|
-
resolved[k] = resolveProp(v, ctx);
|
|
130
|
-
}
|
|
131
|
-
return resolved;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// ── Visibility evaluation ────────────────────────────────────────────
|
|
135
|
-
|
|
136
|
-
export function evaluateUiVisibility(
|
|
137
|
-
condition: VisibilityCondition | undefined,
|
|
138
|
-
state: Record<string, unknown>,
|
|
139
|
-
auth?: AuthState,
|
|
140
|
-
): boolean {
|
|
141
|
-
if (!condition) return true;
|
|
142
|
-
|
|
143
|
-
// Path-based
|
|
144
|
-
if ("path" in condition && "operator" in condition) {
|
|
145
|
-
const val = getByPath(state, condition.path);
|
|
146
|
-
const target = condition.value;
|
|
147
|
-
switch (condition.operator) {
|
|
148
|
-
case "eq":
|
|
149
|
-
return val === target;
|
|
150
|
-
case "ne":
|
|
151
|
-
return val !== target;
|
|
152
|
-
case "gt":
|
|
153
|
-
return Number(val) > Number(target);
|
|
154
|
-
case "gte":
|
|
155
|
-
return Number(val) >= Number(target);
|
|
156
|
-
case "lt":
|
|
157
|
-
return Number(val) < Number(target);
|
|
158
|
-
case "lte":
|
|
159
|
-
return Number(val) <= Number(target);
|
|
160
|
-
default:
|
|
161
|
-
return true;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// Auth-based
|
|
166
|
-
if ("auth" in condition) {
|
|
167
|
-
if (!auth) return false;
|
|
168
|
-
switch (condition.auth) {
|
|
169
|
-
case "signedIn":
|
|
170
|
-
return auth.isSignedIn;
|
|
171
|
-
case "signedOut":
|
|
172
|
-
return !auth.isSignedIn;
|
|
173
|
-
case "admin":
|
|
174
|
-
return auth.roles?.includes("admin") ?? false;
|
|
175
|
-
default:
|
|
176
|
-
return auth.roles?.includes(condition.auth) ?? false;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// Logic combinators
|
|
181
|
-
if ("and" in condition)
|
|
182
|
-
return condition.and.every((c) => evaluateUiVisibility(c, state, auth));
|
|
183
|
-
if ("or" in condition)
|
|
184
|
-
return condition.or.some((c) => evaluateUiVisibility(c, state, auth));
|
|
185
|
-
if ("not" in condition)
|
|
186
|
-
return !evaluateUiVisibility(condition.not, state, auth);
|
|
187
|
-
|
|
188
|
-
return true;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export function sanitizeLinkHref(href: unknown): string {
|
|
192
|
-
// Strip ASCII control chars (tab, LF, CR) that browsers silently remove
|
|
193
|
-
// during URL parsing, preventing bypass attacks like "java\nscript:alert(1)".
|
|
194
|
-
const raw = String(href ?? "#")
|
|
195
|
-
.trim()
|
|
196
|
-
.replace(/[\t\n\r]/g, "");
|
|
197
|
-
if (!raw) return "#";
|
|
198
|
-
|
|
199
|
-
// Keep relative/hash links unchanged.
|
|
200
|
-
if (
|
|
201
|
-
raw.startsWith("#") ||
|
|
202
|
-
raw.startsWith("/") ||
|
|
203
|
-
raw.startsWith("./") ||
|
|
204
|
-
raw.startsWith("../") ||
|
|
205
|
-
raw.startsWith("?")
|
|
206
|
-
) {
|
|
207
|
-
return raw;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
const match = /^([a-zA-Z][a-zA-Z\d+.-]*):/.exec(raw);
|
|
211
|
-
if (!match) return raw;
|
|
212
|
-
|
|
213
|
-
const protocol = match[1].toLowerCase();
|
|
214
|
-
if (BLOCKED_LINK_PROTOCOLS.has(protocol)) return "#";
|
|
215
|
-
|
|
216
|
-
return raw;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
// ── Built-in validators ─────────────────────────────────────────────
|
|
220
|
-
|
|
221
|
-
const BUILTIN_VALIDATORS: Record<
|
|
222
|
-
string,
|
|
223
|
-
(value: unknown, args?: Record<string, unknown>) => boolean
|
|
224
|
-
> = {
|
|
225
|
-
required: (v) => v != null && v !== "",
|
|
226
|
-
email: (v) => typeof v === "string" && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v),
|
|
227
|
-
minLength: (v, args) =>
|
|
228
|
-
typeof v === "string" && v.length >= Number(args?.length ?? 0),
|
|
229
|
-
maxLength: (v, args) =>
|
|
230
|
-
typeof v === "string" && v.length <= Number(args?.length ?? Infinity),
|
|
231
|
-
pattern: (v, args) => {
|
|
232
|
-
if (typeof v !== "string" || !args?.pattern) return true;
|
|
233
|
-
try {
|
|
234
|
-
return new RegExp(String(args.pattern)).test(v);
|
|
235
|
-
} catch {
|
|
236
|
-
return true;
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
min: (v, args) => Number(v) >= Number(args?.value ?? -Infinity),
|
|
240
|
-
max: (v, args) => Number(v) <= Number(args?.value ?? Infinity),
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
// ── Validation runner ───────────────────────────────────────────────
|
|
244
|
-
|
|
245
|
-
export function runValidation(
|
|
246
|
-
checks: ValidationCheck[],
|
|
247
|
-
value: unknown,
|
|
248
|
-
customValidators?: Record<
|
|
249
|
-
string,
|
|
250
|
-
(
|
|
251
|
-
value: unknown,
|
|
252
|
-
args?: Record<string, unknown>,
|
|
253
|
-
) => boolean | Promise<boolean>
|
|
254
|
-
>,
|
|
255
|
-
): string[] {
|
|
256
|
-
const errors: string[] = [];
|
|
257
|
-
for (const check of checks) {
|
|
258
|
-
const fn = BUILTIN_VALIDATORS[check.fn] ?? customValidators?.[check.fn];
|
|
259
|
-
if (fn) {
|
|
260
|
-
const result = fn(value, check.args);
|
|
261
|
-
// Handle sync validators only (async handled separately)
|
|
262
|
-
if (result === false) errors.push(check.message);
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
return errors;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
// ── State helpers ───────────────────────────────────────────────────
|
|
269
|
-
|
|
270
|
-
function useStatePath(statePath: string | undefined, ctx: UiRenderContext) {
|
|
271
|
-
const value = statePath ? getByPath(ctx.state, statePath) : undefined;
|
|
272
|
-
const setValue = useCallback(
|
|
273
|
-
(v: unknown) => {
|
|
274
|
-
if (statePath) ctx.setState(statePath, v);
|
|
275
|
-
},
|
|
276
|
-
[statePath, ctx],
|
|
277
|
-
);
|
|
278
|
-
return [value, setValue] as const;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
// ── Fire event action ───────────────────────────────────────────────
|
|
282
|
-
|
|
283
|
-
function fireEvent(action: UiAction | undefined, ctx: UiRenderContext) {
|
|
284
|
-
if (!action) return;
|
|
285
|
-
|
|
286
|
-
const execute = () => {
|
|
287
|
-
if (action.action === "setState" && action.params) {
|
|
288
|
-
const p = action.params as { path: string; value: unknown };
|
|
289
|
-
ctx.setState(p.path, p.value);
|
|
290
|
-
if (action.onSuccess && ctx.onAction) {
|
|
291
|
-
ctx.onAction(action.onSuccess.action, action.onSuccess.params);
|
|
292
|
-
}
|
|
293
|
-
} else if (ctx.onAction) {
|
|
294
|
-
try {
|
|
295
|
-
ctx.onAction(action.action, action.params);
|
|
296
|
-
if (action.onSuccess)
|
|
297
|
-
ctx.onAction(action.onSuccess.action, action.onSuccess.params);
|
|
298
|
-
} catch {
|
|
299
|
-
if (action.onError && ctx.onAction)
|
|
300
|
-
ctx.onAction(action.onError.action, action.onError.params);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
void (async () => {
|
|
306
|
-
if (action.confirm) {
|
|
307
|
-
const ok = await confirmDesktopAction({
|
|
308
|
-
title: action.confirm.title,
|
|
309
|
-
message: action.confirm.message ?? "",
|
|
310
|
-
confirmLabel: "Confirm",
|
|
311
|
-
cancelLabel: "Cancel",
|
|
312
|
-
type: "question",
|
|
313
|
-
});
|
|
314
|
-
if (!ok) return;
|
|
315
|
-
}
|
|
316
|
-
execute();
|
|
317
|
-
})();
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
// ── Gap / size maps ─────────────────────────────────────────────────
|
|
321
|
-
|
|
322
|
-
const GAP: Record<string, string> = {
|
|
323
|
-
none: "gap-0",
|
|
324
|
-
xs: "gap-0.5",
|
|
325
|
-
sm: "gap-1.5",
|
|
326
|
-
md: "gap-3",
|
|
327
|
-
lg: "gap-5",
|
|
328
|
-
xl: "gap-8",
|
|
329
|
-
};
|
|
330
|
-
|
|
331
|
-
const ALIGN: Record<string, string> = {
|
|
332
|
-
start: "items-start",
|
|
333
|
-
center: "items-center",
|
|
334
|
-
end: "items-end",
|
|
335
|
-
stretch: "items-stretch",
|
|
336
|
-
};
|
|
337
|
-
|
|
338
|
-
const JUSTIFY: Record<string, string> = {
|
|
339
|
-
start: "justify-start",
|
|
340
|
-
center: "justify-center",
|
|
341
|
-
end: "justify-end",
|
|
342
|
-
between: "justify-between",
|
|
343
|
-
around: "justify-around",
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
// ── Tailwind class constants ────────────────────────────────────────
|
|
347
|
-
|
|
348
|
-
const INPUT_CLS =
|
|
349
|
-
"w-full px-2 py-[5px] border border-[var(--border)] bg-[var(--card)] text-xs font-[var(--mono)] transition-colors focus:border-[var(--accent)] focus:outline-none box-border h-[30px]";
|
|
350
|
-
|
|
351
|
-
// ══════════════════════════════════════════════════════════════════════
|
|
352
|
-
// COMPONENT REGISTRY
|
|
353
|
-
// ══════════════════════════════════════════════════════════════════════
|
|
354
|
-
|
|
355
|
-
type ComponentFn = (
|
|
356
|
-
props: Record<string, unknown>,
|
|
357
|
-
children: React.ReactNode,
|
|
358
|
-
ctx: UiRenderContext,
|
|
359
|
-
el: UiElement,
|
|
360
|
-
) => React.ReactNode;
|
|
361
|
-
|
|
362
|
-
// ── Layout ──────────────────────────────────────────────────────────
|
|
363
|
-
|
|
364
|
-
const StackComponent: ComponentFn = (props, children) => {
|
|
365
|
-
const dir = props.direction === "horizontal" ? "flex-row" : "flex-col";
|
|
366
|
-
const gap = GAP[String(props.gap ?? "md")] ?? "gap-3";
|
|
367
|
-
const align = ALIGN[String(props.align ?? "stretch")] ?? "";
|
|
368
|
-
const justify = JUSTIFY[String(props.justify ?? "start")] ?? "";
|
|
369
|
-
return (
|
|
370
|
-
<div className={`flex ${dir} ${gap} ${align} ${justify}`}>{children}</div>
|
|
371
|
-
);
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
const GridComponent: ComponentFn = (props, children) => {
|
|
375
|
-
const cols = Number(props.columns ?? 2);
|
|
376
|
-
const gap = GAP[String(props.gap ?? "md")] ?? "gap-3";
|
|
377
|
-
return (
|
|
378
|
-
<div
|
|
379
|
-
className={`grid ${gap}`}
|
|
380
|
-
style={{ gridTemplateColumns: `repeat(${cols}, 1fr)` }}
|
|
381
|
-
>
|
|
382
|
-
{children}
|
|
383
|
-
</div>
|
|
384
|
-
);
|
|
385
|
-
};
|
|
386
|
-
|
|
387
|
-
const CardComponent: ComponentFn = (props, children) => {
|
|
388
|
-
const maxW = props.maxWidth === "full" ? "max-w-full" : "";
|
|
389
|
-
return (
|
|
390
|
-
<div
|
|
391
|
-
className={`border border-[var(--border)] bg-[var(--card)] p-4 ${maxW}`}
|
|
392
|
-
>
|
|
393
|
-
{props.title ? (
|
|
394
|
-
<div className="font-bold text-sm mb-0.5">{String(props.title)}</div>
|
|
395
|
-
) : null}
|
|
396
|
-
{props.description ? (
|
|
397
|
-
<div className="text-xs text-[var(--muted)] mb-3">
|
|
398
|
-
{String(props.description)}
|
|
399
|
-
</div>
|
|
400
|
-
) : null}
|
|
401
|
-
{children}
|
|
402
|
-
</div>
|
|
403
|
-
);
|
|
404
|
-
};
|
|
405
|
-
|
|
406
|
-
const SeparatorComponent: ComponentFn = (props) => {
|
|
407
|
-
const isVert = props.orientation === "vertical";
|
|
408
|
-
return isVert ? (
|
|
409
|
-
<div className="w-px bg-[var(--border)] self-stretch" />
|
|
410
|
-
) : (
|
|
411
|
-
<hr className="border-t border-[var(--border)] my-2" />
|
|
412
|
-
);
|
|
413
|
-
};
|
|
414
|
-
|
|
415
|
-
// ── Typography ──────────────────────────────────────────────────────
|
|
416
|
-
|
|
417
|
-
const HeadingComponent: ComponentFn = (props) => {
|
|
418
|
-
const text = String(props.text ?? "");
|
|
419
|
-
const level = String(props.level ?? "h2");
|
|
420
|
-
const cls =
|
|
421
|
-
level === "h1"
|
|
422
|
-
? "text-xl font-bold"
|
|
423
|
-
: level === "h3"
|
|
424
|
-
? "text-sm font-bold"
|
|
425
|
-
: "text-base font-bold";
|
|
426
|
-
return <div className={cls}>{text}</div>;
|
|
427
|
-
};
|
|
428
|
-
|
|
429
|
-
const TextComponent: ComponentFn = (props) => {
|
|
430
|
-
const text = String(props.text ?? "");
|
|
431
|
-
const variant = String(props.variant ?? "body");
|
|
432
|
-
const cls: Record<string, string> = {
|
|
433
|
-
body: "text-sm",
|
|
434
|
-
caption: "text-xs text-[var(--muted)]",
|
|
435
|
-
muted: "text-sm text-[var(--muted)]",
|
|
436
|
-
lead: "text-sm font-medium",
|
|
437
|
-
code: "text-xs font-mono bg-[var(--bg-hover)] px-1.5 py-0.5 border border-[var(--border)]",
|
|
438
|
-
};
|
|
439
|
-
return <div className={cls[variant] ?? "text-sm"}>{text}</div>;
|
|
440
|
-
};
|
|
441
|
-
|
|
442
|
-
// ── Form ────────────────────────────────────────────────────────────
|
|
443
|
-
|
|
444
|
-
const InputComponent: ComponentFn = (props, _children, ctx, el) => {
|
|
445
|
-
const [value, setValue] = useStatePath(
|
|
446
|
-
props.statePath as string | undefined,
|
|
447
|
-
ctx,
|
|
448
|
-
);
|
|
449
|
-
const sp = props.statePath as string | undefined;
|
|
450
|
-
const errors = sp ? ctx.fieldErrors?.[sp] : undefined;
|
|
451
|
-
const validateOn = el.validation?.validateOn ?? "blur";
|
|
452
|
-
|
|
453
|
-
const handleChange = (v: string) => {
|
|
454
|
-
setValue(v);
|
|
455
|
-
if (validateOn === "change" && sp && ctx.validateField)
|
|
456
|
-
ctx.validateField(sp);
|
|
457
|
-
};
|
|
458
|
-
const handleBlur = () => {
|
|
459
|
-
if (validateOn === "blur" && sp && ctx.validateField) ctx.validateField(sp);
|
|
460
|
-
};
|
|
461
|
-
|
|
462
|
-
return (
|
|
463
|
-
<div className="flex flex-col gap-1">
|
|
464
|
-
{props.label ? (
|
|
465
|
-
<span className="text-xs font-semibold">{String(props.label)}</span>
|
|
466
|
-
) : null}
|
|
467
|
-
<input
|
|
468
|
-
className={`${INPUT_CLS}${errors?.length ? " border-[var(--destructive)]" : ""}`}
|
|
469
|
-
type={String(props.type ?? "text")}
|
|
470
|
-
name={String(props.name ?? "")}
|
|
471
|
-
placeholder={String(props.placeholder ?? "")}
|
|
472
|
-
value={String(value ?? "")}
|
|
473
|
-
onChange={(e) => handleChange(e.target.value)}
|
|
474
|
-
onBlur={handleBlur}
|
|
475
|
-
/>
|
|
476
|
-
{errors?.length ? (
|
|
477
|
-
<div className="flex flex-col gap-0.5">
|
|
478
|
-
{errors.map((err) => (
|
|
479
|
-
<span key={err} className="text-[10px] text-[var(--destructive)]">
|
|
480
|
-
{err}
|
|
481
|
-
</span>
|
|
482
|
-
))}
|
|
483
|
-
</div>
|
|
484
|
-
) : null}
|
|
485
|
-
</div>
|
|
486
|
-
);
|
|
487
|
-
};
|
|
488
|
-
|
|
489
|
-
const TextareaComponent: ComponentFn = (props, _children, ctx, el) => {
|
|
490
|
-
const [value, setValue] = useStatePath(
|
|
491
|
-
props.statePath as string | undefined,
|
|
492
|
-
ctx,
|
|
493
|
-
);
|
|
494
|
-
const sp = props.statePath as string | undefined;
|
|
495
|
-
const errors = sp ? ctx.fieldErrors?.[sp] : undefined;
|
|
496
|
-
const validateOn = el.validation?.validateOn ?? "blur";
|
|
497
|
-
|
|
498
|
-
const handleChange = (v: string) => {
|
|
499
|
-
setValue(v);
|
|
500
|
-
if (validateOn === "change" && sp && ctx.validateField)
|
|
501
|
-
ctx.validateField(sp);
|
|
502
|
-
};
|
|
503
|
-
const handleBlur = () => {
|
|
504
|
-
if (validateOn === "blur" && sp && ctx.validateField) ctx.validateField(sp);
|
|
505
|
-
};
|
|
506
|
-
|
|
507
|
-
return (
|
|
508
|
-
<div className="flex flex-col gap-1">
|
|
509
|
-
{props.label ? (
|
|
510
|
-
<span className="text-xs font-semibold">{String(props.label)}</span>
|
|
511
|
-
) : null}
|
|
512
|
-
<textarea
|
|
513
|
-
className={`w-full px-2 py-[5px] border border-[var(--border)] bg-[var(--card)] text-xs font-[var(--mono)] transition-colors focus:border-[var(--accent)] focus:outline-none box-border min-h-[64px] resize-y${errors?.length ? " border-[var(--destructive)]" : ""}`}
|
|
514
|
-
name={String(props.name ?? "")}
|
|
515
|
-
placeholder={String(props.placeholder ?? "")}
|
|
516
|
-
rows={Number(props.rows ?? 3)}
|
|
517
|
-
value={String(value ?? "")}
|
|
518
|
-
onChange={(e) => handleChange(e.target.value)}
|
|
519
|
-
onBlur={handleBlur}
|
|
520
|
-
/>
|
|
521
|
-
{errors?.length ? (
|
|
522
|
-
<div className="flex flex-col gap-0.5">
|
|
523
|
-
{errors.map((err) => (
|
|
524
|
-
<span key={err} className="text-[10px] text-[var(--destructive)]">
|
|
525
|
-
{err}
|
|
526
|
-
</span>
|
|
527
|
-
))}
|
|
528
|
-
</div>
|
|
529
|
-
) : null}
|
|
530
|
-
</div>
|
|
531
|
-
);
|
|
532
|
-
};
|
|
533
|
-
|
|
534
|
-
const SelectComponent: ComponentFn = (props, _children, ctx, el) => {
|
|
535
|
-
const [value, setValue] = useStatePath(
|
|
536
|
-
props.statePath as string | undefined,
|
|
537
|
-
ctx,
|
|
538
|
-
);
|
|
539
|
-
const options =
|
|
540
|
-
(props.options as Array<{ label: string; value: string }>) ?? [];
|
|
541
|
-
const sp = props.statePath as string | undefined;
|
|
542
|
-
const errors = sp ? ctx.fieldErrors?.[sp] : undefined;
|
|
543
|
-
const validateOn = el.validation?.validateOn ?? "blur";
|
|
544
|
-
|
|
545
|
-
const handleChange = (v: string) => {
|
|
546
|
-
setValue(v);
|
|
547
|
-
if (validateOn === "change" && sp && ctx.validateField)
|
|
548
|
-
ctx.validateField(sp);
|
|
549
|
-
};
|
|
550
|
-
const handleBlur = () => {
|
|
551
|
-
if (validateOn === "blur" && sp && ctx.validateField) ctx.validateField(sp);
|
|
552
|
-
};
|
|
553
|
-
|
|
554
|
-
return (
|
|
555
|
-
<div className="flex flex-col gap-1">
|
|
556
|
-
{props.label ? (
|
|
557
|
-
<span className="text-xs font-semibold">{String(props.label)}</span>
|
|
558
|
-
) : null}
|
|
559
|
-
<select
|
|
560
|
-
className={`${INPUT_CLS} appearance-auto${errors?.length ? " border-[var(--destructive)]" : ""}`}
|
|
561
|
-
value={String(value ?? "")}
|
|
562
|
-
onChange={(e) => handleChange(e.target.value)}
|
|
563
|
-
onBlur={handleBlur}
|
|
564
|
-
>
|
|
565
|
-
{props.placeholder ? (
|
|
566
|
-
<option value="">{String(props.placeholder)}</option>
|
|
567
|
-
) : null}
|
|
568
|
-
{options.map((o) => (
|
|
569
|
-
<option key={o.value} value={o.value}>
|
|
570
|
-
{o.label}
|
|
571
|
-
</option>
|
|
572
|
-
))}
|
|
573
|
-
</select>
|
|
574
|
-
{errors?.length ? (
|
|
575
|
-
<div className="flex flex-col gap-0.5">
|
|
576
|
-
{errors.map((err) => (
|
|
577
|
-
<span key={err} className="text-[10px] text-[var(--destructive)]">
|
|
578
|
-
{err}
|
|
579
|
-
</span>
|
|
580
|
-
))}
|
|
581
|
-
</div>
|
|
582
|
-
) : null}
|
|
583
|
-
</div>
|
|
584
|
-
);
|
|
585
|
-
};
|
|
586
|
-
|
|
587
|
-
const CheckboxComponent: ComponentFn = (props, _children, ctx) => {
|
|
588
|
-
const [value, setValue] = useStatePath(
|
|
589
|
-
props.statePath as string | undefined,
|
|
590
|
-
ctx,
|
|
591
|
-
);
|
|
592
|
-
return (
|
|
593
|
-
<span className="flex items-center gap-2 text-xs cursor-pointer">
|
|
594
|
-
<input
|
|
595
|
-
type="checkbox"
|
|
596
|
-
checked={!!value}
|
|
597
|
-
onChange={(e) => setValue(e.target.checked)}
|
|
598
|
-
/>
|
|
599
|
-
<span className="font-semibold">{String(props.label ?? "")}</span>
|
|
600
|
-
</span>
|
|
601
|
-
);
|
|
602
|
-
};
|
|
603
|
-
|
|
604
|
-
const RadioComponent: ComponentFn = (props, _children, ctx) => {
|
|
605
|
-
const [value, setValue] = useStatePath(
|
|
606
|
-
props.statePath as string | undefined,
|
|
607
|
-
ctx,
|
|
608
|
-
);
|
|
609
|
-
const options =
|
|
610
|
-
(props.options as Array<{ label: string; value: string }>) ?? [];
|
|
611
|
-
return (
|
|
612
|
-
<div className="flex flex-col gap-1">
|
|
613
|
-
{props.label ? (
|
|
614
|
-
<span className="text-xs font-semibold mb-0.5">
|
|
615
|
-
{String(props.label)}
|
|
616
|
-
</span>
|
|
617
|
-
) : null}
|
|
618
|
-
{options.map((o) => (
|
|
619
|
-
<span
|
|
620
|
-
key={o.value}
|
|
621
|
-
className="flex items-center gap-2 text-xs cursor-pointer"
|
|
622
|
-
>
|
|
623
|
-
<input
|
|
624
|
-
type="radio"
|
|
625
|
-
name={String(props.name ?? "")}
|
|
626
|
-
value={o.value}
|
|
627
|
-
checked={value === o.value}
|
|
628
|
-
onChange={() => setValue(o.value)}
|
|
629
|
-
/>
|
|
630
|
-
<span>{o.label}</span>
|
|
631
|
-
</span>
|
|
632
|
-
))}
|
|
633
|
-
</div>
|
|
634
|
-
);
|
|
635
|
-
};
|
|
636
|
-
|
|
637
|
-
const SwitchComponent: ComponentFn = (props, _children, ctx) => {
|
|
638
|
-
const [value, setValue] = useStatePath(
|
|
639
|
-
props.statePath as string | undefined,
|
|
640
|
-
ctx,
|
|
641
|
-
);
|
|
642
|
-
const checked = !!value;
|
|
643
|
-
return (
|
|
644
|
-
<span className="flex items-center gap-2 cursor-pointer">
|
|
645
|
-
<button
|
|
646
|
-
type="button"
|
|
647
|
-
className={`relative w-9 h-[18px] transition-colors ${checked ? "bg-[var(--accent)]" : "bg-[var(--muted)]"}`}
|
|
648
|
-
onClick={() => setValue(!checked)}
|
|
649
|
-
>
|
|
650
|
-
<div
|
|
651
|
-
className={`absolute top-0.5 w-[14px] h-[14px] bg-white transition-all ${checked ? "left-5" : "left-0.5"}`}
|
|
652
|
-
/>
|
|
653
|
-
</button>
|
|
654
|
-
<span className="text-xs font-semibold">{String(props.label ?? "")}</span>
|
|
655
|
-
</span>
|
|
656
|
-
);
|
|
657
|
-
};
|
|
658
|
-
|
|
659
|
-
const SliderComponent: ComponentFn = (props, _children, ctx) => {
|
|
660
|
-
const [value, setValue] = useStatePath(
|
|
661
|
-
props.statePath as string | undefined,
|
|
662
|
-
ctx,
|
|
663
|
-
);
|
|
664
|
-
return (
|
|
665
|
-
<div className="flex flex-col gap-1">
|
|
666
|
-
{props.label ? (
|
|
667
|
-
<div className="flex justify-between text-xs">
|
|
668
|
-
<span className="font-semibold">{String(props.label)}</span>
|
|
669
|
-
<span className="text-[var(--muted)]">
|
|
670
|
-
{String(value ?? props.min ?? 0)}
|
|
671
|
-
</span>
|
|
672
|
-
</div>
|
|
673
|
-
) : null}
|
|
674
|
-
<input
|
|
675
|
-
type="range"
|
|
676
|
-
min={Number(props.min ?? 0)}
|
|
677
|
-
max={Number(props.max ?? 100)}
|
|
678
|
-
step={Number(props.step ?? 1)}
|
|
679
|
-
value={Number(value ?? props.min ?? 0)}
|
|
680
|
-
onChange={(e) => setValue(Number(e.target.value))}
|
|
681
|
-
className="w-full"
|
|
682
|
-
style={{ accentColor: "var(--accent)" }}
|
|
683
|
-
/>
|
|
684
|
-
</div>
|
|
685
|
-
);
|
|
686
|
-
};
|
|
687
|
-
|
|
688
|
-
const ToggleComponent: ComponentFn = (props, _children, ctx, el) => {
|
|
689
|
-
const [value, setValue] = useStatePath(
|
|
690
|
-
props.statePath as string | undefined,
|
|
691
|
-
ctx,
|
|
692
|
-
);
|
|
693
|
-
const pressed = !!value;
|
|
694
|
-
return (
|
|
695
|
-
<button
|
|
696
|
-
type="button"
|
|
697
|
-
className={`px-3 py-1.5 text-xs border cursor-pointer transition-colors ${
|
|
698
|
-
pressed
|
|
699
|
-
? "bg-[var(--accent)] text-[var(--accent-foreground,#1a1f26)] border-[var(--accent)]"
|
|
700
|
-
: "bg-[var(--card)] text-[var(--text)] border-[var(--border)] hover:bg-[var(--bg-hover)]"
|
|
701
|
-
}`}
|
|
702
|
-
onClick={() => {
|
|
703
|
-
setValue(!pressed);
|
|
704
|
-
fireEvent(el.on?.press, ctx);
|
|
705
|
-
}}
|
|
706
|
-
>
|
|
707
|
-
{String(props.label ?? "Toggle")}
|
|
708
|
-
</button>
|
|
709
|
-
);
|
|
710
|
-
};
|
|
711
|
-
|
|
712
|
-
const ToggleGroupComponent: ComponentFn = (props, _children, ctx) => {
|
|
713
|
-
const [value, setValue] = useStatePath(
|
|
714
|
-
props.statePath as string | undefined,
|
|
715
|
-
ctx,
|
|
716
|
-
);
|
|
717
|
-
const items = (props.items as Array<{ label: string; value: string }>) ?? [];
|
|
718
|
-
const isMultiple = props.type === "multiple";
|
|
719
|
-
const selected = new Set(Array.isArray(value) ? (value as string[]) : []);
|
|
720
|
-
|
|
721
|
-
const toggle = (v: string) => {
|
|
722
|
-
if (isMultiple) {
|
|
723
|
-
const next = new Set(selected);
|
|
724
|
-
if (next.has(v)) next.delete(v);
|
|
725
|
-
else next.add(v);
|
|
726
|
-
setValue([...next]);
|
|
727
|
-
} else {
|
|
728
|
-
setValue(v);
|
|
729
|
-
}
|
|
730
|
-
};
|
|
731
|
-
|
|
732
|
-
return (
|
|
733
|
-
<div className="flex gap-1">
|
|
734
|
-
{items.map((item) => {
|
|
735
|
-
const active = isMultiple
|
|
736
|
-
? selected.has(item.value)
|
|
737
|
-
: value === item.value;
|
|
738
|
-
return (
|
|
739
|
-
<button
|
|
740
|
-
key={item.value}
|
|
741
|
-
type="button"
|
|
742
|
-
className={`px-2.5 py-1 text-xs border cursor-pointer transition-colors ${
|
|
743
|
-
active
|
|
744
|
-
? "bg-[var(--accent)] text-[var(--accent-foreground,#1a1f26)] border-[var(--accent)]"
|
|
745
|
-
: "bg-[var(--card)] text-[var(--text)] border-[var(--border)] hover:bg-[var(--bg-hover)]"
|
|
746
|
-
}`}
|
|
747
|
-
onClick={() => toggle(item.value)}
|
|
748
|
-
>
|
|
749
|
-
{item.label}
|
|
750
|
-
</button>
|
|
751
|
-
);
|
|
752
|
-
})}
|
|
753
|
-
</div>
|
|
754
|
-
);
|
|
755
|
-
};
|
|
756
|
-
|
|
757
|
-
const ButtonGroupComponent: ComponentFn = (props, _children, ctx) => {
|
|
758
|
-
const [value, setValue] = useStatePath(
|
|
759
|
-
props.statePath as string | undefined,
|
|
760
|
-
ctx,
|
|
761
|
-
);
|
|
762
|
-
const buttons =
|
|
763
|
-
(props.buttons as Array<{ label: string; value: string }>) ?? [];
|
|
764
|
-
return (
|
|
765
|
-
<div className="flex gap-1">
|
|
766
|
-
{buttons.map((btn) => {
|
|
767
|
-
const active = value === btn.value;
|
|
768
|
-
return (
|
|
769
|
-
<button
|
|
770
|
-
key={btn.value}
|
|
771
|
-
type="button"
|
|
772
|
-
className={`px-3 py-1.5 text-xs border cursor-pointer transition-colors ${
|
|
773
|
-
active
|
|
774
|
-
? "bg-[var(--accent)] text-[var(--accent-foreground,#1a1f26)] border-[var(--accent)]"
|
|
775
|
-
: "bg-[var(--card)] text-[var(--text)] border-[var(--border)] hover:bg-[var(--bg-hover)]"
|
|
776
|
-
}`}
|
|
777
|
-
onClick={() => setValue(btn.value)}
|
|
778
|
-
>
|
|
779
|
-
{btn.label}
|
|
780
|
-
</button>
|
|
781
|
-
);
|
|
782
|
-
})}
|
|
783
|
-
</div>
|
|
784
|
-
);
|
|
785
|
-
};
|
|
786
|
-
|
|
787
|
-
// ── Data Display ────────────────────────────────────────────────────
|
|
788
|
-
|
|
789
|
-
const TableComponent: ComponentFn = (props) => {
|
|
790
|
-
const columns = (props.columns as string[]) ?? [];
|
|
791
|
-
const rows = (props.rows as string[][]) ?? [];
|
|
792
|
-
return (
|
|
793
|
-
<div className="overflow-x-auto">
|
|
794
|
-
{props.caption ? (
|
|
795
|
-
<div className="text-xs font-semibold mb-1.5">
|
|
796
|
-
{String(props.caption)}
|
|
797
|
-
</div>
|
|
798
|
-
) : null}
|
|
799
|
-
<table className="w-full text-xs border-collapse">
|
|
800
|
-
<thead>
|
|
801
|
-
<tr>
|
|
802
|
-
{columns.map((col) => (
|
|
803
|
-
<th
|
|
804
|
-
key={col}
|
|
805
|
-
className="text-left px-2.5 py-1.5 border-b border-[var(--border)] font-semibold text-[var(--muted)]"
|
|
806
|
-
>
|
|
807
|
-
{col}
|
|
808
|
-
</th>
|
|
809
|
-
))}
|
|
810
|
-
</tr>
|
|
811
|
-
</thead>
|
|
812
|
-
<tbody>
|
|
813
|
-
{rows.map((row) => (
|
|
814
|
-
<tr
|
|
815
|
-
key={row.join("|")}
|
|
816
|
-
className="border-b border-[var(--border)] last:border-b-0"
|
|
817
|
-
>
|
|
818
|
-
{row.map((cell) => (
|
|
819
|
-
<td key={cell} className="px-2.5 py-1.5">
|
|
820
|
-
{cell}
|
|
821
|
-
</td>
|
|
822
|
-
))}
|
|
823
|
-
</tr>
|
|
824
|
-
))}
|
|
825
|
-
</tbody>
|
|
826
|
-
</table>
|
|
827
|
-
</div>
|
|
828
|
-
);
|
|
829
|
-
};
|
|
830
|
-
|
|
831
|
-
const CarouselComponent: ComponentFn = (props) => {
|
|
832
|
-
const { t } = useApp();
|
|
833
|
-
const items =
|
|
834
|
-
(props.items as Array<{ title: string; description: string }>) ?? [];
|
|
835
|
-
const [current, setCurrent] = useState(0);
|
|
836
|
-
return (
|
|
837
|
-
<div className="relative">
|
|
838
|
-
<div className="border border-[var(--border)] bg-[var(--bg-hover)] p-4 min-h-[60px]">
|
|
839
|
-
{items[current] && (
|
|
840
|
-
<div>
|
|
841
|
-
<div className="text-xs font-bold">{items[current].title}</div>
|
|
842
|
-
<div className="text-xs text-[var(--muted)] mt-0.5">
|
|
843
|
-
{items[current].description}
|
|
844
|
-
</div>
|
|
845
|
-
</div>
|
|
846
|
-
)}
|
|
847
|
-
</div>
|
|
848
|
-
<div className="flex justify-center gap-2 mt-2">
|
|
849
|
-
<button
|
|
850
|
-
type="button"
|
|
851
|
-
className="text-xs px-2 py-0.5 border border-[var(--border)] bg-[var(--card)] cursor-pointer hover:bg-[var(--bg-hover)]"
|
|
852
|
-
onClick={() => setCurrent((p) => Math.max(0, p - 1))}
|
|
853
|
-
disabled={current === 0}
|
|
854
|
-
>
|
|
855
|
-
{t("ui-renderer.Larr")}
|
|
856
|
-
</button>
|
|
857
|
-
<span className="text-[10px] text-[var(--muted)] self-center">
|
|
858
|
-
{current + 1} / {items.length}
|
|
859
|
-
</span>
|
|
860
|
-
<button
|
|
861
|
-
type="button"
|
|
862
|
-
className="text-xs px-2 py-0.5 border border-[var(--border)] bg-[var(--card)] cursor-pointer hover:bg-[var(--bg-hover)]"
|
|
863
|
-
onClick={() => setCurrent((p) => Math.min(items.length - 1, p + 1))}
|
|
864
|
-
disabled={current === items.length - 1}
|
|
865
|
-
>
|
|
866
|
-
{t("ui-renderer.Rarr")}
|
|
867
|
-
</button>
|
|
868
|
-
</div>
|
|
869
|
-
</div>
|
|
870
|
-
);
|
|
871
|
-
};
|
|
872
|
-
|
|
873
|
-
const BadgeComponent: ComponentFn = (props) => {
|
|
874
|
-
const variant = String(props.variant ?? "default");
|
|
875
|
-
const cls: Record<string, string> = {
|
|
876
|
-
default: "bg-[var(--surface)] text-[var(--text)] border-[var(--border)]",
|
|
877
|
-
success: "bg-[rgba(22,163,106,0.1)] text-[var(--ok)] border-[var(--ok)]",
|
|
878
|
-
warning:
|
|
879
|
-
"bg-[rgba(243,156,18,0.1)] text-[var(--warn,#f39c12)] border-[var(--warn,#f39c12)]",
|
|
880
|
-
error:
|
|
881
|
-
"bg-[rgba(231,76,60,0.1)] text-[var(--destructive)] border-[var(--destructive)]",
|
|
882
|
-
info: "bg-[rgba(52,152,219,0.1)] text-[var(--accent)] border-[var(--accent)]",
|
|
883
|
-
};
|
|
884
|
-
return (
|
|
885
|
-
<span
|
|
886
|
-
className={`inline-block text-[10px] font-medium px-2 py-0.5 border ${cls[variant] ?? cls.default}`}
|
|
887
|
-
>
|
|
888
|
-
{String(props.text ?? "")}
|
|
889
|
-
</span>
|
|
890
|
-
);
|
|
891
|
-
};
|
|
892
|
-
|
|
893
|
-
const AvatarComponent: ComponentFn = (props) => {
|
|
894
|
-
const name = String(props.name ?? "?");
|
|
895
|
-
const size =
|
|
896
|
-
props.size === "lg"
|
|
897
|
-
? "w-10 h-10 text-sm"
|
|
898
|
-
: props.size === "sm"
|
|
899
|
-
? "w-6 h-6 text-[10px]"
|
|
900
|
-
: "w-8 h-8 text-xs";
|
|
901
|
-
const initials = name
|
|
902
|
-
.split(" ")
|
|
903
|
-
.map((w) => w[0])
|
|
904
|
-
.join("")
|
|
905
|
-
.slice(0, 2)
|
|
906
|
-
.toUpperCase();
|
|
907
|
-
return (
|
|
908
|
-
<div
|
|
909
|
-
className={`${size} rounded-full bg-[var(--accent)] text-[var(--accent-foreground,#1a1f26)] flex items-center justify-center font-bold shrink-0`}
|
|
910
|
-
>
|
|
911
|
-
{initials}
|
|
912
|
-
</div>
|
|
913
|
-
);
|
|
914
|
-
};
|
|
915
|
-
|
|
916
|
-
const ImageComponent: ComponentFn = (props) => {
|
|
917
|
-
const src = props.src as string | undefined;
|
|
918
|
-
const resolvedSrc = src ? resolveAppAssetUrl(src) : undefined;
|
|
919
|
-
const alt = String(props.alt ?? "");
|
|
920
|
-
const w = props.width ? `${props.width}px` : "auto";
|
|
921
|
-
const h = props.height ? `${props.height}px` : "auto";
|
|
922
|
-
return resolvedSrc ? (
|
|
923
|
-
<img
|
|
924
|
-
src={resolvedSrc}
|
|
925
|
-
alt={alt}
|
|
926
|
-
style={{ width: w, height: h }}
|
|
927
|
-
className="object-cover border border-[var(--border)]"
|
|
928
|
-
/>
|
|
929
|
-
) : (
|
|
930
|
-
<div
|
|
931
|
-
className="bg-[var(--bg-hover)] border border-[var(--border)] flex items-center justify-center text-xs text-[var(--muted)]"
|
|
932
|
-
style={{ width: w, height: h }}
|
|
933
|
-
>
|
|
934
|
-
{alt || "Image"}
|
|
935
|
-
</div>
|
|
936
|
-
);
|
|
937
|
-
};
|
|
938
|
-
|
|
939
|
-
// ── Feedback ────────────────────────────────────────────────────────
|
|
940
|
-
|
|
941
|
-
const AlertComponent: ComponentFn = (props) => {
|
|
942
|
-
const type = String(props.type ?? "info");
|
|
943
|
-
const borderCls: Record<string, string> = {
|
|
944
|
-
info: "border-[var(--accent)]",
|
|
945
|
-
success: "border-[var(--ok)]",
|
|
946
|
-
warning: "border-[var(--warn,#f39c12)]",
|
|
947
|
-
error: "border-[var(--destructive)]",
|
|
948
|
-
};
|
|
949
|
-
const textCls: Record<string, string> = {
|
|
950
|
-
info: "text-[var(--accent)]",
|
|
951
|
-
success: "text-[var(--ok)]",
|
|
952
|
-
warning: "text-[var(--warn,#f39c12)]",
|
|
953
|
-
error: "text-[var(--destructive)]",
|
|
954
|
-
};
|
|
955
|
-
return (
|
|
956
|
-
<div
|
|
957
|
-
className={`border-l-[3px] ${borderCls[type] ?? ""} bg-[var(--bg-hover)] px-3 py-2`}
|
|
958
|
-
>
|
|
959
|
-
{props.title ? (
|
|
960
|
-
<div className={`text-xs font-bold ${textCls[type] ?? ""}`}>
|
|
961
|
-
{String(props.title)}
|
|
962
|
-
</div>
|
|
963
|
-
) : null}
|
|
964
|
-
{props.message ? (
|
|
965
|
-
<div className="text-xs text-[var(--text)] mt-0.5">
|
|
966
|
-
{String(props.message)}
|
|
967
|
-
</div>
|
|
968
|
-
) : null}
|
|
969
|
-
</div>
|
|
970
|
-
);
|
|
971
|
-
};
|
|
972
|
-
|
|
973
|
-
const ProgressComponent: ComponentFn = (props) => {
|
|
974
|
-
const value = Number(props.value ?? 0);
|
|
975
|
-
const max = Number(props.max ?? 100);
|
|
976
|
-
const pct = Math.min(100, Math.max(0, (value / max) * 100));
|
|
977
|
-
return (
|
|
978
|
-
<div className="flex flex-col gap-1">
|
|
979
|
-
{props.label ? (
|
|
980
|
-
<div className="flex justify-between text-xs">
|
|
981
|
-
<span className="font-semibold">{String(props.label)}</span>
|
|
982
|
-
<span className="text-[var(--muted)]">{Math.round(pct)}%</span>
|
|
983
|
-
</div>
|
|
984
|
-
) : null}
|
|
985
|
-
<div className="w-full h-2 bg-[var(--bg-hover)] border border-[var(--border)] overflow-hidden">
|
|
986
|
-
<div
|
|
987
|
-
className="h-full bg-[var(--accent)] transition-[width] duration-300"
|
|
988
|
-
style={{ width: `${pct}%` }}
|
|
989
|
-
/>
|
|
990
|
-
</div>
|
|
991
|
-
</div>
|
|
992
|
-
);
|
|
993
|
-
};
|
|
994
|
-
|
|
995
|
-
const RatingComponent: ComponentFn = (props) => {
|
|
996
|
-
const value = Number(props.value ?? 0);
|
|
997
|
-
const max = Number(props.max ?? 5);
|
|
998
|
-
return (
|
|
999
|
-
<div className="flex flex-col gap-1">
|
|
1000
|
-
{props.label ? (
|
|
1001
|
-
<div className="text-xs font-semibold">{String(props.label)}</div>
|
|
1002
|
-
) : null}
|
|
1003
|
-
<div className="flex gap-0.5">
|
|
1004
|
-
{Array.from({ length: max }, (_, i) => i + 1).map((starValue) => (
|
|
1005
|
-
<span
|
|
1006
|
-
key={starValue}
|
|
1007
|
-
className={`text-sm ${starValue <= value ? "text-[var(--warn,#f39c12)]" : "text-[var(--muted)] opacity-30"}`}
|
|
1008
|
-
>
|
|
1009
|
-
★
|
|
1010
|
-
</span>
|
|
1011
|
-
))}
|
|
1012
|
-
</div>
|
|
1013
|
-
</div>
|
|
1014
|
-
);
|
|
1015
|
-
};
|
|
1016
|
-
|
|
1017
|
-
const SkeletonComponent: ComponentFn = (props) => {
|
|
1018
|
-
const w = props.width ? String(props.width) : "100%";
|
|
1019
|
-
const h = props.height ? String(props.height) : "20px";
|
|
1020
|
-
const rounded = props.rounded ? "rounded" : "";
|
|
1021
|
-
return (
|
|
1022
|
-
<div
|
|
1023
|
-
className={`bg-[var(--bg-hover)] animate-pulse ${rounded}`}
|
|
1024
|
-
style={{ width: w, height: h }}
|
|
1025
|
-
/>
|
|
1026
|
-
);
|
|
1027
|
-
};
|
|
1028
|
-
|
|
1029
|
-
const SpinnerComponent: ComponentFn = (props) => {
|
|
1030
|
-
const size =
|
|
1031
|
-
props.size === "lg"
|
|
1032
|
-
? "w-8 h-8"
|
|
1033
|
-
: props.size === "sm"
|
|
1034
|
-
? "w-4 h-4"
|
|
1035
|
-
: "w-6 h-6";
|
|
1036
|
-
return (
|
|
1037
|
-
<div className="flex items-center gap-2">
|
|
1038
|
-
<div
|
|
1039
|
-
className={`${size} border-2 border-[var(--border)] border-t-[var(--accent)] rounded-full animate-spin`}
|
|
1040
|
-
/>
|
|
1041
|
-
{props.label ? (
|
|
1042
|
-
<span className="text-xs text-[var(--muted)]">
|
|
1043
|
-
{String(props.label)}
|
|
1044
|
-
</span>
|
|
1045
|
-
) : null}
|
|
1046
|
-
</div>
|
|
1047
|
-
);
|
|
1048
|
-
};
|
|
1049
|
-
|
|
1050
|
-
// ── Navigation ──────────────────────────────────────────────────────
|
|
1051
|
-
|
|
1052
|
-
const ButtonComponent: ComponentFn = (props, _children, ctx, el) => {
|
|
1053
|
-
const variant = String(props.variant ?? "primary");
|
|
1054
|
-
const cls: Record<string, string> = {
|
|
1055
|
-
primary:
|
|
1056
|
-
"bg-[var(--accent)] text-[var(--accent-foreground,#1a1f26)] border-[var(--accent)] hover:opacity-90",
|
|
1057
|
-
secondary:
|
|
1058
|
-
"bg-[var(--card)] text-[var(--text)] border-[var(--border)] hover:bg-[var(--bg-hover)]",
|
|
1059
|
-
danger:
|
|
1060
|
-
"bg-[var(--destructive)] text-white border-[var(--destructive)] hover:opacity-90",
|
|
1061
|
-
ghost:
|
|
1062
|
-
"bg-transparent text-[var(--text)] border-transparent hover:bg-[var(--bg-hover)]",
|
|
1063
|
-
};
|
|
1064
|
-
return (
|
|
1065
|
-
<button
|
|
1066
|
-
type="button"
|
|
1067
|
-
className={`px-3 py-1.5 text-xs font-medium border cursor-pointer transition-colors ${cls[variant] ?? cls.primary}`}
|
|
1068
|
-
disabled={!!props.disabled}
|
|
1069
|
-
onClick={() => fireEvent(el.on?.press, ctx)}
|
|
1070
|
-
>
|
|
1071
|
-
{String(props.label ?? "Button")}
|
|
1072
|
-
</button>
|
|
1073
|
-
);
|
|
1074
|
-
};
|
|
1075
|
-
|
|
1076
|
-
const LinkComponent: ComponentFn = (props, _children, ctx, el) => {
|
|
1077
|
-
const safeHref = sanitizeLinkHref(props.href);
|
|
1078
|
-
|
|
1079
|
-
return (
|
|
1080
|
-
<a
|
|
1081
|
-
href={safeHref}
|
|
1082
|
-
className="text-xs text-[var(--accent)] underline hover:opacity-80"
|
|
1083
|
-
target={props.external ? "_blank" : undefined}
|
|
1084
|
-
rel={props.external ? "noopener noreferrer" : undefined}
|
|
1085
|
-
onClick={(e) => {
|
|
1086
|
-
if (el.on?.press) {
|
|
1087
|
-
e.preventDefault();
|
|
1088
|
-
fireEvent(el.on.press, ctx);
|
|
1089
|
-
}
|
|
1090
|
-
}}
|
|
1091
|
-
>
|
|
1092
|
-
{String(props.label ?? props.href ?? "Link")}
|
|
1093
|
-
</a>
|
|
1094
|
-
);
|
|
1095
|
-
};
|
|
1096
|
-
|
|
1097
|
-
const DropdownMenuComponent: ComponentFn = (props, _children, ctx) => {
|
|
1098
|
-
const [open, setOpen] = useState(false);
|
|
1099
|
-
const items = (props.items as Array<{ label: string; value: string }>) ?? [];
|
|
1100
|
-
return (
|
|
1101
|
-
<div className="relative inline-block">
|
|
1102
|
-
<button
|
|
1103
|
-
type="button"
|
|
1104
|
-
className="px-3 py-1.5 text-xs border border-[var(--border)] bg-[var(--card)] cursor-pointer hover:bg-[var(--bg-hover)]"
|
|
1105
|
-
onClick={() => setOpen(!open)}
|
|
1106
|
-
>
|
|
1107
|
-
{String(props.label ?? "Menu")} ▾
|
|
1108
|
-
</button>
|
|
1109
|
-
{open && (
|
|
1110
|
-
<div className="absolute top-full left-0 mt-1 min-w-[120px] border border-[var(--border)] bg-[var(--card)] shadow-md z-10">
|
|
1111
|
-
{items.map((item) => (
|
|
1112
|
-
<button
|
|
1113
|
-
key={item.value}
|
|
1114
|
-
type="button"
|
|
1115
|
-
className="block w-full text-left px-3 py-1.5 text-xs hover:bg-[var(--bg-hover)] cursor-pointer"
|
|
1116
|
-
onClick={() => {
|
|
1117
|
-
setOpen(false);
|
|
1118
|
-
if (ctx.onAction)
|
|
1119
|
-
ctx.onAction("menuSelect", {
|
|
1120
|
-
value: item.value,
|
|
1121
|
-
label: item.label,
|
|
1122
|
-
});
|
|
1123
|
-
}}
|
|
1124
|
-
>
|
|
1125
|
-
{item.label}
|
|
1126
|
-
</button>
|
|
1127
|
-
))}
|
|
1128
|
-
</div>
|
|
1129
|
-
)}
|
|
1130
|
-
</div>
|
|
1131
|
-
);
|
|
1132
|
-
};
|
|
1133
|
-
|
|
1134
|
-
const TabsComponent: ComponentFn = (props, _children, ctx) => {
|
|
1135
|
-
const tabs =
|
|
1136
|
-
(props.tabs as Array<{ label: string; value: string; content: string }>) ??
|
|
1137
|
-
[];
|
|
1138
|
-
const [value, setValue] = useStatePath(
|
|
1139
|
-
props.statePath as string | undefined,
|
|
1140
|
-
ctx,
|
|
1141
|
-
);
|
|
1142
|
-
const active = String(value ?? props.defaultValue ?? tabs[0]?.value ?? "");
|
|
1143
|
-
const activeTab = tabs.find((t) => t.value === active);
|
|
1144
|
-
return (
|
|
1145
|
-
<div>
|
|
1146
|
-
<div className="flex border-b border-[var(--border)]">
|
|
1147
|
-
{tabs.map((tab) => (
|
|
1148
|
-
<button
|
|
1149
|
-
key={tab.value}
|
|
1150
|
-
type="button"
|
|
1151
|
-
className={`px-3 py-1.5 text-xs cursor-pointer transition-colors ${
|
|
1152
|
-
tab.value === active
|
|
1153
|
-
? "border-b-2 border-[var(--accent)] text-[var(--accent)] font-semibold"
|
|
1154
|
-
: "text-[var(--muted)] hover:text-[var(--text)]"
|
|
1155
|
-
}`}
|
|
1156
|
-
onClick={() => setValue(tab.value)}
|
|
1157
|
-
>
|
|
1158
|
-
{tab.label}
|
|
1159
|
-
</button>
|
|
1160
|
-
))}
|
|
1161
|
-
</div>
|
|
1162
|
-
{activeTab && <div className="py-3 text-xs">{activeTab.content}</div>}
|
|
1163
|
-
</div>
|
|
1164
|
-
);
|
|
1165
|
-
};
|
|
1166
|
-
|
|
1167
|
-
const PaginationComponent: ComponentFn = (props, _children, ctx) => {
|
|
1168
|
-
const total = Number(props.totalPages ?? 1);
|
|
1169
|
-
const [value, setValue] = useStatePath(
|
|
1170
|
-
props.statePath as string | undefined,
|
|
1171
|
-
ctx,
|
|
1172
|
-
);
|
|
1173
|
-
const current = Number(value ?? 1);
|
|
1174
|
-
return (
|
|
1175
|
-
<div className="flex items-center gap-1">
|
|
1176
|
-
<button
|
|
1177
|
-
type="button"
|
|
1178
|
-
className="px-2 py-1 text-xs border border-[var(--border)] bg-[var(--card)] cursor-pointer hover:bg-[var(--bg-hover)] disabled:opacity-40"
|
|
1179
|
-
disabled={current <= 1}
|
|
1180
|
-
onClick={() => setValue(current - 1)}
|
|
1181
|
-
>
|
|
1182
|
-
←
|
|
1183
|
-
</button>
|
|
1184
|
-
{Array.from({ length: total }, (_, i) => i + 1).map((page) => (
|
|
1185
|
-
<button
|
|
1186
|
-
key={page}
|
|
1187
|
-
type="button"
|
|
1188
|
-
className={`px-2 py-1 text-xs border cursor-pointer ${
|
|
1189
|
-
page === current
|
|
1190
|
-
? "bg-[var(--accent)] text-[var(--accent-foreground,#1a1f26)] border-[var(--accent)]"
|
|
1191
|
-
: "border-[var(--border)] bg-[var(--card)] hover:bg-[var(--bg-hover)]"
|
|
1192
|
-
}`}
|
|
1193
|
-
onClick={() => setValue(page)}
|
|
1194
|
-
>
|
|
1195
|
-
{page}
|
|
1196
|
-
</button>
|
|
1197
|
-
))}
|
|
1198
|
-
<button
|
|
1199
|
-
type="button"
|
|
1200
|
-
className="px-2 py-1 text-xs border border-[var(--border)] bg-[var(--card)] cursor-pointer hover:bg-[var(--bg-hover)] disabled:opacity-40"
|
|
1201
|
-
disabled={current >= total}
|
|
1202
|
-
onClick={() => setValue(current + 1)}
|
|
1203
|
-
>
|
|
1204
|
-
→
|
|
1205
|
-
</button>
|
|
1206
|
-
</div>
|
|
1207
|
-
);
|
|
1208
|
-
};
|
|
1209
|
-
|
|
1210
|
-
// ── Metric / KPI ────────────────────────────────────────────────────
|
|
1211
|
-
|
|
1212
|
-
const MetricComponent: ComponentFn = (props) => {
|
|
1213
|
-
const trend = props.trend as string | undefined;
|
|
1214
|
-
const trendColor =
|
|
1215
|
-
trend === "up"
|
|
1216
|
-
? "text-green-400"
|
|
1217
|
-
: trend === "down"
|
|
1218
|
-
? "text-red-400"
|
|
1219
|
-
: "text-[var(--muted)]";
|
|
1220
|
-
return (
|
|
1221
|
-
<div className="flex flex-col gap-0.5 p-3 rounded-lg border border-[var(--border)] bg-[var(--card)]">
|
|
1222
|
-
<div className="text-[10px] text-[var(--muted)] uppercase tracking-wider font-medium">
|
|
1223
|
-
{String(props.label ?? "")}
|
|
1224
|
-
</div>
|
|
1225
|
-
<div className="flex items-baseline gap-1.5">
|
|
1226
|
-
<span className="text-xl font-semibold text-[var(--txt)]">
|
|
1227
|
-
{props.value != null ? String(props.value) : "—"}
|
|
1228
|
-
</span>
|
|
1229
|
-
{props.unit != null && (
|
|
1230
|
-
<span className="text-xs text-[var(--muted)]">
|
|
1231
|
-
{String(props.unit)}
|
|
1232
|
-
</span>
|
|
1233
|
-
)}
|
|
1234
|
-
</div>
|
|
1235
|
-
{props.change != null && (
|
|
1236
|
-
<div className={`text-[11px] font-medium ${trendColor}`}>
|
|
1237
|
-
{String(props.change)}
|
|
1238
|
-
</div>
|
|
1239
|
-
)}
|
|
1240
|
-
</div>
|
|
1241
|
-
);
|
|
1242
|
-
};
|
|
1243
|
-
|
|
1244
|
-
// ── Visualization ───────────────────────────────────────────────────
|
|
1245
|
-
|
|
1246
|
-
const BarGraphComponent: ComponentFn = (props) => {
|
|
1247
|
-
const data = (props.data as Array<{ label: string; value: number }>) ?? [];
|
|
1248
|
-
const maxVal = Math.max(...data.map((d) => d.value), 1);
|
|
1249
|
-
return (
|
|
1250
|
-
<div>
|
|
1251
|
-
{props.title ? (
|
|
1252
|
-
<div className="text-xs font-bold mb-2">{String(props.title)}</div>
|
|
1253
|
-
) : null}
|
|
1254
|
-
<div className="flex items-end gap-2 h-[100px]">
|
|
1255
|
-
{data.map((d) => (
|
|
1256
|
-
<div
|
|
1257
|
-
key={d.label}
|
|
1258
|
-
className="flex-1 flex flex-col items-center gap-0.5"
|
|
1259
|
-
>
|
|
1260
|
-
<div className="text-[9px] text-[var(--muted)]">{d.value}</div>
|
|
1261
|
-
<div
|
|
1262
|
-
className="w-full bg-[var(--accent)] transition-all duration-300 min-h-[2px]"
|
|
1263
|
-
style={{ height: `${(d.value / maxVal) * 80}px` }}
|
|
1264
|
-
/>
|
|
1265
|
-
<div className="text-[9px] text-[var(--muted)] truncate max-w-full">
|
|
1266
|
-
{d.label}
|
|
1267
|
-
</div>
|
|
1268
|
-
</div>
|
|
1269
|
-
))}
|
|
1270
|
-
</div>
|
|
1271
|
-
</div>
|
|
1272
|
-
);
|
|
1273
|
-
};
|
|
1274
|
-
|
|
1275
|
-
const LineGraphComponent: ComponentFn = (props) => {
|
|
1276
|
-
const data = (props.data as Array<{ label: string; value: number }>) ?? [];
|
|
1277
|
-
const maxVal = Math.max(...data.map((d) => d.value), 1);
|
|
1278
|
-
const h = 80;
|
|
1279
|
-
const w = 100;
|
|
1280
|
-
const points = data.map((d, i) => ({
|
|
1281
|
-
x: (i / Math.max(data.length - 1, 1)) * w,
|
|
1282
|
-
y: h - (d.value / maxVal) * h,
|
|
1283
|
-
}));
|
|
1284
|
-
const pathD = points
|
|
1285
|
-
.map((p, i) => `${i === 0 ? "M" : "L"} ${p.x} ${p.y}`)
|
|
1286
|
-
.join(" ");
|
|
1287
|
-
return (
|
|
1288
|
-
<div>
|
|
1289
|
-
{props.title ? (
|
|
1290
|
-
<div className="text-xs font-bold mb-2">{String(props.title)}</div>
|
|
1291
|
-
) : null}
|
|
1292
|
-
<svg
|
|
1293
|
-
viewBox={`0 0 ${w} ${h + 20}`}
|
|
1294
|
-
className="w-full h-[100px]"
|
|
1295
|
-
preserveAspectRatio="none"
|
|
1296
|
-
>
|
|
1297
|
-
<title>{String(props.title ?? "Line graph")}</title>
|
|
1298
|
-
<path
|
|
1299
|
-
d={pathD}
|
|
1300
|
-
fill="none"
|
|
1301
|
-
stroke="var(--accent)"
|
|
1302
|
-
strokeWidth="2"
|
|
1303
|
-
vectorEffect="non-scaling-stroke"
|
|
1304
|
-
/>
|
|
1305
|
-
{points.map((p) => (
|
|
1306
|
-
<circle
|
|
1307
|
-
key={`${p.x}:${p.y}`}
|
|
1308
|
-
cx={p.x}
|
|
1309
|
-
cy={p.y}
|
|
1310
|
-
r="3"
|
|
1311
|
-
fill="var(--accent)"
|
|
1312
|
-
vectorEffect="non-scaling-stroke"
|
|
1313
|
-
/>
|
|
1314
|
-
))}
|
|
1315
|
-
{data.map((d, i) => (
|
|
1316
|
-
<text
|
|
1317
|
-
key={`${d.label}:${d.value}`}
|
|
1318
|
-
x={points[i].x}
|
|
1319
|
-
y={h + 14}
|
|
1320
|
-
textAnchor="middle"
|
|
1321
|
-
fontSize="8"
|
|
1322
|
-
fill="var(--muted)"
|
|
1323
|
-
>
|
|
1324
|
-
{d.label}
|
|
1325
|
-
</text>
|
|
1326
|
-
))}
|
|
1327
|
-
</svg>
|
|
1328
|
-
</div>
|
|
1329
|
-
);
|
|
1330
|
-
};
|
|
1331
|
-
|
|
1332
|
-
// ── Interaction ─────────────────────────────────────────────────────
|
|
1333
|
-
|
|
1334
|
-
const TooltipComponent: ComponentFn = (props) => {
|
|
1335
|
-
const [show, setShow] = useState(false);
|
|
1336
|
-
return (
|
|
1337
|
-
<button
|
|
1338
|
-
type="button"
|
|
1339
|
-
className="relative inline-block"
|
|
1340
|
-
onMouseEnter={() => setShow(true)}
|
|
1341
|
-
onMouseLeave={() => setShow(false)}
|
|
1342
|
-
onFocus={() => setShow(true)}
|
|
1343
|
-
onBlur={() => setShow(false)}
|
|
1344
|
-
onClick={() => setShow((prev) => !prev)}
|
|
1345
|
-
>
|
|
1346
|
-
<span className="text-xs text-[var(--accent)] underline cursor-help">
|
|
1347
|
-
{String(props.text ?? "Hover")}
|
|
1348
|
-
</span>
|
|
1349
|
-
{show && (
|
|
1350
|
-
<div className="absolute bottom-full left-1/2 -translate-x-1/2 mb-1 px-2 py-1 text-[10px] bg-[var(--text)] text-[var(--card)] whitespace-nowrap z-10">
|
|
1351
|
-
{String(props.content ?? "")}
|
|
1352
|
-
</div>
|
|
1353
|
-
)}
|
|
1354
|
-
</button>
|
|
1355
|
-
);
|
|
1356
|
-
};
|
|
1357
|
-
|
|
1358
|
-
const PopoverComponent: ComponentFn = (props) => {
|
|
1359
|
-
const [open, setOpen] = useState(false);
|
|
1360
|
-
return (
|
|
1361
|
-
<div className="relative inline-block">
|
|
1362
|
-
<button
|
|
1363
|
-
type="button"
|
|
1364
|
-
className="text-xs text-[var(--accent)] underline cursor-pointer"
|
|
1365
|
-
onClick={() => setOpen(!open)}
|
|
1366
|
-
>
|
|
1367
|
-
{String(props.trigger ?? "Click")}
|
|
1368
|
-
</button>
|
|
1369
|
-
{open && (
|
|
1370
|
-
<div className="absolute top-full left-0 mt-1 p-3 border border-[var(--border)] bg-[var(--card)] shadow-md z-10 min-w-[150px]">
|
|
1371
|
-
<div className="text-xs">{String(props.content ?? "")}</div>
|
|
1372
|
-
<button
|
|
1373
|
-
type="button"
|
|
1374
|
-
className="text-[10px] text-[var(--muted)] mt-1 cursor-pointer hover:text-[var(--text)]"
|
|
1375
|
-
onClick={() => setOpen(false)}
|
|
1376
|
-
>
|
|
1377
|
-
Close
|
|
1378
|
-
</button>
|
|
1379
|
-
</div>
|
|
1380
|
-
)}
|
|
1381
|
-
</div>
|
|
1382
|
-
);
|
|
1383
|
-
};
|
|
1384
|
-
|
|
1385
|
-
const CollapsibleComponent: ComponentFn = (props, children) => {
|
|
1386
|
-
const [open, setOpen] = useState(!!props.defaultOpen);
|
|
1387
|
-
return (
|
|
1388
|
-
<div className="border border-[var(--border)]">
|
|
1389
|
-
<button
|
|
1390
|
-
type="button"
|
|
1391
|
-
className="w-full flex items-center gap-2 px-3 py-2 text-xs font-semibold cursor-pointer hover:bg-[var(--bg-hover)] transition-colors"
|
|
1392
|
-
onClick={() => setOpen(!open)}
|
|
1393
|
-
>
|
|
1394
|
-
<span
|
|
1395
|
-
className="text-[10px] transition-transform"
|
|
1396
|
-
style={{ transform: open ? "rotate(90deg)" : "none" }}
|
|
1397
|
-
>
|
|
1398
|
-
▶
|
|
1399
|
-
</span>
|
|
1400
|
-
{String(props.title ?? "Collapsible")}
|
|
1401
|
-
</button>
|
|
1402
|
-
{open && <div className="px-3 pb-3">{children}</div>}
|
|
1403
|
-
</div>
|
|
1404
|
-
);
|
|
1405
|
-
};
|
|
1406
|
-
|
|
1407
|
-
const AccordionComponent: ComponentFn = (props) => {
|
|
1408
|
-
const items =
|
|
1409
|
-
(props.items as Array<{ title: string; content: string }>) ?? [];
|
|
1410
|
-
const isSingle = props.type === "single";
|
|
1411
|
-
const [openSet, setOpenSet] = useState<Set<number>>(new Set());
|
|
1412
|
-
|
|
1413
|
-
const toggle = (idx: number) => {
|
|
1414
|
-
setOpenSet((prev) => {
|
|
1415
|
-
const next = isSingle ? new Set<number>() : new Set(prev);
|
|
1416
|
-
if (prev.has(idx)) next.delete(idx);
|
|
1417
|
-
else next.add(idx);
|
|
1418
|
-
return next;
|
|
1419
|
-
});
|
|
1420
|
-
};
|
|
1421
|
-
|
|
1422
|
-
return (
|
|
1423
|
-
<div className="border border-[var(--border)] divide-y divide-[var(--border)]">
|
|
1424
|
-
{items.map((item, i) => (
|
|
1425
|
-
<div key={`${item.title}:${item.content}`}>
|
|
1426
|
-
<button
|
|
1427
|
-
type="button"
|
|
1428
|
-
className="w-full flex items-center gap-2 px-3 py-2 text-xs font-semibold cursor-pointer hover:bg-[var(--bg-hover)]"
|
|
1429
|
-
onClick={() => toggle(i)}
|
|
1430
|
-
>
|
|
1431
|
-
<span
|
|
1432
|
-
className="text-[10px] transition-transform"
|
|
1433
|
-
style={{ transform: openSet.has(i) ? "rotate(90deg)" : "none" }}
|
|
1434
|
-
>
|
|
1435
|
-
▶
|
|
1436
|
-
</span>
|
|
1437
|
-
{item.title}
|
|
1438
|
-
</button>
|
|
1439
|
-
{openSet.has(i) && (
|
|
1440
|
-
<div className="px-3 pb-3 text-xs">{item.content}</div>
|
|
1441
|
-
)}
|
|
1442
|
-
</div>
|
|
1443
|
-
))}
|
|
1444
|
-
</div>
|
|
1445
|
-
);
|
|
1446
|
-
};
|
|
1447
|
-
|
|
1448
|
-
const DialogComponent: ComponentFn = (props, children, ctx) => {
|
|
1449
|
-
const openPath = props.openPath as string | undefined;
|
|
1450
|
-
const isOpen = openPath ? !!getByPath(ctx.state, openPath) : false;
|
|
1451
|
-
if (!isOpen) return null;
|
|
1452
|
-
const close = () => {
|
|
1453
|
-
if (openPath) ctx.setState(openPath, false);
|
|
1454
|
-
};
|
|
1455
|
-
return (
|
|
1456
|
-
<div
|
|
1457
|
-
className="fixed inset-0 z-50 flex items-center justify-center bg-black/50"
|
|
1458
|
-
onClick={(e) => {
|
|
1459
|
-
if (e.target === e.currentTarget) close();
|
|
1460
|
-
}}
|
|
1461
|
-
onKeyDown={(e) => {
|
|
1462
|
-
if (e.key === "Escape" || e.key === "Enter" || e.key === " ") {
|
|
1463
|
-
e.preventDefault();
|
|
1464
|
-
close();
|
|
1465
|
-
}
|
|
1466
|
-
}}
|
|
1467
|
-
role="dialog"
|
|
1468
|
-
aria-modal="true"
|
|
1469
|
-
>
|
|
1470
|
-
<div className="w-full max-w-md border border-[var(--border)] bg-[var(--card)] p-5 shadow-lg">
|
|
1471
|
-
<div className="flex items-center justify-between mb-3">
|
|
1472
|
-
<div>
|
|
1473
|
-
{props.title ? (
|
|
1474
|
-
<div className="font-bold text-sm">{String(props.title)}</div>
|
|
1475
|
-
) : null}
|
|
1476
|
-
{props.description ? (
|
|
1477
|
-
<div className="text-xs text-[var(--muted)] mt-0.5">
|
|
1478
|
-
{String(props.description)}
|
|
1479
|
-
</div>
|
|
1480
|
-
) : null}
|
|
1481
|
-
</div>
|
|
1482
|
-
<button
|
|
1483
|
-
type="button"
|
|
1484
|
-
className="text-[var(--muted)] hover:text-[var(--text)] text-lg leading-none px-1 cursor-pointer"
|
|
1485
|
-
onClick={close}
|
|
1486
|
-
>
|
|
1487
|
-
×
|
|
1488
|
-
</button>
|
|
1489
|
-
</div>
|
|
1490
|
-
{children}
|
|
1491
|
-
</div>
|
|
1492
|
-
</div>
|
|
1493
|
-
);
|
|
1494
|
-
};
|
|
1495
|
-
|
|
1496
|
-
const DrawerComponent: ComponentFn = (props, children, ctx) => {
|
|
1497
|
-
const openPath = props.openPath as string | undefined;
|
|
1498
|
-
const isOpen = openPath ? !!getByPath(ctx.state, openPath) : false;
|
|
1499
|
-
if (!isOpen) return null;
|
|
1500
|
-
const close = () => {
|
|
1501
|
-
if (openPath) ctx.setState(openPath, false);
|
|
1502
|
-
};
|
|
1503
|
-
return (
|
|
1504
|
-
<div
|
|
1505
|
-
className="fixed inset-0 z-50 flex items-end bg-black/50"
|
|
1506
|
-
onClick={(e) => {
|
|
1507
|
-
if (e.target === e.currentTarget) close();
|
|
1508
|
-
}}
|
|
1509
|
-
onKeyDown={(e) => {
|
|
1510
|
-
if (e.key === "Escape" || e.key === "Enter" || e.key === " ") {
|
|
1511
|
-
e.preventDefault();
|
|
1512
|
-
close();
|
|
1513
|
-
}
|
|
1514
|
-
}}
|
|
1515
|
-
role="dialog"
|
|
1516
|
-
aria-modal="true"
|
|
1517
|
-
>
|
|
1518
|
-
<div className="w-full max-h-[80vh] border-t border-[var(--border)] bg-[var(--card)] p-5 shadow-lg overflow-y-auto animate-[slide-up_200ms_ease]">
|
|
1519
|
-
<div className="w-10 h-1 bg-[var(--border)] mx-auto mb-3 rounded-full" />
|
|
1520
|
-
{props.title ? (
|
|
1521
|
-
<div className="font-bold text-sm">{String(props.title)}</div>
|
|
1522
|
-
) : null}
|
|
1523
|
-
{props.description ? (
|
|
1524
|
-
<div className="text-xs text-[var(--muted)] mt-0.5 mb-3">
|
|
1525
|
-
{String(props.description)}
|
|
1526
|
-
</div>
|
|
1527
|
-
) : null}
|
|
1528
|
-
{children}
|
|
1529
|
-
</div>
|
|
1530
|
-
</div>
|
|
1531
|
-
);
|
|
1532
|
-
};
|
|
1533
|
-
|
|
1534
|
-
// ── Component map ───────────────────────────────────────────────────
|
|
1535
|
-
|
|
1536
|
-
const COMPONENTS: Record<string, ComponentFn> = {
|
|
1537
|
-
// Layout
|
|
1538
|
-
Stack: StackComponent,
|
|
1539
|
-
Grid: GridComponent,
|
|
1540
|
-
Card: CardComponent,
|
|
1541
|
-
Separator: SeparatorComponent,
|
|
1542
|
-
// Typography
|
|
1543
|
-
Heading: HeadingComponent,
|
|
1544
|
-
Text: TextComponent,
|
|
1545
|
-
// Form
|
|
1546
|
-
Input: InputComponent,
|
|
1547
|
-
Textarea: TextareaComponent,
|
|
1548
|
-
Select: SelectComponent,
|
|
1549
|
-
Checkbox: CheckboxComponent,
|
|
1550
|
-
Radio: RadioComponent,
|
|
1551
|
-
Switch: SwitchComponent,
|
|
1552
|
-
Slider: SliderComponent,
|
|
1553
|
-
Toggle: ToggleComponent,
|
|
1554
|
-
ToggleGroup: ToggleGroupComponent,
|
|
1555
|
-
ButtonGroup: ButtonGroupComponent,
|
|
1556
|
-
// Data
|
|
1557
|
-
Table: TableComponent,
|
|
1558
|
-
Carousel: CarouselComponent,
|
|
1559
|
-
Badge: BadgeComponent,
|
|
1560
|
-
Avatar: AvatarComponent,
|
|
1561
|
-
Image: ImageComponent,
|
|
1562
|
-
// Feedback
|
|
1563
|
-
Alert: AlertComponent,
|
|
1564
|
-
Progress: ProgressComponent,
|
|
1565
|
-
Rating: RatingComponent,
|
|
1566
|
-
Skeleton: SkeletonComponent,
|
|
1567
|
-
Spinner: SpinnerComponent,
|
|
1568
|
-
// Navigation
|
|
1569
|
-
Button: ButtonComponent,
|
|
1570
|
-
Link: LinkComponent,
|
|
1571
|
-
DropdownMenu: DropdownMenuComponent,
|
|
1572
|
-
Tabs: TabsComponent,
|
|
1573
|
-
Pagination: PaginationComponent,
|
|
1574
|
-
// Metric
|
|
1575
|
-
Metric: MetricComponent,
|
|
1576
|
-
// Visualization
|
|
1577
|
-
BarGraph: BarGraphComponent,
|
|
1578
|
-
LineGraph: LineGraphComponent,
|
|
1579
|
-
// Interaction
|
|
1580
|
-
Tooltip: TooltipComponent,
|
|
1581
|
-
Popover: PopoverComponent,
|
|
1582
|
-
Collapsible: CollapsibleComponent,
|
|
1583
|
-
Accordion: AccordionComponent,
|
|
1584
|
-
Dialog: DialogComponent,
|
|
1585
|
-
Drawer: DrawerComponent,
|
|
1586
|
-
};
|
|
1587
|
-
|
|
1588
|
-
// ══════════════════════════════════════════════════════════════════════
|
|
1589
|
-
// ELEMENT RENDERER
|
|
1590
|
-
// ══════════════════════════════════════════════════════════════════════
|
|
1591
|
-
|
|
1592
|
-
function ElementRenderer({ elementId }: { elementId: string }) {
|
|
1593
|
-
const { t } = useApp();
|
|
1594
|
-
const ctx = useUiCtx();
|
|
1595
|
-
const el = ctx.spec.elements[elementId];
|
|
1596
|
-
if (!el) return null;
|
|
1597
|
-
|
|
1598
|
-
// Visibility check
|
|
1599
|
-
if (el.visible && !evaluateUiVisibility(el.visible, ctx.state, ctx.auth)) {
|
|
1600
|
-
return null;
|
|
1601
|
-
}
|
|
1602
|
-
|
|
1603
|
-
const component = COMPONENTS[el.type];
|
|
1604
|
-
if (!component) {
|
|
1605
|
-
return (
|
|
1606
|
-
<div className="text-[10px] text-[var(--destructive)] border border-dashed border-[var(--destructive)] p-2">
|
|
1607
|
-
{t("ui-renderer.UnknownComponent")} {el.type}
|
|
1608
|
-
</div>
|
|
1609
|
-
);
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
|
-
const resolvedProps = resolveProps(el.props, ctx);
|
|
1613
|
-
|
|
1614
|
-
// Handle repeat / list rendering
|
|
1615
|
-
if (el.repeat) {
|
|
1616
|
-
const listData = getByPath(ctx.state, el.repeat.path) as
|
|
1617
|
-
| Array<Record<string, unknown>>
|
|
1618
|
-
| undefined;
|
|
1619
|
-
if (!Array.isArray(listData)) return null;
|
|
1620
|
-
|
|
1621
|
-
return (
|
|
1622
|
-
<>
|
|
1623
|
-
{listData.map((item) => {
|
|
1624
|
-
const itemCtx: UiRenderContext = { ...ctx, repeatItem: item };
|
|
1625
|
-
const childNodes = el.children.map((childId) => (
|
|
1626
|
-
<UiContext.Provider key={childId} value={itemCtx}>
|
|
1627
|
-
<ElementRenderer elementId={childId} />
|
|
1628
|
-
</UiContext.Provider>
|
|
1629
|
-
));
|
|
1630
|
-
const repeatKey = el.repeat?.key;
|
|
1631
|
-
const itemKey = String(
|
|
1632
|
-
repeatKey != null ? item[repeatKey] : Math.random(),
|
|
1633
|
-
);
|
|
1634
|
-
return (
|
|
1635
|
-
<React.Fragment key={itemKey}>
|
|
1636
|
-
{component(resolvedProps, childNodes, itemCtx, el)}
|
|
1637
|
-
</React.Fragment>
|
|
1638
|
-
);
|
|
1639
|
-
})}
|
|
1640
|
-
</>
|
|
1641
|
-
);
|
|
1642
|
-
}
|
|
1643
|
-
|
|
1644
|
-
// Normal rendering: resolve children
|
|
1645
|
-
const childNodes = el.children.map((childId) => (
|
|
1646
|
-
<ElementRenderer key={childId} elementId={childId} />
|
|
1647
|
-
));
|
|
1648
|
-
|
|
1649
|
-
return <>{component(resolvedProps, childNodes, ctx, el)}</>;
|
|
1650
|
-
}
|
|
1651
|
-
|
|
1652
|
-
// ══════════════════════════════════════════════════════════════════════
|
|
1653
|
-
// ROOT RENDERER
|
|
1654
|
-
// ══════════════════════════════════════════════════════════════════════
|
|
1655
|
-
|
|
1656
|
-
export interface UiRendererProps {
|
|
1657
|
-
spec: UiSpec;
|
|
1658
|
-
onAction?: (action: string, params?: Record<string, unknown>) => void;
|
|
1659
|
-
loading?: boolean;
|
|
1660
|
-
auth?: AuthState;
|
|
1661
|
-
validators?: Record<
|
|
1662
|
-
string,
|
|
1663
|
-
(
|
|
1664
|
-
value: unknown,
|
|
1665
|
-
args?: Record<string, unknown>,
|
|
1666
|
-
) => boolean | Promise<boolean>
|
|
1667
|
-
>;
|
|
1668
|
-
}
|
|
1669
|
-
|
|
1670
|
-
export function UiRenderer({
|
|
1671
|
-
spec,
|
|
1672
|
-
onAction,
|
|
1673
|
-
loading,
|
|
1674
|
-
auth,
|
|
1675
|
-
validators,
|
|
1676
|
-
}: UiRendererProps) {
|
|
1677
|
-
const [state, setStateRaw] = useState<Record<string, unknown>>(() => ({
|
|
1678
|
-
...spec.state,
|
|
1679
|
-
}));
|
|
1680
|
-
const [fieldErrors, setFieldErrors] = useState<Record<string, string[]>>({});
|
|
1681
|
-
|
|
1682
|
-
const setState = useCallback((path: string, value: unknown) => {
|
|
1683
|
-
setStateRaw((prev) => {
|
|
1684
|
-
const next = { ...prev };
|
|
1685
|
-
setByPath(next, path, value);
|
|
1686
|
-
return next;
|
|
1687
|
-
});
|
|
1688
|
-
}, []);
|
|
1689
|
-
|
|
1690
|
-
const validateField = useCallback(
|
|
1691
|
-
(statePath: string) => {
|
|
1692
|
-
// Find the element that has this statePath
|
|
1693
|
-
for (const el of Object.values(spec.elements)) {
|
|
1694
|
-
if (el.props.statePath === statePath && el.validation) {
|
|
1695
|
-
const value = getByPath(state, statePath);
|
|
1696
|
-
const errors = runValidation(el.validation.checks, value, validators);
|
|
1697
|
-
setFieldErrors((prev) => ({ ...prev, [statePath]: errors }));
|
|
1698
|
-
return;
|
|
1699
|
-
}
|
|
1700
|
-
}
|
|
1701
|
-
},
|
|
1702
|
-
[spec.elements, state, validators],
|
|
1703
|
-
);
|
|
1704
|
-
|
|
1705
|
-
const ctx = useMemo<UiRenderContext>(
|
|
1706
|
-
() => ({
|
|
1707
|
-
spec,
|
|
1708
|
-
state,
|
|
1709
|
-
setState,
|
|
1710
|
-
onAction,
|
|
1711
|
-
auth,
|
|
1712
|
-
loading,
|
|
1713
|
-
validators,
|
|
1714
|
-
fieldErrors,
|
|
1715
|
-
validateField,
|
|
1716
|
-
}),
|
|
1717
|
-
[
|
|
1718
|
-
spec,
|
|
1719
|
-
state,
|
|
1720
|
-
setState,
|
|
1721
|
-
onAction,
|
|
1722
|
-
auth,
|
|
1723
|
-
loading,
|
|
1724
|
-
validators,
|
|
1725
|
-
fieldErrors,
|
|
1726
|
-
validateField,
|
|
1727
|
-
],
|
|
1728
|
-
);
|
|
1729
|
-
|
|
1730
|
-
// Loading skeleton when no elements
|
|
1731
|
-
if (loading && Object.keys(spec.elements).length === 0) {
|
|
1732
|
-
return (
|
|
1733
|
-
<div className="flex flex-col gap-3 animate-pulse">
|
|
1734
|
-
<div className="h-4 bg-[var(--bg-hover)] w-3/4" />
|
|
1735
|
-
<div className="h-3 bg-[var(--bg-hover)] w-1/2" />
|
|
1736
|
-
<div className="h-3 bg-[var(--bg-hover)] w-5/6" />
|
|
1737
|
-
</div>
|
|
1738
|
-
);
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
return (
|
|
1742
|
-
<UiContext.Provider value={ctx}>
|
|
1743
|
-
<ElementRenderer elementId={spec.root} />
|
|
1744
|
-
</UiContext.Provider>
|
|
1745
|
-
);
|
|
1746
|
-
}
|
|
1747
|
-
|
|
1748
|
-
/** Get the full list of supported component types. */
|
|
1749
|
-
export function getSupportedComponents(): string[] {
|
|
1750
|
-
return Object.keys(COMPONENTS);
|
|
1751
|
-
}
|