@blocklet/pages-kit 0.2.314 → 0.2.315
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/runtime/Runtime/index.js +8 -4
- package/lib/cjs/components/CustomComponentRenderer/state.js +1 -1
- package/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/builtin/async/ai-runtime/runtime/Runtime/index.js +8 -4
- package/lib/esm/components/CustomComponentRenderer/state.js +1 -1
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/types/builtin/async/ai-runtime/runtime/Runtime/index.d.ts +4 -1
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ import { getComponentMountPoint } from '../../../../utils';
|
|
|
10
10
|
import RuntimeCommonProvider, { RuntimeLocaleProvider } from '../../components/RuntimeCommonProvider';
|
|
11
11
|
import SocialShare from '../../components/SocialShare';
|
|
12
12
|
import { AI_STUDIO_DID, DEFAULT_PAGE_COMPONENT_ID } from '../../constants';
|
|
13
|
-
import { RuntimeProviderFromUrl } from '../../contexts/Runtime';
|
|
13
|
+
import RuntimeProvider, { RuntimeProviderFromUrl } from '../../contexts/Runtime';
|
|
14
14
|
import useAppearances from '../../hooks/use-appearances';
|
|
15
15
|
import { useRuntimeState } from '../../state/runtime';
|
|
16
16
|
const logoSize = 44;
|
|
@@ -18,8 +18,12 @@ function AgentCreatedBy({ did }) {
|
|
|
18
18
|
const { t } = useLocaleContext();
|
|
19
19
|
return (_jsxs(_Fragment, { children: [t('by'), " ", _jsx(Box, { component: DID, did: did, copyable: false, responsive: true })] }));
|
|
20
20
|
}
|
|
21
|
-
export default function Runtime() {
|
|
22
|
-
|
|
21
|
+
export default function Runtime({ aid, working }) {
|
|
22
|
+
const children = (_jsx(RuntimeCommonProvider, { children: _jsx(RuntimeView, {}) }));
|
|
23
|
+
if (aid) {
|
|
24
|
+
return (_jsx(RuntimeProvider, { aid: aid, working: working, children: children }));
|
|
25
|
+
}
|
|
26
|
+
return _jsx(RuntimeProviderFromUrl, { children: children });
|
|
23
27
|
}
|
|
24
28
|
function RuntimeView() {
|
|
25
29
|
var _a;
|
|
@@ -55,5 +59,5 @@ ${agent === null || agent === void 0 ? void 0 : agent.description}
|
|
|
55
59
|
};
|
|
56
60
|
}, [locale, isMobile, agent]);
|
|
57
61
|
const componentId = (_a = appearancePage === null || appearancePage === void 0 ? void 0 : appearancePage.componentId) !== null && _a !== void 0 ? _a : DEFAULT_PAGE_COMPONENT_ID;
|
|
58
|
-
return (_jsxs(
|
|
62
|
+
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.componentProps })] }));
|
|
59
63
|
}
|
|
@@ -135,7 +135,7 @@ function usePreloadComponent({ instanceId, componentId, properties, locale, dev
|
|
|
135
135
|
previousRef.current = result;
|
|
136
136
|
return result;
|
|
137
137
|
}
|
|
138
|
-
if (
|
|
138
|
+
if (instanceId) {
|
|
139
139
|
const key = [instanceId, realLocale].join('-');
|
|
140
140
|
(_a = COMPONENT_LOADER_MAP[key]) !== null && _a !== void 0 ? _a : (COMPONENT_LOADER_MAP[key] = customComponentStates()
|
|
141
141
|
.getState()
|