@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
|
@@ -32,12 +32,13 @@ function useHeaderMenu() {
|
|
|
32
32
|
const clearSession = (0, session_1.useSessionState)((s) => s.clearSession);
|
|
33
33
|
const { agent } = (0, runtime_1.useRuntimeState)();
|
|
34
34
|
const isAdmin = (0, use_agent_admin_1.useIsAgentAdmin)(agent);
|
|
35
|
+
const hasSettings = agent.config.secrets.length > 0;
|
|
35
36
|
(0, header_1.useHeader)(() => hideHeaderMenuButton
|
|
36
37
|
? {}
|
|
37
38
|
: {
|
|
38
39
|
addons: (exists) => [
|
|
39
40
|
(0, jsx_runtime_1.jsx)(PopperMenuButton_1.default, { component: material_1.IconButton, PopperProps: { placement: 'bottom-end', sx: { zIndex: 'appBar' } }, menus: [
|
|
40
|
-
isAdmin && ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, { onClick: () => AgentSettingsDialog_1.settingsDialogState.getState().open(), children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:settings" }) }), t('settings')] }, "settings")),
|
|
41
|
+
hasSettings && isAdmin && ((0, jsx_runtime_1.jsxs)(material_1.MenuItem, { onClick: () => AgentSettingsDialog_1.settingsDialogState.getState().open(), children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:settings" }) }), t('settings')] }, "settings")),
|
|
41
42
|
(0, jsx_runtime_1.jsxs)(LoadingMenuItem_1.default, { onClick: () => __awaiter(this, void 0, void 0, function* () { return clearSession(); }), children: [(0, jsx_runtime_1.jsx)(material_1.ListItemIcon, { children: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "mingcute:broom-line" }) }), t('clearSession')] }, "clearSession"),
|
|
42
43
|
], children: (0, jsx_runtime_1.jsx)(react_1.Icon, { icon: "tabler:dots" }) }),
|
|
43
44
|
...exists,
|
|
@@ -43,6 +43,7 @@ const constants_1 = require("../../constants");
|
|
|
43
43
|
const ActiveAgent_1 = __importDefault(require("../../contexts/ActiveAgent"));
|
|
44
44
|
const Runtime_1 = __importStar(require("../../contexts/Runtime"));
|
|
45
45
|
const use_appearances_1 = __importDefault(require("../../hooks/use-appearances"));
|
|
46
|
+
const use_header_menu_1 = require("../../hooks/use-header-menu");
|
|
46
47
|
const runtime_1 = require("../../state/runtime");
|
|
47
48
|
const logoSize = 44;
|
|
48
49
|
function AgentCreatedBy({ did }) {
|
|
@@ -87,6 +88,7 @@ ${agent === null || agent === void 0 ? void 0 : agent.description}
|
|
|
87
88
|
addons: (exists) => [(0, jsx_runtime_1.jsx)(SocialShare_1.default, { content: shareContent }), ...exists].filter(Boolean),
|
|
88
89
|
};
|
|
89
90
|
}, [locale, isMobile, agent]);
|
|
91
|
+
(0, use_header_menu_1.useHeaderMenu)();
|
|
90
92
|
const componentId = (_a = appearancePage === null || appearancePage === void 0 ? void 0 : appearancePage.componentId) !== null && _a !== void 0 ? _a : constants_1.DEFAULT_PAGE_COMPONENT_ID;
|
|
91
93
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(react_helmet_1.Helmet, { children: [agent.project.name && (0, jsx_runtime_1.jsx)("title", { children: agent.project.name }), agent.project.description && (0, jsx_runtime_1.jsx)("meta", { name: "description", content: agent.project.description })] }), (0, jsx_runtime_1.jsx)(CustomComponentRenderer_1.default, { componentId: componentId, properties: appearancePage === null || appearancePage === void 0 ? void 0 : appearancePage.componentProperties }), (0, jsx_runtime_1.jsx)(AgentSettingsDialog_1.default, {})] }));
|
|
92
94
|
}
|
|
@@ -24,7 +24,6 @@ const ScrollView_1 = __importDefault(require("../../components/ScrollView"));
|
|
|
24
24
|
const ActiveAgent_1 = require("../../contexts/ActiveAgent");
|
|
25
25
|
const ComponentPreferences_1 = require("../../contexts/ComponentPreferences");
|
|
26
26
|
const CurrentAgent_1 = __importDefault(require("../../contexts/CurrentAgent"));
|
|
27
|
-
const use_header_menu_1 = require("../../hooks/use-header-menu");
|
|
28
27
|
const session_1 = require("../../state/session");
|
|
29
28
|
const BackgroundImage_1 = __importDefault(require("./BackgroundImage"));
|
|
30
29
|
const InputsView_1 = __importDefault(require("./InputsView"));
|
|
@@ -49,7 +48,6 @@ function SimpleChatView() {
|
|
|
49
48
|
}, [scrollToBottom, running]);
|
|
50
49
|
const sessionLoading = (0, session_1.useCurrentSessionState)((s) => s === null || s === void 0 ? void 0 : s.loading);
|
|
51
50
|
const loading = (0, session_1.useSessionState)((s) => s === null || s === void 0 ? void 0 : s.loading) || sessionLoading;
|
|
52
|
-
(0, use_header_menu_1.useHeaderMenu)();
|
|
53
51
|
return ((0, jsx_runtime_1.jsxs)(SimpleLayout_1.default, { px: 0, children: [(0, jsx_runtime_1.jsx)(SimpleHeader_1.default, { px: 4, sx: { color: hasBg ? 'white' : undefined } }), loading ? ((0, jsx_runtime_1.jsx)(material_1.Box, { textAlign: "center", my: 10, children: (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 24 }) })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(CurrentAgent_1.default, { agentId: activeAgentId, children: (0, jsx_runtime_1.jsx)(MessagesView_1.default, { className: "aigne-outputs aigne-simple-chat-outputs", flexGrow: 1, pb: 10, px: { xs: 2, sm: 3 } }) }), (0, jsx_runtime_1.jsx)(CurrentAgent_1.default, { agentId: activeAgentId, children: (0, jsx_runtime_1.jsx)(InputsView_1.default, { className: "aigne-inputs aigne-simple-chat-inputs", sx: {
|
|
54
52
|
position: 'sticky',
|
|
55
53
|
bottom: 0,
|