@blocklet/pages-kit 0.2.349 → 0.2.351
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/lib/cjs/builtin/async/ai-runtime/hooks/use-header-menu.js +2 -1
- package/lib/cjs/builtin/async/ai-runtime/runtime/Runtime/index.js +2 -0
- package/lib/cjs/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +0 -2
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/builtin/async/ai-runtime/hooks/use-header-menu.js +2 -1
- package/lib/esm/builtin/async/ai-runtime/runtime/Runtime/index.js +2 -0
- package/lib/esm/builtin/async/ai-runtime/runtime-components/SimpleChat/index.js +0 -2
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -26,12 +26,13 @@ export function useHeaderMenu() {
|
|
|
26
26
|
const clearSession = useSessionState((s) => s.clearSession);
|
|
27
27
|
const { agent } = useRuntimeState();
|
|
28
28
|
const isAdmin = useIsAgentAdmin(agent);
|
|
29
|
+
const hasSettings = agent.config.secrets.length > 0;
|
|
29
30
|
useHeader(() => hideHeaderMenuButton
|
|
30
31
|
? {}
|
|
31
32
|
: {
|
|
32
33
|
addons: (exists) => [
|
|
33
34
|
_jsx(PopperMenuButton, { component: IconButton, PopperProps: { placement: 'bottom-end', sx: { zIndex: 'appBar' } }, menus: [
|
|
34
|
-
isAdmin && (_jsxs(MenuItem, { onClick: () => settingsDialogState.getState().open(), children: [_jsx(ListItemIcon, { children: _jsx(Icon, { icon: "tabler:settings" }) }), t('settings')] }, "settings")),
|
|
35
|
+
hasSettings && isAdmin && (_jsxs(MenuItem, { onClick: () => settingsDialogState.getState().open(), children: [_jsx(ListItemIcon, { children: _jsx(Icon, { icon: "tabler:settings" }) }), t('settings')] }, "settings")),
|
|
35
36
|
_jsxs(LoadingMenuItem, { onClick: () => __awaiter(this, void 0, void 0, function* () { return clearSession(); }), children: [_jsx(ListItemIcon, { children: _jsx(Icon, { icon: "mingcute:broom-line" }) }), t('clearSession')] }, "clearSession"),
|
|
36
37
|
], children: _jsx(Icon, { icon: "tabler:dots" }) }),
|
|
37
38
|
...exists,
|
|
@@ -15,6 +15,7 @@ import { AI_STUDIO_DID, DEFAULT_PAGE_COMPONENT_ID } from '../../constants';
|
|
|
15
15
|
import ActiveAgentProvider from '../../contexts/ActiveAgent';
|
|
16
16
|
import RuntimeProvider, { RuntimeProviderFromUrl } from '../../contexts/Runtime';
|
|
17
17
|
import useAppearances from '../../hooks/use-appearances';
|
|
18
|
+
import { useHeaderMenu } from '../../hooks/use-header-menu';
|
|
18
19
|
import { useRuntimeState } from '../../state/runtime';
|
|
19
20
|
const logoSize = 44;
|
|
20
21
|
function AgentCreatedBy({ did }) {
|
|
@@ -58,6 +59,7 @@ ${agent === null || agent === void 0 ? void 0 : agent.description}
|
|
|
58
59
|
addons: (exists) => [_jsx(SocialShare, { content: shareContent }), ...exists].filter(Boolean),
|
|
59
60
|
};
|
|
60
61
|
}, [locale, isMobile, agent]);
|
|
62
|
+
useHeaderMenu();
|
|
61
63
|
const componentId = (_a = appearancePage === null || appearancePage === void 0 ? void 0 : appearancePage.componentId) !== null && _a !== void 0 ? _a : DEFAULT_PAGE_COMPONENT_ID;
|
|
62
64
|
return (_jsxs(_Fragment, { children: [_jsxs(Helmet, { children: [agent.project.name && _jsx("title", { children: agent.project.name }), agent.project.description && _jsx("meta", { name: "description", content: agent.project.description })] }), _jsx(CustomComponentRenderer, { componentId: componentId, properties: appearancePage === null || appearancePage === void 0 ? void 0 : appearancePage.componentProperties }), _jsx(AgentSettingsDialog, {})] }));
|
|
63
65
|
}
|
|
@@ -19,7 +19,6 @@ import ScrollView from '../../components/ScrollView';
|
|
|
19
19
|
import { useActiveAgent } from '../../contexts/ActiveAgent';
|
|
20
20
|
import { ComponentPreferencesProvider, useComponentPreferences } from '../../contexts/ComponentPreferences';
|
|
21
21
|
import CurrentAgentProvider from '../../contexts/CurrentAgent';
|
|
22
|
-
import { useHeaderMenu } from '../../hooks/use-header-menu';
|
|
23
22
|
import { useAutoLoadSessionState, useCurrentSessionState, useSessionState } from '../../state/session';
|
|
24
23
|
import BackgroundImage from './BackgroundImage';
|
|
25
24
|
import InputsView from './InputsView';
|
|
@@ -43,7 +42,6 @@ function SimpleChatView() {
|
|
|
43
42
|
}, [scrollToBottom, running]);
|
|
44
43
|
const sessionLoading = useCurrentSessionState((s) => s === null || s === void 0 ? void 0 : s.loading);
|
|
45
44
|
const loading = useSessionState((s) => s === null || s === void 0 ? void 0 : s.loading) || sessionLoading;
|
|
46
|
-
useHeaderMenu();
|
|
47
45
|
return (_jsxs(SimpleLayout, { px: 0, children: [_jsx(SimpleHeader, { px: 4, sx: { color: hasBg ? 'white' : undefined } }), loading ? (_jsx(Box, { textAlign: "center", my: 10, children: _jsx(CircularProgress, { size: 24 }) })) : (_jsxs(_Fragment, { children: [_jsx(CurrentAgentProvider, { agentId: activeAgentId, children: _jsx(MessagesView, { className: "aigne-outputs aigne-simple-chat-outputs", flexGrow: 1, pb: 10, px: { xs: 2, sm: 3 } }) }), _jsx(CurrentAgentProvider, { agentId: activeAgentId, children: _jsx(InputsView, { className: "aigne-inputs aigne-simple-chat-inputs", sx: {
|
|
48
46
|
position: 'sticky',
|
|
49
47
|
bottom: 0,
|