@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,1924 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* config-field.tsx — React port of the 19 Lit field renderers from config-field.ts.
|
|
3
|
-
*
|
|
4
|
-
* Each renderer is a plain function (props: FieldRenderProps) => JSX.Element.
|
|
5
|
-
* Styling uses Tailwind utility classes + CSS custom properties from base.css.
|
|
6
|
-
*
|
|
7
|
-
* Also exports:
|
|
8
|
-
* - defaultRenderers map (field type name -> renderer)
|
|
9
|
-
* - ConfigField wrapper component (label + renderer + help + errors)
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import { ChevronDown, X } from "lucide-react";
|
|
13
|
-
import React, { useCallback, useRef, useState } from "react";
|
|
14
|
-
import { useApp } from "../state";
|
|
15
|
-
import type { DynamicValue } from "../types";
|
|
16
|
-
import type { FieldRenderer, FieldRenderProps } from "./config-catalog";
|
|
17
|
-
import { resolveDynamic } from "./config-catalog";
|
|
18
|
-
|
|
19
|
-
// ── Action binding helper ──────────────────────────────────────────────
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Resolve DynamicValue params and fire the onAction callback.
|
|
23
|
-
* No-ops when the binding or onAction is missing.
|
|
24
|
-
*/
|
|
25
|
-
function fireAction(props: FieldRenderProps, eventName: string): void {
|
|
26
|
-
const binding = props.hint.on?.[eventName];
|
|
27
|
-
if (!binding || !props.onAction) return;
|
|
28
|
-
|
|
29
|
-
// Resolve any DynamicValue params against a state snapshot built from the
|
|
30
|
-
// current field value (keyed by the field's own key). The resolveDynamic
|
|
31
|
-
// function handles both literal values and { path } references.
|
|
32
|
-
let resolvedParams: Record<string, unknown> | undefined;
|
|
33
|
-
if (binding.params) {
|
|
34
|
-
const state: Record<string, unknown> = { [props.key]: props.value };
|
|
35
|
-
resolvedParams = {};
|
|
36
|
-
for (const [k, v] of Object.entries(binding.params)) {
|
|
37
|
-
resolvedParams[k] = resolveDynamic(v as DynamicValue, state);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
void props.onAction(binding.action, resolvedParams);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// ── Shared Tailwind class constants ─────────────────────────────────────
|
|
45
|
-
|
|
46
|
-
const INPUT_CLS =
|
|
47
|
-
"w-full px-3 py-2 border border-[var(--border)] bg-[var(--card)] text-[13px] font-[var(--mono)] transition-all focus:border-[var(--accent)] focus:outline-none focus:ring-1 focus:ring-[var(--accent)] box-border h-[36px] rounded-sm placeholder:text-[var(--muted)] placeholder:opacity-60";
|
|
48
|
-
|
|
49
|
-
const INPUT_ERROR_CLS =
|
|
50
|
-
"w-full px-3 py-2 border border-[var(--destructive)] bg-[color-mix(in_srgb,var(--destructive)_3%,var(--card))] text-[13px] font-[var(--mono)] transition-all focus:border-[var(--accent)] focus:outline-none focus:ring-1 focus:ring-[var(--accent)] box-border h-[36px] rounded-sm placeholder:text-[var(--muted)] placeholder:opacity-60";
|
|
51
|
-
|
|
52
|
-
function inputCls(hasError: boolean): string {
|
|
53
|
-
return hasError ? INPUT_ERROR_CLS : INPUT_CLS;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// ── 1. Text ─────────────────────────────────────────────────────────────
|
|
57
|
-
|
|
58
|
-
/** Single-line text input. Fallback renderer for unresolved field types. */
|
|
59
|
-
export function renderTextField(props: FieldRenderProps) {
|
|
60
|
-
const value = props.isSet ? String(props.value ?? "") : "";
|
|
61
|
-
const placeholder =
|
|
62
|
-
(props.hint.placeholder as string | undefined) ??
|
|
63
|
-
(props.schema.default != null
|
|
64
|
-
? `Default: ${props.schema.default}`
|
|
65
|
-
: "Enter value...");
|
|
66
|
-
|
|
67
|
-
return (
|
|
68
|
-
<input
|
|
69
|
-
className={inputCls(!!props.errors?.length)}
|
|
70
|
-
type="text"
|
|
71
|
-
defaultValue={value}
|
|
72
|
-
placeholder={placeholder}
|
|
73
|
-
data-config-key={props.key}
|
|
74
|
-
data-field-type="text"
|
|
75
|
-
disabled={props.readonly}
|
|
76
|
-
onChange={(e) => {
|
|
77
|
-
props.onChange(e.target.value);
|
|
78
|
-
fireAction(props, "change");
|
|
79
|
-
}}
|
|
80
|
-
onBlur={() => fireAction(props, "blur")}
|
|
81
|
-
onClick={() => fireAction(props, "click")}
|
|
82
|
-
/>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// ── 2. Password ─────────────────────────────────────────────────────────
|
|
87
|
-
|
|
88
|
-
/** Masked password input with show/hide toggle and async onReveal for server-backed decryption. */
|
|
89
|
-
export function renderPasswordField(props: FieldRenderProps) {
|
|
90
|
-
return <PasswordFieldInner fp={props} />;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function PasswordFieldInner({ fp: props }: { fp: FieldRenderProps }) {
|
|
94
|
-
const maskedValue = props.isSet ? String(props.value ?? "") : "";
|
|
95
|
-
const placeholder = props.isSet
|
|
96
|
-
? `Current: ${maskedValue || "********"} (leave blank to keep)`
|
|
97
|
-
: ((props.hint.placeholder as string | undefined) ?? "Enter value...");
|
|
98
|
-
|
|
99
|
-
const [visible, setVisible] = useState(false);
|
|
100
|
-
const [busy, setBusy] = useState(false);
|
|
101
|
-
const [fieldValue, setFieldValue] = useState("");
|
|
102
|
-
const inputRef = useRef<HTMLInputElement>(null);
|
|
103
|
-
const onReveal = props.onReveal;
|
|
104
|
-
|
|
105
|
-
const handleToggle = useCallback(async () => {
|
|
106
|
-
if (visible) {
|
|
107
|
-
// Hide — just toggle visibility, value stays in React state
|
|
108
|
-
setVisible(false);
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// Reveal: fetch the real value from the server
|
|
113
|
-
if (onReveal) {
|
|
114
|
-
setBusy(true);
|
|
115
|
-
const realValue = await onReveal();
|
|
116
|
-
setBusy(false);
|
|
117
|
-
if (realValue != null) {
|
|
118
|
-
setVisible(true);
|
|
119
|
-
setFieldValue(realValue);
|
|
120
|
-
props.onChange(realValue);
|
|
121
|
-
}
|
|
122
|
-
} else {
|
|
123
|
-
// Fallback: just toggle type (shows whatever is in the input)
|
|
124
|
-
setVisible(true);
|
|
125
|
-
}
|
|
126
|
-
}, [visible, onReveal, props]);
|
|
127
|
-
|
|
128
|
-
return (
|
|
129
|
-
<div className="flex">
|
|
130
|
-
<input
|
|
131
|
-
ref={inputRef}
|
|
132
|
-
className="flex-1 px-3 py-2 border border-[var(--border)] border-r-0 bg-[var(--card)] text-[13px] font-[var(--mono)] transition-all focus:border-[var(--accent)] focus:outline-none focus:ring-1 focus:ring-[var(--accent)] box-border h-[36px] rounded-l-sm placeholder:text-[var(--muted)] placeholder:opacity-60"
|
|
133
|
-
type={visible ? "text" : "password"}
|
|
134
|
-
value={fieldValue}
|
|
135
|
-
placeholder={placeholder}
|
|
136
|
-
data-config-key={props.key}
|
|
137
|
-
data-field-type="password"
|
|
138
|
-
onChange={(e) => {
|
|
139
|
-
setFieldValue(e.target.value);
|
|
140
|
-
props.onChange(e.target.value);
|
|
141
|
-
fireAction(props, "change");
|
|
142
|
-
}}
|
|
143
|
-
onBlur={() => fireAction(props, "blur")}
|
|
144
|
-
/>
|
|
145
|
-
<button
|
|
146
|
-
type="button"
|
|
147
|
-
className="px-3 border border-[var(--border)] bg-[var(--bg-hover)] text-[11px] text-[var(--muted)] cursor-pointer whitespace-nowrap min-w-[56px] text-center transition-colors hover:bg-[var(--surface)] hover:text-[var(--text)] h-[36px] font-medium rounded-r-sm"
|
|
148
|
-
onClick={() => {
|
|
149
|
-
void handleToggle();
|
|
150
|
-
fireAction(props, "click");
|
|
151
|
-
}}
|
|
152
|
-
title={visible ? "Hide value" : "Reveal value"}
|
|
153
|
-
>
|
|
154
|
-
{busy ? "\u2026" : visible ? "\u{1F441} Hide" : "\u{1F441} Show"}
|
|
155
|
-
</button>
|
|
156
|
-
</div>
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// ── 3. Number ───────────────────────────────────────────────────────────
|
|
161
|
-
|
|
162
|
-
/** Numeric input with min/max/step attributes derived from schema and hints. */
|
|
163
|
-
export function renderNumberField(props: FieldRenderProps) {
|
|
164
|
-
return <NumberFieldInner fp={props} />;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function NumberFieldInner({ fp: props }: { fp: FieldRenderProps }) {
|
|
168
|
-
const minVal =
|
|
169
|
-
props.schema.minimum ?? (props.hint.min as number | undefined) ?? undefined;
|
|
170
|
-
const maxVal =
|
|
171
|
-
props.schema.maximum ?? (props.hint.max as number | undefined) ?? undefined;
|
|
172
|
-
const stepVal = (props.hint.step as number | undefined) ?? 1;
|
|
173
|
-
const unit = props.hint.unit as string | undefined;
|
|
174
|
-
const placeholder =
|
|
175
|
-
(props.hint.placeholder as string | undefined) ??
|
|
176
|
-
(props.schema.default != null
|
|
177
|
-
? `Default: ${props.schema.default}`
|
|
178
|
-
: "Enter number...");
|
|
179
|
-
|
|
180
|
-
const initial = props.isSet ? String(props.value ?? "") : "";
|
|
181
|
-
const [val, setVal] = useState(initial);
|
|
182
|
-
|
|
183
|
-
const hasRange = minVal != null || maxVal != null;
|
|
184
|
-
|
|
185
|
-
const step = (direction: 1 | -1) => {
|
|
186
|
-
const current = val === "" ? 0 : Number(val);
|
|
187
|
-
if (Number.isNaN(current)) return;
|
|
188
|
-
let next = current + direction * stepVal;
|
|
189
|
-
if (minVal != null && next < minVal) next = minVal;
|
|
190
|
-
if (maxVal != null && next > maxVal) next = maxVal;
|
|
191
|
-
const s = String(next);
|
|
192
|
-
setVal(s);
|
|
193
|
-
props.onChange(s);
|
|
194
|
-
fireAction(props, "change");
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
return (
|
|
198
|
-
<div>
|
|
199
|
-
<div className="flex items-center gap-1.5">
|
|
200
|
-
{!props.readonly && (
|
|
201
|
-
<button
|
|
202
|
-
type="button"
|
|
203
|
-
className="px-2 py-1.5 border border-[var(--border)] bg-transparent text-sm text-[var(--muted)] cursor-pointer transition-colors hover:bg-[var(--surface)] hover:text-[var(--text)] h-[36px] rounded-sm font-mono select-none"
|
|
204
|
-
onClick={() => step(-1)}
|
|
205
|
-
>
|
|
206
|
-
−
|
|
207
|
-
</button>
|
|
208
|
-
)}
|
|
209
|
-
<input
|
|
210
|
-
className={`${inputCls(!!props.errors?.length)} ${unit ? "flex-1" : "w-full"} text-center`}
|
|
211
|
-
type="number"
|
|
212
|
-
value={val}
|
|
213
|
-
placeholder={placeholder}
|
|
214
|
-
min={minVal}
|
|
215
|
-
max={maxVal}
|
|
216
|
-
step={stepVal}
|
|
217
|
-
data-config-key={props.key}
|
|
218
|
-
data-field-type="number"
|
|
219
|
-
disabled={props.readonly}
|
|
220
|
-
onChange={(e) => {
|
|
221
|
-
setVal(e.target.value);
|
|
222
|
-
props.onChange(e.target.value);
|
|
223
|
-
fireAction(props, "change");
|
|
224
|
-
}}
|
|
225
|
-
onBlur={() => fireAction(props, "blur")}
|
|
226
|
-
onClick={() => fireAction(props, "click")}
|
|
227
|
-
/>
|
|
228
|
-
{!props.readonly && (
|
|
229
|
-
<button
|
|
230
|
-
type="button"
|
|
231
|
-
className="px-2 py-1.5 border border-[var(--border)] bg-transparent text-sm text-[var(--muted)] cursor-pointer transition-colors hover:bg-[var(--surface)] hover:text-[var(--text)] h-[36px] rounded-sm font-mono select-none"
|
|
232
|
-
onClick={() => step(1)}
|
|
233
|
-
>
|
|
234
|
-
+
|
|
235
|
-
</button>
|
|
236
|
-
)}
|
|
237
|
-
{unit && (
|
|
238
|
-
<span className="text-[11px] text-[var(--muted)] font-medium shrink-0 min-w-[20px]">
|
|
239
|
-
{unit}
|
|
240
|
-
</span>
|
|
241
|
-
)}
|
|
242
|
-
</div>
|
|
243
|
-
{hasRange && (
|
|
244
|
-
<div className="text-[10px] text-[var(--muted)] mt-0.5 opacity-70">
|
|
245
|
-
{minVal != null && maxVal != null
|
|
246
|
-
? `Range: ${minVal}–${maxVal}${unit ? ` ${unit}` : ""}`
|
|
247
|
-
: minVal != null
|
|
248
|
-
? `Min: ${minVal}${unit ? ` ${unit}` : ""}`
|
|
249
|
-
: `Max: ${maxVal}${unit ? ` ${unit}` : ""}`}
|
|
250
|
-
</div>
|
|
251
|
-
)}
|
|
252
|
-
</div>
|
|
253
|
-
);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// ── 4. Boolean ──────────────────────────────────────────────────────────
|
|
257
|
-
|
|
258
|
-
/** Pill-shaped toggle switch. Accepts boolean or string 'true'/'false' values. */
|
|
259
|
-
export function renderBooleanField(props: FieldRenderProps) {
|
|
260
|
-
return <BooleanFieldInner fp={props} />;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
function BooleanFieldInner({ fp: props }: { fp: FieldRenderProps }) {
|
|
264
|
-
const val =
|
|
265
|
-
props.value === true || props.value === "true" || props.value === "1";
|
|
266
|
-
const initialVal = props.isSet
|
|
267
|
-
? val
|
|
268
|
-
: props.schema.default === true || props.schema.default === "true";
|
|
269
|
-
|
|
270
|
-
const [localVal, setLocalVal] = useState(initialVal);
|
|
271
|
-
|
|
272
|
-
const handleToggle = () => {
|
|
273
|
-
const next = !localVal;
|
|
274
|
-
setLocalVal(next);
|
|
275
|
-
props.onChange(String(next));
|
|
276
|
-
fireAction(props, "change");
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
return (
|
|
280
|
-
<button
|
|
281
|
-
type="button"
|
|
282
|
-
className="flex items-center gap-2.5 cursor-pointer bg-transparent border-none p-0 group"
|
|
283
|
-
disabled={props.readonly}
|
|
284
|
-
onClick={() => {
|
|
285
|
-
handleToggle();
|
|
286
|
-
fireAction(props, "click");
|
|
287
|
-
}}
|
|
288
|
-
data-config-key={props.key}
|
|
289
|
-
data-field-type="boolean"
|
|
290
|
-
>
|
|
291
|
-
<div
|
|
292
|
-
className={`relative w-10 h-[22px] rounded-full transition-colors duration-200 ${
|
|
293
|
-
localVal ? "bg-[var(--accent)]" : "bg-[var(--muted)] opacity-40"
|
|
294
|
-
}`}
|
|
295
|
-
>
|
|
296
|
-
<div
|
|
297
|
-
className={`absolute top-[3px] w-4 h-4 bg-white rounded-full shadow-sm transition-all duration-200 ${
|
|
298
|
-
localVal ? "left-[21px]" : "left-[3px]"
|
|
299
|
-
}`}
|
|
300
|
-
/>
|
|
301
|
-
</div>
|
|
302
|
-
<span
|
|
303
|
-
className={`text-xs transition-colors ${localVal ? "text-[var(--text)] font-medium" : "text-[var(--muted)]"}`}
|
|
304
|
-
>
|
|
305
|
-
{localVal ? "Enabled" : "Disabled"}
|
|
306
|
-
</span>
|
|
307
|
-
</button>
|
|
308
|
-
);
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
// ── 5. URL ──────────────────────────────────────────────────────────────
|
|
312
|
-
|
|
313
|
-
/** URL input with type="url" browser validation. */
|
|
314
|
-
export function renderUrlField(props: FieldRenderProps) {
|
|
315
|
-
const value = props.isSet ? String(props.value ?? "") : "";
|
|
316
|
-
const placeholder =
|
|
317
|
-
(props.hint.placeholder as string | undefined) ??
|
|
318
|
-
(props.schema.default != null
|
|
319
|
-
? `Default: ${props.schema.default}`
|
|
320
|
-
: "https://...");
|
|
321
|
-
|
|
322
|
-
return (
|
|
323
|
-
<input
|
|
324
|
-
className={inputCls(!!props.errors?.length)}
|
|
325
|
-
type="url"
|
|
326
|
-
defaultValue={value}
|
|
327
|
-
placeholder={placeholder}
|
|
328
|
-
data-config-key={props.key}
|
|
329
|
-
data-field-type="url"
|
|
330
|
-
disabled={props.readonly}
|
|
331
|
-
onChange={(e) => {
|
|
332
|
-
props.onChange(e.target.value);
|
|
333
|
-
fireAction(props, "change");
|
|
334
|
-
}}
|
|
335
|
-
onBlur={() => fireAction(props, "blur")}
|
|
336
|
-
onClick={() => fireAction(props, "click")}
|
|
337
|
-
/>
|
|
338
|
-
);
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
// ── 6. Select ───────────────────────────────────────────────────────────
|
|
342
|
-
|
|
343
|
-
/** Dropdown select. Options from hint.options or schema.enum. */
|
|
344
|
-
export function RenderSelectField(props: FieldRenderProps) {
|
|
345
|
-
const { t } = useApp();
|
|
346
|
-
const enhancedOptions = (props.hint as Record<string, unknown>).options as
|
|
347
|
-
| Array<{ value: string; label: string; description?: string }>
|
|
348
|
-
| undefined;
|
|
349
|
-
|
|
350
|
-
const plainOptions: string[] =
|
|
351
|
-
(props.schema.enum as string[]) ??
|
|
352
|
-
props.schema.oneOf?.map((o) => String(o.const ?? o.description ?? "")) ??
|
|
353
|
-
[];
|
|
354
|
-
|
|
355
|
-
const allOptions = enhancedOptions
|
|
356
|
-
? enhancedOptions.map((o) => ({
|
|
357
|
-
value: o.value,
|
|
358
|
-
label: o.label,
|
|
359
|
-
description: o.description,
|
|
360
|
-
}))
|
|
361
|
-
: plainOptions.map((o) => ({
|
|
362
|
-
value: o,
|
|
363
|
-
label: o,
|
|
364
|
-
description: undefined as string | undefined,
|
|
365
|
-
}));
|
|
366
|
-
|
|
367
|
-
const value = props.isSet ? String(props.value ?? "") : "";
|
|
368
|
-
const effectiveValue = value || String(props.schema.default ?? "");
|
|
369
|
-
const useSearch = allOptions.length >= 5;
|
|
370
|
-
if (useSearch) {
|
|
371
|
-
return (
|
|
372
|
-
<SearchableSelectInner
|
|
373
|
-
fp={props}
|
|
374
|
-
options={allOptions}
|
|
375
|
-
effectiveValue={effectiveValue}
|
|
376
|
-
/>
|
|
377
|
-
);
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
return (
|
|
381
|
-
<select
|
|
382
|
-
className={`${INPUT_CLS} appearance-auto`}
|
|
383
|
-
defaultValue={effectiveValue}
|
|
384
|
-
data-config-key={props.key}
|
|
385
|
-
data-field-type="select"
|
|
386
|
-
disabled={props.readonly}
|
|
387
|
-
onChange={(e) => {
|
|
388
|
-
props.onChange(e.target.value);
|
|
389
|
-
fireAction(props, "change");
|
|
390
|
-
}}
|
|
391
|
-
onBlur={() => fireAction(props, "blur")}
|
|
392
|
-
onClick={() => fireAction(props, "click")}
|
|
393
|
-
>
|
|
394
|
-
{!props.required && (
|
|
395
|
-
<option value="">
|
|
396
|
-
{t("config-field.None", { defaultValue: "None" })}
|
|
397
|
-
</option>
|
|
398
|
-
)}
|
|
399
|
-
{allOptions.map((opt) => (
|
|
400
|
-
<option key={opt.value} value={opt.value}>
|
|
401
|
-
{opt.label}
|
|
402
|
-
{opt.description ? ` — ${opt.description}` : ""}
|
|
403
|
-
</option>
|
|
404
|
-
))}
|
|
405
|
-
</select>
|
|
406
|
-
);
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
function SearchableSelectInner({
|
|
410
|
-
fp: props,
|
|
411
|
-
options,
|
|
412
|
-
effectiveValue,
|
|
413
|
-
}: {
|
|
414
|
-
fp: FieldRenderProps;
|
|
415
|
-
options: Array<{ value: string; label: string; description?: string }>;
|
|
416
|
-
effectiveValue: string;
|
|
417
|
-
}) {
|
|
418
|
-
const { t } = useApp();
|
|
419
|
-
const matchingOpt = options.find((o) => o.value === effectiveValue);
|
|
420
|
-
const [inputVal, setInputVal] = useState(
|
|
421
|
-
matchingOpt?.label ?? effectiveValue,
|
|
422
|
-
);
|
|
423
|
-
const [open, setOpen] = useState(false);
|
|
424
|
-
const [filter, setFilter] = useState("");
|
|
425
|
-
const containerRef = useRef<HTMLDivElement>(null);
|
|
426
|
-
const inputRef = useRef<HTMLInputElement>(null);
|
|
427
|
-
|
|
428
|
-
const filtered = filter
|
|
429
|
-
? options.filter(
|
|
430
|
-
(o) =>
|
|
431
|
-
o.label.toLowerCase().includes(filter.toLowerCase()) ||
|
|
432
|
-
o.value.toLowerCase().includes(filter.toLowerCase()),
|
|
433
|
-
)
|
|
434
|
-
: options;
|
|
435
|
-
|
|
436
|
-
const select = useCallback(
|
|
437
|
-
(opt: { value: string; label: string }) => {
|
|
438
|
-
props.onChange(opt.value);
|
|
439
|
-
setInputVal(opt.label);
|
|
440
|
-
setOpen(false);
|
|
441
|
-
setFilter("");
|
|
442
|
-
fireAction(props, "change");
|
|
443
|
-
},
|
|
444
|
-
[props],
|
|
445
|
-
);
|
|
446
|
-
|
|
447
|
-
// Close on click outside
|
|
448
|
-
React.useEffect(() => {
|
|
449
|
-
if (!open) return;
|
|
450
|
-
const handler = (e: MouseEvent) => {
|
|
451
|
-
if (
|
|
452
|
-
containerRef.current &&
|
|
453
|
-
!containerRef.current.contains(e.target as Node)
|
|
454
|
-
) {
|
|
455
|
-
setOpen(false);
|
|
456
|
-
setFilter("");
|
|
457
|
-
}
|
|
458
|
-
};
|
|
459
|
-
document.addEventListener("mousedown", handler);
|
|
460
|
-
return () => document.removeEventListener("mousedown", handler);
|
|
461
|
-
}, [open]);
|
|
462
|
-
|
|
463
|
-
return (
|
|
464
|
-
<div className="relative" ref={containerRef}>
|
|
465
|
-
{/* Trigger button that looks like a select */}
|
|
466
|
-
<button
|
|
467
|
-
type="button"
|
|
468
|
-
className={`${inputCls(!!props.errors?.length)} text-left flex items-center justify-between gap-2 cursor-pointer`}
|
|
469
|
-
disabled={props.readonly}
|
|
470
|
-
onClick={() => {
|
|
471
|
-
setOpen(!open);
|
|
472
|
-
setFilter("");
|
|
473
|
-
}}
|
|
474
|
-
data-config-key={props.key}
|
|
475
|
-
data-field-type="select"
|
|
476
|
-
>
|
|
477
|
-
<span className={inputVal ? "" : "text-[var(--muted)] opacity-60"}>
|
|
478
|
-
{inputVal || "Select..."}
|
|
479
|
-
</span>
|
|
480
|
-
<span className="text-[var(--muted)] text-[10px] shrink-0">
|
|
481
|
-
{open ? "\u25B2" : "\u25BC"}
|
|
482
|
-
</span>
|
|
483
|
-
</button>
|
|
484
|
-
|
|
485
|
-
{/* Dropdown panel */}
|
|
486
|
-
{open && (
|
|
487
|
-
<div className="absolute z-50 left-0 right-0 mt-1 border border-[var(--border)] bg-[var(--card)] shadow-lg max-h-[280px] flex flex-col rounded-sm">
|
|
488
|
-
{/* Search input */}
|
|
489
|
-
<div className="p-1.5 border-b border-[var(--border)]">
|
|
490
|
-
<input
|
|
491
|
-
ref={inputRef}
|
|
492
|
-
className="w-full px-2 py-1.5 border border-[var(--border)] bg-[var(--bg)] text-[12px] font-[var(--mono)] focus:border-[var(--accent)] focus:outline-none rounded-sm"
|
|
493
|
-
type="text"
|
|
494
|
-
value={filter}
|
|
495
|
-
placeholder={`Search ${options.length} models...`}
|
|
496
|
-
onChange={(e) => setFilter(e.target.value)}
|
|
497
|
-
onKeyDown={(e) => {
|
|
498
|
-
if (e.key === "Escape") {
|
|
499
|
-
setOpen(false);
|
|
500
|
-
setFilter("");
|
|
501
|
-
} else if (e.key === "Enter" && filtered.length === 1) {
|
|
502
|
-
select(filtered[0]);
|
|
503
|
-
}
|
|
504
|
-
}}
|
|
505
|
-
/>
|
|
506
|
-
</div>
|
|
507
|
-
{/* Options list */}
|
|
508
|
-
<div className="overflow-y-auto flex-1">
|
|
509
|
-
{!props.required && (
|
|
510
|
-
<button
|
|
511
|
-
type="button"
|
|
512
|
-
className="w-full text-left px-3 py-1.5 text-[12px] text-[var(--muted)] hover:bg-[var(--bg-hover)] transition-colors italic"
|
|
513
|
-
onClick={() => {
|
|
514
|
-
props.onChange("");
|
|
515
|
-
setInputVal("");
|
|
516
|
-
setOpen(false);
|
|
517
|
-
setFilter("");
|
|
518
|
-
fireAction(props, "change");
|
|
519
|
-
}}
|
|
520
|
-
>
|
|
521
|
-
{t("config-field.None", { defaultValue: "None" })}
|
|
522
|
-
</button>
|
|
523
|
-
)}
|
|
524
|
-
{filtered.length === 0 && (
|
|
525
|
-
<div className="px-3 py-3 text-[12px] text-[var(--muted)] text-center">
|
|
526
|
-
{t("config-field.NoMatches", {
|
|
527
|
-
defaultValue: "No matches",
|
|
528
|
-
})}
|
|
529
|
-
</div>
|
|
530
|
-
)}
|
|
531
|
-
{filtered.map((opt) => (
|
|
532
|
-
<button
|
|
533
|
-
key={opt.value}
|
|
534
|
-
type="button"
|
|
535
|
-
className={`w-full text-left px-3 py-1.5 text-[12px] hover:bg-[var(--bg-hover)] transition-colors ${
|
|
536
|
-
opt.value === effectiveValue
|
|
537
|
-
? "bg-[color-mix(in_srgb,var(--accent)_10%,var(--card))] text-[var(--accent)] font-medium"
|
|
538
|
-
: ""
|
|
539
|
-
}`}
|
|
540
|
-
onClick={() => select(opt)}
|
|
541
|
-
>
|
|
542
|
-
{opt.label}
|
|
543
|
-
{opt.description && (
|
|
544
|
-
<span className="text-[var(--muted)] ml-1.5 text-[11px]">
|
|
545
|
-
{opt.description}
|
|
546
|
-
</span>
|
|
547
|
-
)}
|
|
548
|
-
</button>
|
|
549
|
-
))}
|
|
550
|
-
</div>
|
|
551
|
-
<div className="px-3 py-1 border-t border-[var(--border)] text-[10px] text-[var(--muted)]">
|
|
552
|
-
{filtered.length} of {options.length}{" "}
|
|
553
|
-
{t("config-field.models", { defaultValue: "models" })}
|
|
554
|
-
</div>
|
|
555
|
-
</div>
|
|
556
|
-
)}
|
|
557
|
-
</div>
|
|
558
|
-
);
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
// ── 7. Textarea ─────────────────────────────────────────────────────────
|
|
562
|
-
|
|
563
|
-
/** Multi-line text input with auto-resize. Auto-detected for maxLength > 200. */
|
|
564
|
-
export function renderTextareaField(props: FieldRenderProps) {
|
|
565
|
-
return <TextareaFieldInner fp={props} />;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
function TextareaFieldInner({ fp: props }: { fp: FieldRenderProps }) {
|
|
569
|
-
const value = props.isSet ? String(props.value ?? "") : "";
|
|
570
|
-
const placeholder =
|
|
571
|
-
(props.hint.placeholder as string | undefined) ?? "Enter text...";
|
|
572
|
-
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
|
573
|
-
|
|
574
|
-
const autoResize = useCallback(() => {
|
|
575
|
-
const el = textareaRef.current;
|
|
576
|
-
if (!el) return;
|
|
577
|
-
// Check if field-sizing is supported — if so, CSS handles it
|
|
578
|
-
if (globalThis.CSS?.supports?.("field-sizing", "content")) return;
|
|
579
|
-
el.style.height = "auto";
|
|
580
|
-
el.style.height = `${Math.max(72, el.scrollHeight)}px`;
|
|
581
|
-
}, []);
|
|
582
|
-
|
|
583
|
-
return (
|
|
584
|
-
<textarea
|
|
585
|
-
ref={textareaRef}
|
|
586
|
-
className="w-full px-3 py-2 border border-[var(--border)] bg-[var(--card)] text-[13px] font-[var(--mono)] transition-all focus:border-[var(--accent)] focus:outline-none focus:ring-1 focus:ring-[var(--accent)] box-border min-h-[72px] max-h-[400px] rounded-sm placeholder:text-[var(--muted)] placeholder:opacity-60"
|
|
587
|
-
style={{ fieldSizing: "content" } as React.CSSProperties}
|
|
588
|
-
defaultValue={value}
|
|
589
|
-
placeholder={placeholder}
|
|
590
|
-
data-config-key={props.key}
|
|
591
|
-
data-field-type="textarea"
|
|
592
|
-
disabled={props.readonly}
|
|
593
|
-
onChange={(e) => {
|
|
594
|
-
props.onChange(e.target.value);
|
|
595
|
-
fireAction(props, "change");
|
|
596
|
-
autoResize();
|
|
597
|
-
}}
|
|
598
|
-
onBlur={() => fireAction(props, "blur")}
|
|
599
|
-
onClick={() => fireAction(props, "click")}
|
|
600
|
-
onFocus={autoResize}
|
|
601
|
-
/>
|
|
602
|
-
);
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
// ── 8. Email ────────────────────────────────────────────────────────────
|
|
606
|
-
|
|
607
|
-
/** Email input with type="email" browser validation. */
|
|
608
|
-
export function renderEmailField(props: FieldRenderProps) {
|
|
609
|
-
const value = props.isSet ? String(props.value ?? "") : "";
|
|
610
|
-
const placeholder =
|
|
611
|
-
(props.hint.placeholder as string | undefined) ?? "user@example.com";
|
|
612
|
-
|
|
613
|
-
return (
|
|
614
|
-
<input
|
|
615
|
-
className={inputCls(!!props.errors?.length)}
|
|
616
|
-
type="email"
|
|
617
|
-
defaultValue={value}
|
|
618
|
-
placeholder={placeholder}
|
|
619
|
-
data-config-key={props.key}
|
|
620
|
-
data-field-type="email"
|
|
621
|
-
disabled={props.readonly}
|
|
622
|
-
onChange={(e) => {
|
|
623
|
-
props.onChange(e.target.value);
|
|
624
|
-
fireAction(props, "change");
|
|
625
|
-
}}
|
|
626
|
-
onBlur={() => fireAction(props, "blur")}
|
|
627
|
-
onClick={() => fireAction(props, "click")}
|
|
628
|
-
/>
|
|
629
|
-
);
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
// ── 9. Color ────────────────────────────────────────────────────────────
|
|
633
|
-
|
|
634
|
-
/** Color picker swatch paired with a hex text input. */
|
|
635
|
-
export function renderColorField(props: FieldRenderProps) {
|
|
636
|
-
return <ColorFieldInner fp={props} />;
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
function ColorFieldInner({ fp: props }: { fp: FieldRenderProps }) {
|
|
640
|
-
const initial = props.isSet ? String(props.value ?? "#000000") : "#000000";
|
|
641
|
-
const [color, setColor] = useState(initial);
|
|
642
|
-
|
|
643
|
-
const handleChange = (newColor: string) => {
|
|
644
|
-
setColor(newColor);
|
|
645
|
-
props.onChange(newColor);
|
|
646
|
-
fireAction(props, "change");
|
|
647
|
-
};
|
|
648
|
-
|
|
649
|
-
return (
|
|
650
|
-
<div className="flex items-center gap-2">
|
|
651
|
-
<input
|
|
652
|
-
className="w-[36px] h-[36px] border border-[var(--border)] p-0.5 cursor-pointer bg-transparent rounded-sm [&::-webkit-color-swatch-wrapper]:p-0 [&::-webkit-color-swatch]:border-none [&::-webkit-color-swatch]:rounded-sm"
|
|
653
|
-
type="color"
|
|
654
|
-
value={color}
|
|
655
|
-
data-config-key={props.key}
|
|
656
|
-
data-field-type="color"
|
|
657
|
-
disabled={props.readonly}
|
|
658
|
-
onChange={(e) => handleChange(e.target.value)}
|
|
659
|
-
onBlur={() => fireAction(props, "blur")}
|
|
660
|
-
onClick={() => fireAction(props, "click")}
|
|
661
|
-
/>
|
|
662
|
-
<input
|
|
663
|
-
className={`${inputCls(!!props.errors?.length)} flex-1`}
|
|
664
|
-
type="text"
|
|
665
|
-
value={color}
|
|
666
|
-
placeholder="#000000"
|
|
667
|
-
data-config-key={props.key}
|
|
668
|
-
data-field-type="color-text"
|
|
669
|
-
disabled={props.readonly}
|
|
670
|
-
onChange={(e) => handleChange(e.target.value)}
|
|
671
|
-
onBlur={() => fireAction(props, "blur")}
|
|
672
|
-
onClick={() => fireAction(props, "click")}
|
|
673
|
-
/>
|
|
674
|
-
</div>
|
|
675
|
-
);
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
// ── 10. Radio ───────────────────────────────────────────────────────────
|
|
679
|
-
|
|
680
|
-
/** Vertical radio button group. Supports per-option descriptions. */
|
|
681
|
-
export function renderRadioField(props: FieldRenderProps) {
|
|
682
|
-
return <RadioFieldInner fp={props} />;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
function RadioFieldInner({ fp: props }: { fp: FieldRenderProps }) {
|
|
686
|
-
const options: Array<{
|
|
687
|
-
value: string;
|
|
688
|
-
label: string;
|
|
689
|
-
description?: string;
|
|
690
|
-
disabled?: boolean;
|
|
691
|
-
}> =
|
|
692
|
-
((props.hint as Record<string, unknown>).options as
|
|
693
|
-
| typeof options
|
|
694
|
-
| undefined) ??
|
|
695
|
-
((props.schema.enum as string[]) ?? []).map((v) => ({
|
|
696
|
-
value: String(v),
|
|
697
|
-
label: String(v),
|
|
698
|
-
}));
|
|
699
|
-
|
|
700
|
-
const initial = props.isSet
|
|
701
|
-
? String(props.value ?? "")
|
|
702
|
-
: String(props.schema.default ?? "");
|
|
703
|
-
const [selected, setSelected] = useState(initial);
|
|
704
|
-
|
|
705
|
-
const handleChange = (val: string) => {
|
|
706
|
-
setSelected(val);
|
|
707
|
-
props.onChange(val);
|
|
708
|
-
fireAction(props, "change");
|
|
709
|
-
};
|
|
710
|
-
|
|
711
|
-
return (
|
|
712
|
-
<div
|
|
713
|
-
className="flex flex-col gap-1.5"
|
|
714
|
-
data-config-key={props.key}
|
|
715
|
-
data-field-type="radio"
|
|
716
|
-
>
|
|
717
|
-
{options.map((opt) => (
|
|
718
|
-
<label
|
|
719
|
-
key={opt.value}
|
|
720
|
-
className="flex items-start gap-2 cursor-pointer text-[13px]"
|
|
721
|
-
>
|
|
722
|
-
<input
|
|
723
|
-
type="radio"
|
|
724
|
-
name={props.key}
|
|
725
|
-
value={opt.value}
|
|
726
|
-
checked={opt.value === selected}
|
|
727
|
-
disabled={props.readonly || opt.disabled}
|
|
728
|
-
onChange={() => handleChange(opt.value)}
|
|
729
|
-
onClick={() => fireAction(props, "click")}
|
|
730
|
-
onBlur={() => fireAction(props, "blur")}
|
|
731
|
-
className="mt-0.5 shrink-0"
|
|
732
|
-
/>
|
|
733
|
-
<span>
|
|
734
|
-
{opt.label}
|
|
735
|
-
{opt.description && (
|
|
736
|
-
<div className="text-[11px] text-[var(--muted)] mt-px">
|
|
737
|
-
{opt.description}
|
|
738
|
-
</div>
|
|
739
|
-
)}
|
|
740
|
-
</span>
|
|
741
|
-
</label>
|
|
742
|
-
))}
|
|
743
|
-
</div>
|
|
744
|
-
);
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
// ── 11. Multiselect ─────────────────────────────────────────────────────
|
|
748
|
-
|
|
749
|
-
/** Checkbox group for selecting multiple values from options. */
|
|
750
|
-
export function renderMultiselectField(props: FieldRenderProps) {
|
|
751
|
-
return <MultiselectFieldInner fp={props} />;
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
function MultiselectFieldInner({ fp: props }: { fp: FieldRenderProps }) {
|
|
755
|
-
const options: Array<{ value: string; label: string }> =
|
|
756
|
-
((props.hint as Record<string, unknown>).options as
|
|
757
|
-
| typeof options
|
|
758
|
-
| undefined) ??
|
|
759
|
-
((props.schema.items?.enum as string[]) ?? []).map((v) => ({
|
|
760
|
-
value: String(v),
|
|
761
|
-
label: String(v),
|
|
762
|
-
}));
|
|
763
|
-
|
|
764
|
-
const rawVal = props.isSet ? props.value : [];
|
|
765
|
-
const initialSet = new Set(Array.isArray(rawVal) ? rawVal.map(String) : []);
|
|
766
|
-
const [selected, setSelected] = useState(initialSet);
|
|
767
|
-
|
|
768
|
-
const toggle = (optValue: string) => {
|
|
769
|
-
setSelected((prev) => {
|
|
770
|
-
const next = new Set(prev);
|
|
771
|
-
if (next.has(optValue)) {
|
|
772
|
-
next.delete(optValue);
|
|
773
|
-
} else {
|
|
774
|
-
next.add(optValue);
|
|
775
|
-
}
|
|
776
|
-
props.onChange([...next]);
|
|
777
|
-
fireAction(props, "change");
|
|
778
|
-
return next;
|
|
779
|
-
});
|
|
780
|
-
};
|
|
781
|
-
|
|
782
|
-
const remove = (optValue: string) => {
|
|
783
|
-
setSelected((prev) => {
|
|
784
|
-
const next = new Set(prev);
|
|
785
|
-
next.delete(optValue);
|
|
786
|
-
props.onChange([...next]);
|
|
787
|
-
fireAction(props, "change");
|
|
788
|
-
return next;
|
|
789
|
-
});
|
|
790
|
-
};
|
|
791
|
-
|
|
792
|
-
const selectedOptions = options.filter((o) => selected.has(o.value));
|
|
793
|
-
|
|
794
|
-
return (
|
|
795
|
-
<div
|
|
796
|
-
className="flex flex-col gap-2"
|
|
797
|
-
data-config-key={props.key}
|
|
798
|
-
data-field-type="multiselect"
|
|
799
|
-
>
|
|
800
|
-
{/* Selected tag pills */}
|
|
801
|
-
{selectedOptions.length > 0 && (
|
|
802
|
-
<div className="flex flex-wrap gap-1">
|
|
803
|
-
{selectedOptions.map((opt) => (
|
|
804
|
-
<span
|
|
805
|
-
key={opt.value}
|
|
806
|
-
className="inline-flex items-center gap-1 px-2 py-0.5 text-[11px] bg-[var(--accent-subtle,rgba(59,130,246,0.1))] text-[var(--accent)] border border-[var(--accent)] border-opacity-30 rounded-full"
|
|
807
|
-
>
|
|
808
|
-
{opt.label}
|
|
809
|
-
{!props.readonly && (
|
|
810
|
-
<button
|
|
811
|
-
type="button"
|
|
812
|
-
className="inline-flex items-center justify-center w-3.5 h-3.5 text-[10px] rounded-full hover:bg-[var(--accent)] hover:text-[var(--accent-foreground,#1a1f26)] transition-colors cursor-pointer"
|
|
813
|
-
onClick={() => remove(opt.value)}
|
|
814
|
-
>
|
|
815
|
-
×
|
|
816
|
-
</button>
|
|
817
|
-
)}
|
|
818
|
-
</span>
|
|
819
|
-
))}
|
|
820
|
-
</div>
|
|
821
|
-
)}
|
|
822
|
-
{/* Checkbox list */}
|
|
823
|
-
<div className="flex flex-col gap-1">
|
|
824
|
-
{options.map((opt) => (
|
|
825
|
-
<label
|
|
826
|
-
key={opt.value}
|
|
827
|
-
className="flex items-center gap-2 cursor-pointer text-[13px]"
|
|
828
|
-
>
|
|
829
|
-
<input
|
|
830
|
-
type="checkbox"
|
|
831
|
-
value={opt.value}
|
|
832
|
-
checked={selected.has(opt.value)}
|
|
833
|
-
disabled={props.readonly}
|
|
834
|
-
onChange={() => toggle(opt.value)}
|
|
835
|
-
onClick={() => fireAction(props, "click")}
|
|
836
|
-
onBlur={() => fireAction(props, "blur")}
|
|
837
|
-
/>
|
|
838
|
-
<span>{opt.label}</span>
|
|
839
|
-
</label>
|
|
840
|
-
))}
|
|
841
|
-
</div>
|
|
842
|
-
</div>
|
|
843
|
-
);
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
// ── 12. Date ────────────────────────────────────────────────────────────
|
|
847
|
-
|
|
848
|
-
/** Native date picker input. */
|
|
849
|
-
export function renderDateField(props: FieldRenderProps) {
|
|
850
|
-
const value = props.isSet ? String(props.value ?? "") : "";
|
|
851
|
-
const inputType =
|
|
852
|
-
props.schema.format === "date-time" ? "datetime-local" : "date";
|
|
853
|
-
|
|
854
|
-
return (
|
|
855
|
-
<input
|
|
856
|
-
className={inputCls(!!props.errors?.length)}
|
|
857
|
-
type={inputType}
|
|
858
|
-
defaultValue={value}
|
|
859
|
-
data-config-key={props.key}
|
|
860
|
-
data-field-type="date"
|
|
861
|
-
disabled={props.readonly}
|
|
862
|
-
onChange={(e) => {
|
|
863
|
-
props.onChange(e.target.value);
|
|
864
|
-
fireAction(props, "change");
|
|
865
|
-
}}
|
|
866
|
-
onBlur={() => fireAction(props, "blur")}
|
|
867
|
-
onClick={() => fireAction(props, "click")}
|
|
868
|
-
/>
|
|
869
|
-
);
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
// ── 13. JSON ────────────────────────────────────────────────────────────
|
|
873
|
-
|
|
874
|
-
/** JSON editor textarea with parse validation on blur. Shows inline error for invalid JSON. */
|
|
875
|
-
export function renderJsonField(props: FieldRenderProps) {
|
|
876
|
-
return <JsonFieldInner fp={props} />;
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
function JsonFieldInner({ fp: props }: { fp: FieldRenderProps }) {
|
|
880
|
-
const { t } = useApp();
|
|
881
|
-
const initial = props.isSet ? String(props.value ?? "") : "";
|
|
882
|
-
const [jsonError, setJsonError] = useState<string | null>(null);
|
|
883
|
-
|
|
884
|
-
const handleBlur = (e: React.FocusEvent<HTMLTextAreaElement>) => {
|
|
885
|
-
const val = e.target.value.trim();
|
|
886
|
-
if (val) {
|
|
887
|
-
try {
|
|
888
|
-
const parsed = JSON.parse(val);
|
|
889
|
-
const jsonStr = JSON.stringify(parsed);
|
|
890
|
-
if (/__proto__|constructor\s*:/.test(jsonStr)) {
|
|
891
|
-
setJsonError("Unsafe JSON: contains dangerous keys");
|
|
892
|
-
return;
|
|
893
|
-
}
|
|
894
|
-
setJsonError(null);
|
|
895
|
-
} catch (err) {
|
|
896
|
-
setJsonError(err instanceof Error ? err.message : "Invalid JSON");
|
|
897
|
-
}
|
|
898
|
-
} else {
|
|
899
|
-
setJsonError(null);
|
|
900
|
-
}
|
|
901
|
-
fireAction(props, "blur");
|
|
902
|
-
};
|
|
903
|
-
|
|
904
|
-
return (
|
|
905
|
-
<div>
|
|
906
|
-
<textarea
|
|
907
|
-
className={`w-full px-2.5 py-[7px] border ${
|
|
908
|
-
jsonError || props.errors?.length
|
|
909
|
-
? "border-[var(--destructive)]"
|
|
910
|
-
: "border-[var(--border)]"
|
|
911
|
-
} bg-[var(--card)] text-[13px] font-mono transition-all focus:border-[var(--accent)] focus:outline-none focus:ring-1 focus:ring-[var(--accent)] box-border min-h-[100px] resize-y rounded-sm`}
|
|
912
|
-
defaultValue={initial}
|
|
913
|
-
placeholder={t("config-field.KeyValue", {
|
|
914
|
-
defaultValue: "Key-value JSON",
|
|
915
|
-
})}
|
|
916
|
-
rows={6}
|
|
917
|
-
data-config-key={props.key}
|
|
918
|
-
data-field-type="json"
|
|
919
|
-
disabled={props.readonly}
|
|
920
|
-
onChange={(e) => {
|
|
921
|
-
props.onChange(e.target.value);
|
|
922
|
-
fireAction(props, "change");
|
|
923
|
-
}}
|
|
924
|
-
onBlur={handleBlur}
|
|
925
|
-
onClick={() => fireAction(props, "click")}
|
|
926
|
-
/>
|
|
927
|
-
{jsonError && (
|
|
928
|
-
<div className="text-[11px] text-[var(--destructive)] mt-1 leading-snug">
|
|
929
|
-
{jsonError}
|
|
930
|
-
</div>
|
|
931
|
-
)}
|
|
932
|
-
</div>
|
|
933
|
-
);
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
// ── 14. Code ────────────────────────────────────────────────────────────
|
|
937
|
-
|
|
938
|
-
/** Monospaced code editor textarea for templates and snippets. */
|
|
939
|
-
export function renderCodeField(props: FieldRenderProps) {
|
|
940
|
-
const value = props.isSet ? String(props.value ?? "") : "";
|
|
941
|
-
const placeholder =
|
|
942
|
-
(props.hint.placeholder as string | undefined) ?? "Enter code...";
|
|
943
|
-
|
|
944
|
-
return (
|
|
945
|
-
<textarea
|
|
946
|
-
className={`w-full px-2.5 py-[7px] border ${
|
|
947
|
-
props.errors?.length
|
|
948
|
-
? "border-[var(--destructive)]"
|
|
949
|
-
: "border-[var(--border)]"
|
|
950
|
-
} bg-[var(--card)] text-[13px] font-mono transition-all focus:border-[var(--accent)] focus:outline-none focus:ring-1 focus:ring-[var(--accent)] box-border min-h-[100px] resize-y rounded-sm`}
|
|
951
|
-
defaultValue={value}
|
|
952
|
-
placeholder={placeholder}
|
|
953
|
-
rows={6}
|
|
954
|
-
data-config-key={props.key}
|
|
955
|
-
data-field-type="code"
|
|
956
|
-
disabled={props.readonly}
|
|
957
|
-
onChange={(e) => {
|
|
958
|
-
props.onChange(e.target.value);
|
|
959
|
-
fireAction(props, "change");
|
|
960
|
-
}}
|
|
961
|
-
onBlur={() => fireAction(props, "blur")}
|
|
962
|
-
onClick={() => fireAction(props, "click")}
|
|
963
|
-
/>
|
|
964
|
-
);
|
|
965
|
-
}
|
|
966
|
-
|
|
967
|
-
// ── 15. Array ───────────────────────────────────────────────────────────
|
|
968
|
-
|
|
969
|
-
/** Add/remove items list. Max 100 items. Parses comma-separated strings. */
|
|
970
|
-
export function renderArrayField(props: FieldRenderProps) {
|
|
971
|
-
return <ArrayFieldInner fp={props} />;
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
function ArrayItem({
|
|
975
|
-
index,
|
|
976
|
-
value,
|
|
977
|
-
total,
|
|
978
|
-
hasError,
|
|
979
|
-
readonly,
|
|
980
|
-
onChange,
|
|
981
|
-
onRemove,
|
|
982
|
-
onMoveUp,
|
|
983
|
-
onMoveDown,
|
|
984
|
-
onBlur,
|
|
985
|
-
}: {
|
|
986
|
-
index: number;
|
|
987
|
-
value: string;
|
|
988
|
-
total: number;
|
|
989
|
-
hasError: boolean;
|
|
990
|
-
readonly?: boolean;
|
|
991
|
-
onChange: (value: string) => void;
|
|
992
|
-
onRemove: () => void;
|
|
993
|
-
onMoveUp: () => void;
|
|
994
|
-
onMoveDown: () => void;
|
|
995
|
-
onBlur: () => void;
|
|
996
|
-
}) {
|
|
997
|
-
const { t } = useApp();
|
|
998
|
-
return (
|
|
999
|
-
<div className="flex items-center gap-1">
|
|
1000
|
-
{!readonly && (
|
|
1001
|
-
<div className="flex flex-col shrink-0">
|
|
1002
|
-
<button
|
|
1003
|
-
type="button"
|
|
1004
|
-
className="px-1 py-0 text-[10px] leading-tight text-[var(--muted)] cursor-pointer hover:text-[var(--text)] disabled:opacity-30 disabled:cursor-not-allowed"
|
|
1005
|
-
onClick={onMoveUp}
|
|
1006
|
-
disabled={index === 0}
|
|
1007
|
-
title={t("config-field.MoveUp", {
|
|
1008
|
-
defaultValue: "Move up",
|
|
1009
|
-
})}
|
|
1010
|
-
>
|
|
1011
|
-
▲
|
|
1012
|
-
</button>
|
|
1013
|
-
<button
|
|
1014
|
-
type="button"
|
|
1015
|
-
className="px-1 py-0 text-[10px] leading-tight text-[var(--muted)] cursor-pointer hover:text-[var(--text)] disabled:opacity-30 disabled:cursor-not-allowed"
|
|
1016
|
-
onClick={onMoveDown}
|
|
1017
|
-
disabled={index === total - 1}
|
|
1018
|
-
title={t("config-field.MoveDown", {
|
|
1019
|
-
defaultValue: "Move down",
|
|
1020
|
-
})}
|
|
1021
|
-
>
|
|
1022
|
-
<ChevronDown className="w-3 h-3" />
|
|
1023
|
-
</button>
|
|
1024
|
-
</div>
|
|
1025
|
-
)}
|
|
1026
|
-
<input
|
|
1027
|
-
className={`${inputCls(hasError)} flex-1`}
|
|
1028
|
-
type="text"
|
|
1029
|
-
value={value}
|
|
1030
|
-
placeholder={`Item ${index + 1}`}
|
|
1031
|
-
disabled={readonly}
|
|
1032
|
-
onChange={(e) => onChange(e.target.value)}
|
|
1033
|
-
onBlur={onBlur}
|
|
1034
|
-
/>
|
|
1035
|
-
{!readonly && (
|
|
1036
|
-
<button
|
|
1037
|
-
type="button"
|
|
1038
|
-
className="px-2 py-1.5 border border-[var(--border)] bg-[var(--bg-hover)] text-xs text-[var(--muted)] cursor-pointer transition-colors hover:bg-[var(--surface)] hover:text-[var(--destructive)] h-[36px] rounded-sm"
|
|
1039
|
-
onClick={onRemove}
|
|
1040
|
-
>
|
|
1041
|
-
<X className="w-3 h-3" />
|
|
1042
|
-
</button>
|
|
1043
|
-
)}
|
|
1044
|
-
</div>
|
|
1045
|
-
);
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
function ArrayFieldInner({ fp: props }: { fp: FieldRenderProps }) {
|
|
1049
|
-
const { t } = useApp();
|
|
1050
|
-
const rawVal = props.isSet ? props.value : [];
|
|
1051
|
-
const initialItems: string[] = Array.isArray(rawVal)
|
|
1052
|
-
? rawVal.map(String)
|
|
1053
|
-
: [];
|
|
1054
|
-
const [items, setItems] = useState<string[]>(initialItems);
|
|
1055
|
-
|
|
1056
|
-
const updateItems = (nextItems: string[]) => {
|
|
1057
|
-
setItems(nextItems);
|
|
1058
|
-
props.onChange(nextItems);
|
|
1059
|
-
fireAction(props, "change");
|
|
1060
|
-
};
|
|
1061
|
-
|
|
1062
|
-
const MAX_ARRAY_ITEMS = 100;
|
|
1063
|
-
const addItem = () => {
|
|
1064
|
-
if (items.length >= MAX_ARRAY_ITEMS) return;
|
|
1065
|
-
updateItems([...items, ""]);
|
|
1066
|
-
};
|
|
1067
|
-
|
|
1068
|
-
const removeItem = (index: number) => {
|
|
1069
|
-
updateItems(items.filter((_, i) => i !== index));
|
|
1070
|
-
};
|
|
1071
|
-
|
|
1072
|
-
const changeItem = (index: number, value: string) => {
|
|
1073
|
-
const next = [...items];
|
|
1074
|
-
next[index] = value;
|
|
1075
|
-
updateItems(next);
|
|
1076
|
-
};
|
|
1077
|
-
|
|
1078
|
-
const moveItem = (from: number, to: number) => {
|
|
1079
|
-
const next = [...items];
|
|
1080
|
-
const [moved] = next.splice(from, 1);
|
|
1081
|
-
next.splice(to, 0, moved);
|
|
1082
|
-
updateItems(next);
|
|
1083
|
-
};
|
|
1084
|
-
|
|
1085
|
-
return (
|
|
1086
|
-
<div
|
|
1087
|
-
className="flex flex-col gap-1.5"
|
|
1088
|
-
data-config-key={props.key}
|
|
1089
|
-
data-field-type="array"
|
|
1090
|
-
>
|
|
1091
|
-
{items.map((item, index) => (
|
|
1092
|
-
<ArrayItem
|
|
1093
|
-
// biome-ignore lint/suspicious/noArrayIndexKey: composite key with index as tiebreaker
|
|
1094
|
-
key={`${index}-${items.length}`}
|
|
1095
|
-
index={index}
|
|
1096
|
-
value={item}
|
|
1097
|
-
total={items.length}
|
|
1098
|
-
hasError={!!props.errors?.length}
|
|
1099
|
-
readonly={props.readonly}
|
|
1100
|
-
onChange={(v) => changeItem(index, v)}
|
|
1101
|
-
onRemove={() => {
|
|
1102
|
-
removeItem(index);
|
|
1103
|
-
fireAction(props, "click");
|
|
1104
|
-
}}
|
|
1105
|
-
onMoveUp={() => moveItem(index, index - 1)}
|
|
1106
|
-
onMoveDown={() => moveItem(index, index + 1)}
|
|
1107
|
-
onBlur={() => fireAction(props, "blur")}
|
|
1108
|
-
/>
|
|
1109
|
-
))}
|
|
1110
|
-
{!props.readonly && (
|
|
1111
|
-
<button
|
|
1112
|
-
type="button"
|
|
1113
|
-
className="self-start px-3 py-1.5 border border-dashed border-[var(--border)] bg-transparent text-[11px] text-[var(--muted)] cursor-pointer transition-colors hover:bg-[var(--bg-hover)] hover:text-[var(--text)] hover:border-[var(--accent)] rounded-sm"
|
|
1114
|
-
onClick={() => {
|
|
1115
|
-
addItem();
|
|
1116
|
-
fireAction(props, "click");
|
|
1117
|
-
}}
|
|
1118
|
-
>
|
|
1119
|
-
{t("config-field.AddItem", { defaultValue: "Add item" })}
|
|
1120
|
-
</button>
|
|
1121
|
-
)}
|
|
1122
|
-
</div>
|
|
1123
|
-
);
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
// ── 16. Key-Value ───────────────────────────────────────────────────────
|
|
1127
|
-
|
|
1128
|
-
/** Key-value pair editor with add/remove rows. Blocks prototype pollution keys. */
|
|
1129
|
-
export function renderKeyValueField(props: FieldRenderProps) {
|
|
1130
|
-
return <KeyValueFieldInner fp={props} />;
|
|
1131
|
-
}
|
|
1132
|
-
|
|
1133
|
-
function KeyValueFieldInner({ fp: props }: { fp: FieldRenderProps }) {
|
|
1134
|
-
const { t } = useApp();
|
|
1135
|
-
const rawVal = props.isSet ? props.value : {};
|
|
1136
|
-
const initialPairs: Array<{ key: string; value: string }> =
|
|
1137
|
-
rawVal && typeof rawVal === "object" && !Array.isArray(rawVal)
|
|
1138
|
-
? Object.entries(rawVal as Record<string, unknown>).map(([k, v]) => ({
|
|
1139
|
-
key: k,
|
|
1140
|
-
value: String(v ?? ""),
|
|
1141
|
-
}))
|
|
1142
|
-
: [];
|
|
1143
|
-
const [pairs, setPairs] = useState(initialPairs);
|
|
1144
|
-
|
|
1145
|
-
const emitChange = (next: Array<{ key: string; value: string }>) => {
|
|
1146
|
-
setPairs(next);
|
|
1147
|
-
const obj: Record<string, string> = {};
|
|
1148
|
-
for (const p of next) {
|
|
1149
|
-
if (p.key) obj[p.key] = p.value;
|
|
1150
|
-
}
|
|
1151
|
-
props.onChange(obj);
|
|
1152
|
-
fireAction(props, "change");
|
|
1153
|
-
};
|
|
1154
|
-
|
|
1155
|
-
const addRow = () => {
|
|
1156
|
-
emitChange([...pairs, { key: "", value: "" }]);
|
|
1157
|
-
};
|
|
1158
|
-
|
|
1159
|
-
const removeRow = (index: number) => {
|
|
1160
|
-
emitChange(pairs.filter((_, i) => i !== index));
|
|
1161
|
-
};
|
|
1162
|
-
|
|
1163
|
-
const BLOCKED_KEYS = ["__proto__", "constructor", "prototype"];
|
|
1164
|
-
const updateRow = (index: number, field: "key" | "value", val: string) => {
|
|
1165
|
-
if (field === "key" && BLOCKED_KEYS.includes(val)) return;
|
|
1166
|
-
const next = [...pairs];
|
|
1167
|
-
next[index] = { ...next[index], [field]: val };
|
|
1168
|
-
emitChange(next);
|
|
1169
|
-
};
|
|
1170
|
-
|
|
1171
|
-
return (
|
|
1172
|
-
<div
|
|
1173
|
-
className="flex flex-col gap-1.5"
|
|
1174
|
-
data-config-key={props.key}
|
|
1175
|
-
data-field-type="keyvalue"
|
|
1176
|
-
>
|
|
1177
|
-
{pairs.map((pair, index) => (
|
|
1178
|
-
<div
|
|
1179
|
-
key={`${pair.key}:${pair.value}`}
|
|
1180
|
-
className="flex items-center gap-1"
|
|
1181
|
-
>
|
|
1182
|
-
<input
|
|
1183
|
-
className={`${inputCls(!!props.errors?.length)} flex-1`}
|
|
1184
|
-
type="text"
|
|
1185
|
-
value={pair.key}
|
|
1186
|
-
placeholder={t("config-field.Key", { defaultValue: "Key" })}
|
|
1187
|
-
disabled={props.readonly}
|
|
1188
|
-
onChange={(e) => updateRow(index, "key", e.target.value)}
|
|
1189
|
-
onBlur={() => fireAction(props, "blur")}
|
|
1190
|
-
/>
|
|
1191
|
-
<input
|
|
1192
|
-
className={`${inputCls(!!props.errors?.length)} flex-1`}
|
|
1193
|
-
type="text"
|
|
1194
|
-
value={pair.value}
|
|
1195
|
-
placeholder={t("config-field.Value", { defaultValue: "Value" })}
|
|
1196
|
-
disabled={props.readonly}
|
|
1197
|
-
onChange={(e) => updateRow(index, "value", e.target.value)}
|
|
1198
|
-
onBlur={() => fireAction(props, "blur")}
|
|
1199
|
-
/>
|
|
1200
|
-
{!props.readonly && (
|
|
1201
|
-
<button
|
|
1202
|
-
type="button"
|
|
1203
|
-
className="px-2 py-1.5 border border-[var(--border)] bg-[var(--bg-hover)] text-xs text-[var(--muted)] cursor-pointer transition-colors hover:bg-[var(--surface)] hover:text-[var(--destructive)] h-[36px] rounded-sm"
|
|
1204
|
-
onClick={() => {
|
|
1205
|
-
removeRow(index);
|
|
1206
|
-
fireAction(props, "click");
|
|
1207
|
-
}}
|
|
1208
|
-
>
|
|
1209
|
-
<X className="w-3 h-3" />
|
|
1210
|
-
</button>
|
|
1211
|
-
)}
|
|
1212
|
-
</div>
|
|
1213
|
-
))}
|
|
1214
|
-
{!props.readonly && (
|
|
1215
|
-
<button
|
|
1216
|
-
type="button"
|
|
1217
|
-
className="self-start px-3 py-1.5 border border-dashed border-[var(--border)] bg-transparent text-[11px] text-[var(--muted)] cursor-pointer transition-colors hover:bg-[var(--bg-hover)] hover:text-[var(--text)] hover:border-[var(--accent)] rounded-sm"
|
|
1218
|
-
onClick={() => {
|
|
1219
|
-
addRow();
|
|
1220
|
-
fireAction(props, "click");
|
|
1221
|
-
}}
|
|
1222
|
-
>
|
|
1223
|
-
{t("config-field.AddRow", { defaultValue: "Add row" })}
|
|
1224
|
-
</button>
|
|
1225
|
-
)}
|
|
1226
|
-
</div>
|
|
1227
|
-
);
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
|
-
// ── 17. Datetime ────────────────────────────────────────────────────────
|
|
1231
|
-
|
|
1232
|
-
/** Combined date and time picker (datetime-local). */
|
|
1233
|
-
export function renderDatetimeField(props: FieldRenderProps) {
|
|
1234
|
-
const value = props.isSet ? String(props.value ?? "") : "";
|
|
1235
|
-
|
|
1236
|
-
return (
|
|
1237
|
-
<input
|
|
1238
|
-
className={inputCls(!!props.errors?.length)}
|
|
1239
|
-
type="datetime-local"
|
|
1240
|
-
defaultValue={value}
|
|
1241
|
-
data-config-key={props.key}
|
|
1242
|
-
data-field-type="datetime"
|
|
1243
|
-
disabled={props.readonly}
|
|
1244
|
-
onChange={(e) => {
|
|
1245
|
-
props.onChange(e.target.value);
|
|
1246
|
-
fireAction(props, "change");
|
|
1247
|
-
}}
|
|
1248
|
-
onBlur={() => fireAction(props, "blur")}
|
|
1249
|
-
onClick={() => fireAction(props, "click")}
|
|
1250
|
-
/>
|
|
1251
|
-
);
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
// ── 18. File ────────────────────────────────────────────────────────────
|
|
1255
|
-
|
|
1256
|
-
/** File path text input with path traversal guard. */
|
|
1257
|
-
export function RenderFileField(props: FieldRenderProps) {
|
|
1258
|
-
const { t } = useApp();
|
|
1259
|
-
const value = props.isSet ? String(props.value ?? "") : "";
|
|
1260
|
-
const placeholder =
|
|
1261
|
-
(props.hint.placeholder as string | undefined) ?? "/path/to/file";
|
|
1262
|
-
|
|
1263
|
-
return (
|
|
1264
|
-
<div>
|
|
1265
|
-
<input
|
|
1266
|
-
className={inputCls(!!props.errors?.length)}
|
|
1267
|
-
type="text"
|
|
1268
|
-
defaultValue={value}
|
|
1269
|
-
placeholder={placeholder}
|
|
1270
|
-
data-config-key={props.key}
|
|
1271
|
-
data-field-type="file"
|
|
1272
|
-
disabled={props.readonly}
|
|
1273
|
-
onChange={(e) => {
|
|
1274
|
-
const v = e.target.value;
|
|
1275
|
-
if (v.includes("..")) return; // block path traversal
|
|
1276
|
-
props.onChange(v);
|
|
1277
|
-
fireAction(props, "change");
|
|
1278
|
-
}}
|
|
1279
|
-
onBlur={() => fireAction(props, "blur")}
|
|
1280
|
-
onClick={() => fireAction(props, "click")}
|
|
1281
|
-
/>
|
|
1282
|
-
<div className="text-[11px] text-[var(--muted)] mt-0.5">
|
|
1283
|
-
{t("config-field.EnterAFilePathOr", {
|
|
1284
|
-
defaultValue: "Enter a file path or paste one here.",
|
|
1285
|
-
})}
|
|
1286
|
-
</div>
|
|
1287
|
-
</div>
|
|
1288
|
-
);
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
|
-
// ── 19. Custom ──────────────────────────────────────────────────────────
|
|
1292
|
-
|
|
1293
|
-
/** Placeholder for plugin-provided custom React components. */
|
|
1294
|
-
export function RenderCustomField(props: FieldRenderProps) {
|
|
1295
|
-
const { t } = useApp();
|
|
1296
|
-
const componentName = (props.hint as Record<string, unknown>).component as
|
|
1297
|
-
| string
|
|
1298
|
-
| undefined;
|
|
1299
|
-
|
|
1300
|
-
return (
|
|
1301
|
-
<div
|
|
1302
|
-
className="px-3 py-4 border border-dashed border-[var(--border)] bg-[var(--bg-hover)] text-[13px] text-[var(--muted)]"
|
|
1303
|
-
data-config-key={props.key}
|
|
1304
|
-
data-field-type="custom"
|
|
1305
|
-
>
|
|
1306
|
-
{t("config-field.CustomComponent", {
|
|
1307
|
-
defaultValue: "Custom component:",
|
|
1308
|
-
})}{" "}
|
|
1309
|
-
{componentName ?? props.fieldType}
|
|
1310
|
-
</div>
|
|
1311
|
-
);
|
|
1312
|
-
}
|
|
1313
|
-
|
|
1314
|
-
// ── 20. Markdown ─────────────────────────────────────────────────────────
|
|
1315
|
-
|
|
1316
|
-
/**
|
|
1317
|
-
* Simple markdown renderer for preview mode.
|
|
1318
|
-
* Converts basic markdown patterns to React elements without external dependencies.
|
|
1319
|
-
*/
|
|
1320
|
-
function renderMarkdown(text: string): React.ReactNode {
|
|
1321
|
-
if (!text) return null;
|
|
1322
|
-
|
|
1323
|
-
const blocks = text.split(/\n\n+/);
|
|
1324
|
-
const elements: React.ReactNode[] = [];
|
|
1325
|
-
|
|
1326
|
-
blocks.forEach((block) => {
|
|
1327
|
-
const trimmed = block.trim();
|
|
1328
|
-
if (!trimmed) return;
|
|
1329
|
-
|
|
1330
|
-
// Fenced code block
|
|
1331
|
-
if (trimmed.startsWith("```")) {
|
|
1332
|
-
const lines = trimmed.split("\n");
|
|
1333
|
-
const code = lines.slice(1, -1).join("\n");
|
|
1334
|
-
elements.push(
|
|
1335
|
-
<pre
|
|
1336
|
-
key={`code:${code}`}
|
|
1337
|
-
className="bg-[var(--bg-hover)] px-3 py-2 rounded-sm overflow-x-auto my-2"
|
|
1338
|
-
>
|
|
1339
|
-
<code className="font-mono text-[12px]">{code}</code>
|
|
1340
|
-
</pre>,
|
|
1341
|
-
);
|
|
1342
|
-
return;
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
// Heading
|
|
1346
|
-
const headingMatch = trimmed.match(/^(#{1,6})\s+(.+)$/);
|
|
1347
|
-
if (headingMatch) {
|
|
1348
|
-
const level = headingMatch[1].length;
|
|
1349
|
-
const content = processInline(headingMatch[2]);
|
|
1350
|
-
const sizes = [
|
|
1351
|
-
"text-xl",
|
|
1352
|
-
"text-lg",
|
|
1353
|
-
"text-base",
|
|
1354
|
-
"text-sm",
|
|
1355
|
-
"text-sm",
|
|
1356
|
-
"text-xs",
|
|
1357
|
-
];
|
|
1358
|
-
const cls = `${sizes[level - 1]} font-bold mb-1 mt-2`;
|
|
1359
|
-
elements.push(
|
|
1360
|
-
React.createElement(
|
|
1361
|
-
`h${level}`,
|
|
1362
|
-
{ key: `heading:${headingMatch[2]}`, className: cls },
|
|
1363
|
-
content,
|
|
1364
|
-
),
|
|
1365
|
-
);
|
|
1366
|
-
return;
|
|
1367
|
-
}
|
|
1368
|
-
|
|
1369
|
-
// Unordered list
|
|
1370
|
-
if (/^[-*]\s/.test(trimmed)) {
|
|
1371
|
-
const items = trimmed.split("\n").filter((l) => /^[-*]\s/.test(l));
|
|
1372
|
-
elements.push(
|
|
1373
|
-
<ul key={`list:${trimmed}`} className="list-disc pl-4 my-2 space-y-1">
|
|
1374
|
-
{items.map((item) => (
|
|
1375
|
-
<li key={item}>{processInline(item.replace(/^[-*]\s/, ""))}</li>
|
|
1376
|
-
))}
|
|
1377
|
-
</ul>,
|
|
1378
|
-
);
|
|
1379
|
-
return;
|
|
1380
|
-
}
|
|
1381
|
-
|
|
1382
|
-
// Regular paragraph
|
|
1383
|
-
elements.push(
|
|
1384
|
-
<p key={`paragraph:${trimmed}`} className="my-2">
|
|
1385
|
-
{processInline(trimmed)}
|
|
1386
|
-
</p>,
|
|
1387
|
-
);
|
|
1388
|
-
});
|
|
1389
|
-
|
|
1390
|
-
return <>{elements}</>;
|
|
1391
|
-
}
|
|
1392
|
-
|
|
1393
|
-
/**
|
|
1394
|
-
* Process inline markdown patterns (bold, italic, code, links).
|
|
1395
|
-
*/
|
|
1396
|
-
function processInline(text: string): React.ReactNode {
|
|
1397
|
-
const parts: React.ReactNode[] = [];
|
|
1398
|
-
let remaining = text;
|
|
1399
|
-
let key = 0;
|
|
1400
|
-
|
|
1401
|
-
while (remaining) {
|
|
1402
|
-
// Link: [text](url)
|
|
1403
|
-
const linkMatch = remaining.match(/\[([^\]]+)\]\(([^)]+)\)/);
|
|
1404
|
-
if (linkMatch) {
|
|
1405
|
-
const before = remaining.substring(0, linkMatch.index);
|
|
1406
|
-
if (before) parts.push(processSimpleInline(before, key++));
|
|
1407
|
-
parts.push(
|
|
1408
|
-
<a
|
|
1409
|
-
key={key++}
|
|
1410
|
-
href={linkMatch[2]}
|
|
1411
|
-
target="_blank"
|
|
1412
|
-
rel="noopener noreferrer"
|
|
1413
|
-
className="text-[var(--accent)] underline"
|
|
1414
|
-
>
|
|
1415
|
-
{linkMatch[1]}
|
|
1416
|
-
</a>,
|
|
1417
|
-
);
|
|
1418
|
-
const linkIndex = linkMatch.index ?? 0;
|
|
1419
|
-
remaining = remaining.substring(linkIndex + linkMatch[0].length);
|
|
1420
|
-
continue;
|
|
1421
|
-
}
|
|
1422
|
-
|
|
1423
|
-
// Inline code: `code`
|
|
1424
|
-
const codeMatch = remaining.match(/`([^`]+)`/);
|
|
1425
|
-
if (codeMatch) {
|
|
1426
|
-
const before = remaining.substring(0, codeMatch.index);
|
|
1427
|
-
if (before) parts.push(processSimpleInline(before, key++));
|
|
1428
|
-
parts.push(
|
|
1429
|
-
<code
|
|
1430
|
-
key={key++}
|
|
1431
|
-
className="bg-[var(--bg-hover)] px-1 py-0.5 rounded font-mono text-[12px]"
|
|
1432
|
-
>
|
|
1433
|
-
{codeMatch[1]}
|
|
1434
|
-
</code>,
|
|
1435
|
-
);
|
|
1436
|
-
const codeIndex = codeMatch.index ?? 0;
|
|
1437
|
-
remaining = remaining.substring(codeIndex + codeMatch[0].length);
|
|
1438
|
-
continue;
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
|
-
// Bold: **text**
|
|
1442
|
-
const boldMatch = remaining.match(/\*\*([^*]+)\*\*/);
|
|
1443
|
-
if (boldMatch) {
|
|
1444
|
-
const before = remaining.substring(0, boldMatch.index);
|
|
1445
|
-
if (before) parts.push(processSimpleInline(before, key++));
|
|
1446
|
-
parts.push(<strong key={key++}>{boldMatch[1]}</strong>);
|
|
1447
|
-
const boldIndex = boldMatch.index ?? 0;
|
|
1448
|
-
remaining = remaining.substring(boldIndex + boldMatch[0].length);
|
|
1449
|
-
continue;
|
|
1450
|
-
}
|
|
1451
|
-
|
|
1452
|
-
// Italic: *text* or _text_
|
|
1453
|
-
const italicMatch = remaining.match(/(\*|_)([^*_]+)\1/);
|
|
1454
|
-
if (italicMatch) {
|
|
1455
|
-
const before = remaining.substring(0, italicMatch.index);
|
|
1456
|
-
if (before) parts.push(processSimpleInline(before, key++));
|
|
1457
|
-
parts.push(<em key={key++}>{italicMatch[2]}</em>);
|
|
1458
|
-
const italicIndex = italicMatch.index ?? 0;
|
|
1459
|
-
remaining = remaining.substring(italicIndex + italicMatch[0].length);
|
|
1460
|
-
continue;
|
|
1461
|
-
}
|
|
1462
|
-
|
|
1463
|
-
// No more patterns found
|
|
1464
|
-
parts.push(remaining);
|
|
1465
|
-
break;
|
|
1466
|
-
}
|
|
1467
|
-
|
|
1468
|
-
return <>{parts}</>;
|
|
1469
|
-
}
|
|
1470
|
-
|
|
1471
|
-
/**
|
|
1472
|
-
* Helper to handle plain text without additional patterns.
|
|
1473
|
-
*/
|
|
1474
|
-
function processSimpleInline(text: string, key: number): React.ReactNode {
|
|
1475
|
-
return <span key={key}>{text}</span>;
|
|
1476
|
-
}
|
|
1477
|
-
|
|
1478
|
-
function MarkdownFieldInner(props: FieldRenderProps) {
|
|
1479
|
-
const { t } = useApp();
|
|
1480
|
-
const [preview, setPreview] = useState(false);
|
|
1481
|
-
const value = typeof props.value === "string" ? props.value : "";
|
|
1482
|
-
|
|
1483
|
-
return (
|
|
1484
|
-
<div className="flex flex-col gap-1.5">
|
|
1485
|
-
<div className="flex items-center gap-2 mb-1">
|
|
1486
|
-
<button
|
|
1487
|
-
type="button"
|
|
1488
|
-
className={`text-[11px] px-2 py-0.5 border transition-colors ${
|
|
1489
|
-
!preview
|
|
1490
|
-
? "bg-[var(--accent)] text-[var(--accent-fg)] border-[var(--accent)]"
|
|
1491
|
-
: "bg-transparent text-[var(--muted)] border-[var(--border)] hover:text-[var(--txt)]"
|
|
1492
|
-
}`}
|
|
1493
|
-
onClick={() => setPreview(false)}
|
|
1494
|
-
>
|
|
1495
|
-
{t("config-field.Edit", { defaultValue: "Edit" })}
|
|
1496
|
-
</button>
|
|
1497
|
-
<button
|
|
1498
|
-
type="button"
|
|
1499
|
-
className={`text-[11px] px-2 py-0.5 border transition-colors ${
|
|
1500
|
-
preview
|
|
1501
|
-
? "bg-[var(--accent)] text-[var(--accent-fg)] border-[var(--accent)]"
|
|
1502
|
-
: "bg-transparent text-[var(--muted)] border-[var(--border)] hover:text-[var(--txt)]"
|
|
1503
|
-
}`}
|
|
1504
|
-
onClick={() => setPreview(true)}
|
|
1505
|
-
>
|
|
1506
|
-
{t("config-field.Preview", { defaultValue: "Preview" })}
|
|
1507
|
-
</button>
|
|
1508
|
-
</div>
|
|
1509
|
-
{preview ? (
|
|
1510
|
-
<div
|
|
1511
|
-
className="min-h-[100px] px-3 py-2 border border-[var(--border)] bg-[var(--surface)] text-[13px] leading-relaxed"
|
|
1512
|
-
data-config-key={props.key}
|
|
1513
|
-
data-field-type="markdown"
|
|
1514
|
-
>
|
|
1515
|
-
{value ? (
|
|
1516
|
-
renderMarkdown(value)
|
|
1517
|
-
) : (
|
|
1518
|
-
<span className="text-[var(--muted)] italic">
|
|
1519
|
-
{t("config-field.NothingToPreview", {
|
|
1520
|
-
defaultValue: "Nothing to preview",
|
|
1521
|
-
})}
|
|
1522
|
-
</span>
|
|
1523
|
-
)}
|
|
1524
|
-
</div>
|
|
1525
|
-
) : (
|
|
1526
|
-
<textarea
|
|
1527
|
-
className={`${inputCls(!!props.errors?.length)} min-h-[100px] h-auto resize-y font-[var(--mono)]`}
|
|
1528
|
-
defaultValue={value}
|
|
1529
|
-
placeholder={props.hint.placeholder ?? "Markdown content..."}
|
|
1530
|
-
data-config-key={props.key}
|
|
1531
|
-
data-field-type="markdown"
|
|
1532
|
-
disabled={props.readonly}
|
|
1533
|
-
onChange={(e) => {
|
|
1534
|
-
props.onChange(e.target.value);
|
|
1535
|
-
fireAction(props, "change");
|
|
1536
|
-
}}
|
|
1537
|
-
onBlur={() => fireAction(props, "blur")}
|
|
1538
|
-
/>
|
|
1539
|
-
)}
|
|
1540
|
-
</div>
|
|
1541
|
-
);
|
|
1542
|
-
}
|
|
1543
|
-
/** Markdown textarea with Edit/Preview toggle. */
|
|
1544
|
-
export const renderMarkdownField: FieldRenderer = (props) => (
|
|
1545
|
-
<MarkdownFieldInner {...props} />
|
|
1546
|
-
);
|
|
1547
|
-
|
|
1548
|
-
// ── 21. Checkbox Group ───────────────────────────────────────────────────
|
|
1549
|
-
|
|
1550
|
-
function CheckboxGroupInner(props: FieldRenderProps) {
|
|
1551
|
-
const { t } = useApp();
|
|
1552
|
-
const selected = new Set(
|
|
1553
|
-
Array.isArray(props.value)
|
|
1554
|
-
? (props.value as string[])
|
|
1555
|
-
: typeof props.value === "string" && props.value
|
|
1556
|
-
? props.value.split(",").map((s) => s.trim())
|
|
1557
|
-
: [],
|
|
1558
|
-
);
|
|
1559
|
-
const options: Array<{
|
|
1560
|
-
value: string;
|
|
1561
|
-
label: string;
|
|
1562
|
-
description?: string;
|
|
1563
|
-
disabled?: boolean;
|
|
1564
|
-
}> =
|
|
1565
|
-
props.hint.options ??
|
|
1566
|
-
(props.schema.enum as string[] | undefined)?.map((v) => ({
|
|
1567
|
-
value: v,
|
|
1568
|
-
label: v,
|
|
1569
|
-
})) ??
|
|
1570
|
-
[];
|
|
1571
|
-
|
|
1572
|
-
const toggle = (val: string) => {
|
|
1573
|
-
const next = new Set(selected);
|
|
1574
|
-
if (next.has(val)) next.delete(val);
|
|
1575
|
-
else next.add(val);
|
|
1576
|
-
props.onChange([...next]);
|
|
1577
|
-
fireAction(props, "change");
|
|
1578
|
-
};
|
|
1579
|
-
|
|
1580
|
-
return (
|
|
1581
|
-
<div
|
|
1582
|
-
className="flex flex-col gap-1.5"
|
|
1583
|
-
data-config-key={props.key}
|
|
1584
|
-
data-field-type="checkbox-group"
|
|
1585
|
-
>
|
|
1586
|
-
{options.map((opt) => (
|
|
1587
|
-
<label
|
|
1588
|
-
key={opt.value}
|
|
1589
|
-
className={`flex items-start gap-2.5 px-3 py-2 border border-[var(--border)] bg-[var(--card)] cursor-pointer transition-colors hover:bg-[var(--bg-hover)] ${
|
|
1590
|
-
selected.has(opt.value)
|
|
1591
|
-
? "border-[var(--accent)] bg-[color-mix(in_srgb,var(--accent)_5%,var(--card))]"
|
|
1592
|
-
: ""
|
|
1593
|
-
} ${opt.disabled ? "opacity-50 pointer-events-none" : ""}`}
|
|
1594
|
-
>
|
|
1595
|
-
<input
|
|
1596
|
-
type="checkbox"
|
|
1597
|
-
checked={selected.has(opt.value)}
|
|
1598
|
-
disabled={props.readonly || opt.disabled}
|
|
1599
|
-
onChange={() => toggle(opt.value)}
|
|
1600
|
-
className="mt-0.5 accent-[var(--accent)]"
|
|
1601
|
-
/>
|
|
1602
|
-
<div className="flex flex-col">
|
|
1603
|
-
<span className="text-[13px]">{opt.label}</span>
|
|
1604
|
-
{opt.description && (
|
|
1605
|
-
<span className="text-[11px] text-[var(--muted)] mt-0.5">
|
|
1606
|
-
{opt.description}
|
|
1607
|
-
</span>
|
|
1608
|
-
)}
|
|
1609
|
-
</div>
|
|
1610
|
-
</label>
|
|
1611
|
-
))}
|
|
1612
|
-
{options.length === 0 && (
|
|
1613
|
-
<span className="text-[11px] text-[var(--muted)] italic">
|
|
1614
|
-
{t("config-field.NoOptionsDefined", {
|
|
1615
|
-
defaultValue: "No options defined",
|
|
1616
|
-
})}
|
|
1617
|
-
</span>
|
|
1618
|
-
)}
|
|
1619
|
-
</div>
|
|
1620
|
-
);
|
|
1621
|
-
}
|
|
1622
|
-
/** Vertical checkbox list with per-option descriptions and accent highlighting. */
|
|
1623
|
-
export const renderCheckboxGroupField: FieldRenderer = (props) => (
|
|
1624
|
-
<CheckboxGroupInner {...props} />
|
|
1625
|
-
);
|
|
1626
|
-
|
|
1627
|
-
// ── 22. Group ────────────────────────────────────────────────────────────
|
|
1628
|
-
|
|
1629
|
-
/** Fieldset container with legend label. */
|
|
1630
|
-
export const renderGroupField: FieldRenderer = (props) => {
|
|
1631
|
-
const value = typeof props.value === "string" ? props.value : "";
|
|
1632
|
-
return (
|
|
1633
|
-
<fieldset
|
|
1634
|
-
className="border border-[var(--border)] px-4 py-3 bg-[var(--surface)]"
|
|
1635
|
-
data-config-key={props.key}
|
|
1636
|
-
data-field-type="group"
|
|
1637
|
-
>
|
|
1638
|
-
<legend className="text-[12px] font-semibold text-[var(--muted)] px-1.5">
|
|
1639
|
-
{props.hint.label ?? props.key}
|
|
1640
|
-
</legend>
|
|
1641
|
-
<textarea
|
|
1642
|
-
className={`${inputCls(!!props.errors?.length)} min-h-[60px] h-auto resize-y`}
|
|
1643
|
-
defaultValue={value}
|
|
1644
|
-
placeholder={props.hint.placeholder ?? "Group configuration..."}
|
|
1645
|
-
disabled={props.readonly}
|
|
1646
|
-
onChange={(e) => {
|
|
1647
|
-
props.onChange(e.target.value);
|
|
1648
|
-
fireAction(props, "change");
|
|
1649
|
-
}}
|
|
1650
|
-
onBlur={() => fireAction(props, "blur")}
|
|
1651
|
-
/>
|
|
1652
|
-
</fieldset>
|
|
1653
|
-
);
|
|
1654
|
-
};
|
|
1655
|
-
|
|
1656
|
-
// ── 23. Table ────────────────────────────────────────────────────────────
|
|
1657
|
-
|
|
1658
|
-
function TableFieldInner(props: FieldRenderProps) {
|
|
1659
|
-
const { t } = useApp();
|
|
1660
|
-
const MAX_TABLE_ROWS = 50;
|
|
1661
|
-
const columns: Array<{ key: string; label: string }> = ((
|
|
1662
|
-
props.hint as Record<string, unknown>
|
|
1663
|
-
).columns as Array<{ key: string; label: string }>) ?? [
|
|
1664
|
-
{ key: "key", label: "Key" },
|
|
1665
|
-
{ key: "value", label: "Value" },
|
|
1666
|
-
];
|
|
1667
|
-
|
|
1668
|
-
const rawRows = Array.isArray(props.value)
|
|
1669
|
-
? (props.value as Record<string, string>[])
|
|
1670
|
-
: [];
|
|
1671
|
-
const [rows, setRows] = useState<Record<string, string>[]>(
|
|
1672
|
-
rawRows.length > 0
|
|
1673
|
-
? rawRows
|
|
1674
|
-
: [Object.fromEntries(columns.map((c) => [c.key, ""]))],
|
|
1675
|
-
);
|
|
1676
|
-
|
|
1677
|
-
const emit = (next: Record<string, string>[]) => {
|
|
1678
|
-
setRows(next);
|
|
1679
|
-
props.onChange(next.filter((r) => columns.some((c) => r[c.key]?.trim())));
|
|
1680
|
-
fireAction(props, "change");
|
|
1681
|
-
};
|
|
1682
|
-
|
|
1683
|
-
const updateCell = (rowIdx: number, colKey: string, val: string) => {
|
|
1684
|
-
if (["__proto__", "constructor", "prototype"].includes(colKey)) return;
|
|
1685
|
-
const next = [...rows];
|
|
1686
|
-
next[rowIdx] = { ...next[rowIdx], [colKey]: val };
|
|
1687
|
-
emit(next);
|
|
1688
|
-
};
|
|
1689
|
-
|
|
1690
|
-
const addRow = () => {
|
|
1691
|
-
if (rows.length >= MAX_TABLE_ROWS) return;
|
|
1692
|
-
emit([...rows, Object.fromEntries(columns.map((c) => [c.key, ""]))]);
|
|
1693
|
-
};
|
|
1694
|
-
|
|
1695
|
-
const removeRow = (idx: number) => {
|
|
1696
|
-
if (rows.length <= 1) return;
|
|
1697
|
-
emit(rows.filter((_, i) => i !== idx));
|
|
1698
|
-
};
|
|
1699
|
-
|
|
1700
|
-
return (
|
|
1701
|
-
<div
|
|
1702
|
-
className="flex flex-col gap-1.5"
|
|
1703
|
-
data-config-key={props.key}
|
|
1704
|
-
data-field-type="table"
|
|
1705
|
-
>
|
|
1706
|
-
<div className="border border-[var(--border)] overflow-x-auto">
|
|
1707
|
-
<table className="w-full text-[13px] border-collapse">
|
|
1708
|
-
<thead>
|
|
1709
|
-
<tr className="bg-[var(--surface)]">
|
|
1710
|
-
{columns.map((col) => (
|
|
1711
|
-
<th
|
|
1712
|
-
key={col.key}
|
|
1713
|
-
className="text-left text-[11px] font-semibold text-[var(--muted)] px-3 py-1.5 border-b border-[var(--border)]"
|
|
1714
|
-
>
|
|
1715
|
-
{col.label}
|
|
1716
|
-
</th>
|
|
1717
|
-
))}
|
|
1718
|
-
<th className="w-[36px] border-b border-[var(--border)]" />
|
|
1719
|
-
</tr>
|
|
1720
|
-
</thead>
|
|
1721
|
-
<tbody>
|
|
1722
|
-
{rows.map((row, ri) => (
|
|
1723
|
-
<tr
|
|
1724
|
-
key={JSON.stringify(row)}
|
|
1725
|
-
className="border-b border-[var(--border)] last:border-b-0"
|
|
1726
|
-
>
|
|
1727
|
-
{columns.map((col) => (
|
|
1728
|
-
<td key={col.key} className="px-1 py-0.5">
|
|
1729
|
-
<input
|
|
1730
|
-
className="w-full px-2 py-1 bg-transparent text-[13px] border-none outline-none focus:bg-[var(--bg-hover)]"
|
|
1731
|
-
value={row[col.key] ?? ""}
|
|
1732
|
-
placeholder={col.label}
|
|
1733
|
-
disabled={props.readonly}
|
|
1734
|
-
onChange={(e) => updateCell(ri, col.key, e.target.value)}
|
|
1735
|
-
/>
|
|
1736
|
-
</td>
|
|
1737
|
-
))}
|
|
1738
|
-
<td className="text-center">
|
|
1739
|
-
{!props.readonly && rows.length > 1 && (
|
|
1740
|
-
<button
|
|
1741
|
-
type="button"
|
|
1742
|
-
className="text-[var(--muted)] hover:text-[var(--destructive)] text-[14px] px-1"
|
|
1743
|
-
onClick={() => removeRow(ri)}
|
|
1744
|
-
title={t("config-field.RemoveRow", {
|
|
1745
|
-
defaultValue: "Remove row",
|
|
1746
|
-
})}
|
|
1747
|
-
>
|
|
1748
|
-
{t("config-field.Times")}
|
|
1749
|
-
</button>
|
|
1750
|
-
)}
|
|
1751
|
-
</td>
|
|
1752
|
-
</tr>
|
|
1753
|
-
))}
|
|
1754
|
-
</tbody>
|
|
1755
|
-
</table>
|
|
1756
|
-
</div>
|
|
1757
|
-
{!props.readonly && rows.length < MAX_TABLE_ROWS && (
|
|
1758
|
-
<button
|
|
1759
|
-
type="button"
|
|
1760
|
-
className="self-start text-[11px] text-[var(--accent)] hover:underline"
|
|
1761
|
-
onClick={addRow}
|
|
1762
|
-
>
|
|
1763
|
-
{t("config-field.AddRow", { defaultValue: "Add row" })}
|
|
1764
|
-
</button>
|
|
1765
|
-
)}
|
|
1766
|
-
</div>
|
|
1767
|
-
);
|
|
1768
|
-
}
|
|
1769
|
-
/** Tabular data editor with configurable columns. Max 50 rows. */
|
|
1770
|
-
export const renderTableField: FieldRenderer = (props) => (
|
|
1771
|
-
<TableFieldInner {...props} />
|
|
1772
|
-
);
|
|
1773
|
-
|
|
1774
|
-
// ── Default renderers map ───────────────────────────────────────────────
|
|
1775
|
-
|
|
1776
|
-
export const defaultRenderers: Record<string, FieldRenderer> = {
|
|
1777
|
-
text: renderTextField,
|
|
1778
|
-
password: renderPasswordField,
|
|
1779
|
-
number: renderNumberField,
|
|
1780
|
-
boolean: renderBooleanField,
|
|
1781
|
-
url: renderUrlField,
|
|
1782
|
-
select: RenderSelectField,
|
|
1783
|
-
textarea: renderTextareaField,
|
|
1784
|
-
email: renderEmailField,
|
|
1785
|
-
color: renderColorField,
|
|
1786
|
-
radio: renderRadioField,
|
|
1787
|
-
multiselect: renderMultiselectField,
|
|
1788
|
-
date: renderDateField,
|
|
1789
|
-
json: renderJsonField,
|
|
1790
|
-
code: renderCodeField,
|
|
1791
|
-
array: renderArrayField,
|
|
1792
|
-
keyvalue: renderKeyValueField,
|
|
1793
|
-
datetime: renderDatetimeField,
|
|
1794
|
-
file: RenderFileField,
|
|
1795
|
-
custom: RenderCustomField,
|
|
1796
|
-
markdown: renderMarkdownField,
|
|
1797
|
-
"checkbox-group": renderCheckboxGroupField,
|
|
1798
|
-
group: renderGroupField,
|
|
1799
|
-
table: renderTableField,
|
|
1800
|
-
};
|
|
1801
|
-
|
|
1802
|
-
// ── ConfigField wrapper component ───────────────────────────────────────
|
|
1803
|
-
|
|
1804
|
-
/**
|
|
1805
|
-
* Wraps a field renderer with the standard label row, env key display,
|
|
1806
|
-
* help text, and error messages.
|
|
1807
|
-
*/
|
|
1808
|
-
export function ConfigField({
|
|
1809
|
-
renderProps,
|
|
1810
|
-
renderer,
|
|
1811
|
-
pluginId,
|
|
1812
|
-
}: {
|
|
1813
|
-
renderProps: FieldRenderProps;
|
|
1814
|
-
renderer: FieldRenderer;
|
|
1815
|
-
pluginId?: string;
|
|
1816
|
-
}) {
|
|
1817
|
-
const { t } = useApp();
|
|
1818
|
-
const label = renderProps.hint.label ?? renderProps.key;
|
|
1819
|
-
const envKey = renderProps.key;
|
|
1820
|
-
const labelDiffersFromKey = label !== envKey;
|
|
1821
|
-
const errors = renderProps.errors ?? [];
|
|
1822
|
-
const hasError = errors.length > 0;
|
|
1823
|
-
const isRequiredEmpty = renderProps.required && !renderProps.isSet;
|
|
1824
|
-
|
|
1825
|
-
const renderFn =
|
|
1826
|
-
renderer ??
|
|
1827
|
-
defaultRenderers[renderProps.fieldType] ??
|
|
1828
|
-
defaultRenderers.text;
|
|
1829
|
-
|
|
1830
|
-
return (
|
|
1831
|
-
<div
|
|
1832
|
-
id={
|
|
1833
|
-
pluginId
|
|
1834
|
-
? `field-${pluginId}-${renderProps.key}`
|
|
1835
|
-
: `field-${renderProps.key}`
|
|
1836
|
-
}
|
|
1837
|
-
className={`py-2.5 group/field ${
|
|
1838
|
-
renderProps.readonly ? "opacity-50 pointer-events-none" : ""
|
|
1839
|
-
} ${isRequiredEmpty ? "relative" : ""}`}
|
|
1840
|
-
>
|
|
1841
|
-
{/* Required-but-empty accent bar */}
|
|
1842
|
-
{isRequiredEmpty && (
|
|
1843
|
-
<div className="absolute left-0 top-2.5 bottom-2.5 w-[2px] bg-[var(--destructive)] opacity-40 rounded-full" />
|
|
1844
|
-
)}
|
|
1845
|
-
|
|
1846
|
-
<div className={isRequiredEmpty ? "pl-2.5" : ""}>
|
|
1847
|
-
{/* Label row */}
|
|
1848
|
-
<div className="flex items-center gap-2 mb-1.5">
|
|
1849
|
-
<span
|
|
1850
|
-
className="font-semibold leading-tight truncate"
|
|
1851
|
-
style={{
|
|
1852
|
-
fontSize: "var(--plugin-label-size)",
|
|
1853
|
-
color: "var(--plugin-label)",
|
|
1854
|
-
}}
|
|
1855
|
-
>
|
|
1856
|
-
{label}
|
|
1857
|
-
</span>
|
|
1858
|
-
{renderProps.required && !renderProps.isSet && (
|
|
1859
|
-
<span className="text-[10px] text-[var(--destructive)] font-semibold px-1.5 py-px bg-[color-mix(in_srgb,var(--destructive)_10%,transparent)] rounded-sm shrink-0">
|
|
1860
|
-
{t("config-field.Required")}
|
|
1861
|
-
</span>
|
|
1862
|
-
)}
|
|
1863
|
-
{renderProps.isSet && (
|
|
1864
|
-
<span className="inline-flex items-center gap-1 text-[10px] text-[var(--ok)] font-medium shrink-0">
|
|
1865
|
-
<span className="inline-block w-1.5 h-1.5 rounded-full bg-[var(--ok)]" />
|
|
1866
|
-
|
|
1867
|
-
{t("config-field.Configured")}
|
|
1868
|
-
</span>
|
|
1869
|
-
)}
|
|
1870
|
-
{/* Env key — right-aligned, subtle, only when label differs */}
|
|
1871
|
-
{labelDiffersFromKey && (
|
|
1872
|
-
<code className="text-[10px] font-mono text-[var(--muted)] opacity-0 group-hover/field:opacity-50 transition-opacity truncate ml-auto">
|
|
1873
|
-
{envKey}
|
|
1874
|
-
</code>
|
|
1875
|
-
)}
|
|
1876
|
-
</div>
|
|
1877
|
-
|
|
1878
|
-
{/* Field renderer */}
|
|
1879
|
-
{renderFn(renderProps)}
|
|
1880
|
-
|
|
1881
|
-
{/* Errors */}
|
|
1882
|
-
{hasError && (
|
|
1883
|
-
<div className="mt-1.5 flex flex-col gap-0.5">
|
|
1884
|
-
{errors.map((err) => (
|
|
1885
|
-
<div
|
|
1886
|
-
key={err}
|
|
1887
|
-
className="leading-snug flex items-start gap-1"
|
|
1888
|
-
style={{
|
|
1889
|
-
fontSize: "var(--plugin-error-size)",
|
|
1890
|
-
color: "var(--plugin-error)",
|
|
1891
|
-
}}
|
|
1892
|
-
>
|
|
1893
|
-
<span className="shrink-0 mt-px">
|
|
1894
|
-
{t("config-field.Times")}
|
|
1895
|
-
</span>
|
|
1896
|
-
<span>{err}</span>
|
|
1897
|
-
</div>
|
|
1898
|
-
))}
|
|
1899
|
-
</div>
|
|
1900
|
-
)}
|
|
1901
|
-
|
|
1902
|
-
{/* Help text */}
|
|
1903
|
-
{(renderProps.hint.help || renderProps.schema.description) && (
|
|
1904
|
-
<div
|
|
1905
|
-
className="mt-1 leading-relaxed line-clamp-2"
|
|
1906
|
-
style={{
|
|
1907
|
-
fontSize: "var(--plugin-help-size)",
|
|
1908
|
-
color: "var(--plugin-help)",
|
|
1909
|
-
}}
|
|
1910
|
-
>
|
|
1911
|
-
{renderProps.hint.help ?? renderProps.schema.description}
|
|
1912
|
-
{renderProps.schema.default != null && (
|
|
1913
|
-
<span className="opacity-70">
|
|
1914
|
-
{" "}
|
|
1915
|
-
{t("config-field.Default", { defaultValue: "Default" })}{" "}
|
|
1916
|
-
{String(renderProps.schema.default)})
|
|
1917
|
-
</span>
|
|
1918
|
-
)}
|
|
1919
|
-
</div>
|
|
1920
|
-
)}
|
|
1921
|
-
</div>
|
|
1922
|
-
</div>
|
|
1923
|
-
);
|
|
1924
|
-
}
|